diff options
author | MichaIng <micha@dietpi.com> | 2021-06-20 13:20:10 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-20 13:20:10 +0300 |
commit | 4f47bec782c90d89a501e7ed5ed43c2816a8ce81 (patch) | |
tree | ad5bac61b7a005a92f234a44531354ff6ab24032 /core/Controller/PreviewController.php | |
parent | 4d51ed3918032c44df612fad6b2c12b0e9eff693 (diff) | |
parent | 61a31dcdd73aae9a728551421116c5947e5b3089 (diff) |
Merge branch 'master' into improve-contributing-docsimprove-contributing-docs
Diffstat (limited to 'core/Controller/PreviewController.php')
-rw-r--r-- | core/Controller/PreviewController.php | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/core/Controller/PreviewController.php b/core/Controller/PreviewController.php index 3fd1ce2c868..1224ea39877 100644 --- a/core/Controller/PreviewController.php +++ b/core/Controller/PreviewController.php @@ -5,6 +5,7 @@ declare(strict_types=1); /** * @copyright Copyright (c) 2016, Roeland Jago Douma <roeland@famdouma.nl> * + * @author Christoph Wurst <christoph@winzerhof-wurst.at> * @author Morris Jobke <hey@morrisjobke.de> * @author Roeland Jago Douma <roeland@famdouma.nl> * @@ -17,14 +18,13 @@ declare(strict_types=1); * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ - namespace OC\Core\Controller; use OCP\AppFramework\Controller; @@ -85,14 +85,13 @@ class PreviewController extends Controller { * @param string $mode * @return DataResponse|FileDisplayResponse */ - public function getPreview ( + public function getPreview( string $file = '', int $x = 32, int $y = 32, bool $a = false, bool $forceIcon = true, string $mode = 'fill'): Http\Response { - if ($file === '' || $x === 0 || $y === 0) { return new DataResponse([], Http::STATUS_BAD_REQUEST); } @@ -127,7 +126,6 @@ class PreviewController extends Controller { bool $a = false, bool $forceIcon = true, string $mode = 'fill') { - if ($fileId === -1 || $x === 0 || $y === 0) { return new DataResponse([], Http::STATUS_BAD_REQUEST); } @@ -157,10 +155,9 @@ class PreviewController extends Controller { Node $node, int $x, int $y, - bool $a = false, - bool $forceIcon = true, + bool $a, + bool $forceIcon, string $mode) : Http\Response { - if (!($node instanceof File) || (!$forceIcon && !$this->preview->isAvailable($node))) { return new DataResponse([], Http::STATUS_NOT_FOUND); } @@ -178,6 +175,5 @@ class PreviewController extends Controller { } catch (\InvalidArgumentException $e) { return new DataResponse([], Http::STATUS_BAD_REQUEST); } - } } |