Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Check if SVG path is valid
Signed-off-by: Lukas Reschke <[email protected]>
  • Loading branch information
LukasReschke authored and backportbot[bot] committed Sep 7, 2021
commit 3061f8a5299e872a88e4f35e9366cee84045d354
5 changes: 5 additions & 0 deletions core/Controller/SvgController.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
*/
namespace OC\Core\Controller;

use OC\Files\Filesystem;
use OC\Template\IconsCacher;
use OCP\App\AppPathNotFoundException;
use OCP\App\IAppManager;
Expand Down Expand Up @@ -117,6 +118,10 @@ public function getSvgFromApp(string $app, string $fileName, string $color = 'ff
* @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();
}
Expand Down