Browse Source

Check if SVG path is valid

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
pull/28726/head
Lukas Reschke 5 years ago
committed by GitHub
parent
commit
dd054b2ee8
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      core/Controller/SvgController.php

5
core/Controller/SvgController.php

@ -31,6 +31,7 @@ declare(strict_types=1);
*/
namespace OC\Core\Controller;
use OC\Files\Filesystem;
use OC\Template\IconsCacher;
use OCP\App\AppPathNotFoundException;
use OCP\App\IAppManager;
@ -117,6 +118,10 @@ class SvgController extends Controller {
* @return DataDisplayResponse|NotFoundResponse
*/
private function getSvg(string $path, string $color, string $fileName) {
if(!Filesystem::isValidPath($path)) {
return new NotFoundResponse();
}
if (!file_exists($path)) {
return new NotFoundResponse();
}

Loading…
Cancel
Save