Sanitize Page Media

This commit is contained in:
Andy Miller
2019-09-03 12:18:20 -06:00
parent 574bc9e155
commit d41a8be8fa
2 changed files with 7 additions and 2 deletions

View File

@@ -2,7 +2,8 @@
## mm/dd/2019
1. [](#new)
* Add ability to Sanitize SVGs on upload
* Add ability to Sanitize SVGs on file upload
* Add ability to Sanitize SVGs in Page media
# v1.10.0-beta.7
## 08/30/2019

View File

@@ -2087,7 +2087,6 @@ class AdminController extends AdminBaseController
return false;
}
$media = $this->getMedia();
if (!$media) {
$this->admin->json_response = [
@@ -2105,6 +2104,11 @@ class AdminController extends AdminBaseController
$path = $locator->findResource($path, true, true);
}
// Special Sanitization for SVG
if (Utils::contains($extension, 'svg', false)) {
Security::sanitizeSVG($_FILES['file']['tmp_name']);
}
// Upload it
if (!move_uploaded_file($_FILES['file']['tmp_name'], sprintf('%s/%s', $path, $filename))) {
$this->admin->json_response = [