From b555fb0c1aa559e62f8b0287321fe48c047807d2 Mon Sep 17 00:00:00 2001 From: Alexandra Nantel Date: Wed, 31 May 2017 16:51:47 -0400 Subject: [PATCH 1/4] Update PHP Compatibility for Symphony 4.x --- extension.meta.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/extension.meta.xml b/extension.meta.xml index f9e7dfe..d4c6385 100644 --- a/extension.meta.xml +++ b/extension.meta.xml @@ -14,6 +14,9 @@ + + - PHP7 Compatibility + - Replaced deprecated preg_replace /e in extension.driver.php - Added German translation @@ -46,4 +49,4 @@ - \ No newline at end of file + From fa307ef4536308f8dae41ca10526723891467025 Mon Sep 17 00:00:00 2001 From: Alexandra Nantel Date: Thu, 24 Aug 2017 16:11:15 -0400 Subject: [PATCH 2/4] SQL and PHP cases PHP true,false,null in lowercase SQL keywords uppercase --- extension.driver.php | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/extension.driver.php b/extension.driver.php index 5403717..708dce6 100644 --- a/extension.driver.php +++ b/extension.driver.php @@ -57,29 +57,29 @@ public function appendEventFilter(array $context) { public function eventPreSaveFilter(array $context) { if(!in_array('xss-fail', $context['event']->eParamFILTERS) && !in_array('validate-xsrf', $context['event']->eParamFILTERS)) return; - $contains_xss = FALSE; + $contains_xss = false; // Loop over the fields to check for XSS, this loop will // break as soon as XSS is detected foreach($context['fields'] as $field => $value) { if(is_array($value)) { - if(self::detectXSSInArray($value) === FALSE) continue; + if(self::detectXSSInArray($value) === false) continue; - $contains_xss = TRUE; + $contains_xss = true; break; } else { - if(self::detectXSS($value) === FALSE) continue; + if(self::detectXSS($value) === false) continue; - $contains_xss = TRUE; + $contains_xss = true; break; } } // Detect XSS filter - if(in_array('xss-fail', $context['event']->eParamFILTERS) && $contains_xss === TRUE) { + if(in_array('xss-fail', $context['event']->eParamFILTERS) && $contains_xss === true) { $context['messages'][] = array( - 'xss', FALSE, __("Possible XSS attack detected in submitted data") + 'xss', false, __("Possible XSS attack detected in submitted data") ); } @@ -87,7 +87,7 @@ public function eventPreSaveFilter(array $context) { if(in_array('validate-xsrf', $context['event']->eParamFILTERS)) { if(Symphony::Engine()->isXSRFEnabled() && is_session_empty() === false && XSRF::validateRequest(true) === false) { $context['messages'][] = array( - 'xsrf', FALSE, __("Request was rejected for having an invalid cross-site request forgery token.") + 'xsrf', false, __("Request was rejected for having an invalid cross-site request forgery token.") ); } } @@ -119,11 +119,11 @@ public static function detectXSSInArray(array $array) { return self::detectXSSInArray($value); } else { - if(self::detectXSS($value) === TRUE) return TRUE; + if(self::detectXSS($value) === true) return true; } } - return FALSE; + return false; } /** @@ -136,7 +136,7 @@ public static function detectXSSInArray(array $array) { * True if the given `$string` contains XSS, false otherwise. */ public static function detectXSS($string) { - $contains_xss = FALSE; + $contains_xss = false; // Skip any null or non string values if(is_null($string) || !is_string($string)) { @@ -182,12 +182,12 @@ public static function detectXSS($string) { foreach($patterns as $pattern) { // Test both the original string and clean string if(preg_match($pattern, $string) || preg_match($pattern, $orig)){ - $contains_xss = TRUE; + $contains_xss = true; } - if ($contains_xss === TRUE) return TRUE; + if ($contains_xss === true) return true; } - return FALSE; + return false; } } From 8f9f05a442627564a6e97ec638bbfcf3722af275 Mon Sep 17 00:00:00 2001 From: Alexandra Nantel Date: Fri, 25 Aug 2017 11:29:02 -0400 Subject: [PATCH 3/4] Relase infos .. Again --- extension.meta.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extension.meta.xml b/extension.meta.xml index d4c6385..1de25dc 100644 --- a/extension.meta.xml +++ b/extension.meta.xml @@ -14,7 +14,8 @@ - + + - Update for Symphony 4.x - PHP7 Compatibility From 4cae482dd17d4fa9b3a3af0938b9817e2bee149a Mon Sep 17 00:00:00 2001 From: Alexandra Nantel Date: Tue, 12 Jun 2018 11:52:55 -0400 Subject: [PATCH 4/4] Fix registerPHPFunction --- extension.driver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extension.driver.php b/extension.driver.php index 708dce6..028d789 100644 --- a/extension.driver.php +++ b/extension.driver.php @@ -94,7 +94,7 @@ public function eventPreSaveFilter(array $context) { } public static function FrontendParamsResolve(array &$context) { - Frontend::Page()->registerPHPFunction(array( + Frontend::Page()->Proc->registerPHPFunction(array( 'htmlContextCleaner', 'scriptContextCleaner', 'attributeContextCleaner',