From a5187f8590f5c46b769635d17c5e28f688118b5a Mon Sep 17 00:00:00 2001 From: Cameron Date: Fri, 27 Jul 2018 12:41:14 -0700 Subject: [PATCH] Issue #1958 Improved SVG support. --- e107_handlers/e_parse_class.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/e107_handlers/e_parse_class.php b/e107_handlers/e_parse_class.php index 3be37f9b5..04e23a32e 100644 --- a/e107_handlers/e_parse_class.php +++ b/e107_handlers/e_parse_class.php @@ -2745,6 +2745,13 @@ class e_parse extends e_parser { $this->staticCount++; // increment counter. + $ext = pathinfo($url, PATHINFO_EXTENSION); + + if($ext === 'svg') + { + return $this->replaceConstants($url, 'abs'); + } + if(strpos($url,"{e_") === 0) // Fix for broken links that use {e_MEDIA} etc. { //$url = $this->replaceConstants($url,'abs'); @@ -2766,6 +2773,8 @@ class e_parse extends e_parser } + + if(strstr($url,e_MEDIA) || strstr($url,e_SYSTEM)) // prevent disclosure of 'hashed' path. { @@ -4375,7 +4384,7 @@ class e_parser $path = null; $file = trim($file); $ext = pathinfo($file, PATHINFO_EXTENSION); - $accepted = array('jpg','gif','png','jpeg'); + $accepted = array('jpg','gif','png','jpeg', 'svg'); if(!in_array($ext,$accepted))