Skip to content
Snippets Groups Projects
Commit 0ed0b50c authored by Carsten  Rose's avatar Carsten Rose
Browse files

Fixes #16392. Reevaluate sanitize class for each store.

parent cf5c4083
No related branches found
No related tags found
2 merge requests!592Develop,!591Fixes #16392. Reevaluate sanitize class for each store.
Pipeline #9668 passed
...@@ -603,18 +603,20 @@ class Store { ...@@ -603,18 +603,20 @@ class Store {
// no sanitizeClass specified: take predefined (if exist) or default. // no sanitizeClass specified: take predefined (if exist) or default.
if ($sanitizeClass === '' || $sanitizeClass === null) { if ($sanitizeClass === '' || $sanitizeClass === null) {
$sanitizeDefault = SANITIZE_DEFAULT_OF_STORE[$store]; $sanitizeClassFinal = self::$sanitizeClass[$key] ?? SANITIZE_DEFAULT_OF_STORE[$store];
$sanitizeClass = isset(self::$sanitizeClass[$key]) ? self::$sanitizeClass[$key] : $sanitizeDefault; } else {
$sanitizeClassFinal = $sanitizeClass;
} }
$rawVal = isset(self::$raw[$store][$finalKey]) ? self::$raw[$store][$finalKey] : null;
if (self::$sanitizeStore[$store] && $sanitizeClass != '') { $rawVal = self::$raw[$store][$finalKey] ?? null;
if ($sanitizeClass == SANITIZE_ALLOW_PATTERN) { if (self::$sanitizeStore[$store] && $sanitizeClassFinal != '') {
if ($sanitizeClassFinal == SANITIZE_ALLOW_PATTERN) {
// We do not have any pattern at this point. For those who be affected, they already checked earlier. So set 'no check' // We do not have any pattern at this point. For those who be affected, they already checked earlier. So set 'no check'
$sanitizeClass = SANITIZE_ALLOW_ALL; $sanitizeClassFinal = SANITIZE_ALLOW_ALL;
} }
return Sanitize::sanitize($rawVal, $sanitizeClass, '', '', SANITIZE_EMPTY_STRING, '', $typeMessageViolate); return Sanitize::sanitize($rawVal, $sanitizeClassFinal, '', '', SANITIZE_EMPTY_STRING, '', $typeMessageViolate);
} else { } else {
if ($store == STORE_SIP && (substr($key, 0, $len) == SIP_PREFIX_BASE64)) { if ($store == STORE_SIP && (substr($key, 0, $len) == SIP_PREFIX_BASE64)) {
$rawVal = base64_decode($rawVal); $rawVal = base64_decode($rawVal);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment