mirror of
https://github.com/nextcloud/server.git
synced 2026-06-08 16:26:59 -04:00
Check if SVG path is valid
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
This commit is contained in:
parent
94cdc6b261
commit
39b15269c9
1 changed files with 5 additions and 0 deletions
|
|
@ -32,6 +32,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;
|
||||
|
|
@ -118,6 +119,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…
Reference in a new issue