Commit 0a81a4cb authored by Carsten  Rose's avatar Carsten Rose
Browse files

Store.php: getVar() for STORE_LDAP is now case insensitive for keynames.

parent 65f5fe1f
......@@ -445,19 +445,24 @@ class Store {
}
while ($useStores !== false) {
$store = substr($useStores, 0, 1); // next store
$finalKey = $key;
if ($store == STORE_LDAP) {
$finalKey = strtolower($key); // in STORE_LDAP all keys are lowercase
}
$foundInStore = $store;
$useStores = substr($useStores, 1); // shift left remaining stores
if (!isset(self::$raw[$store][$key])) {
if (!isset(self::$raw[$store][$finalKey])) {
switch ($store) {
case STORE_ZERO:
return 0;
case STORE_EMPTY:
return '';
case STORE_VAR:
if ($key === VAR_RANDOM) {
if ($finalKey === VAR_RANDOM) {
return Support::randomAlphaNum(RANDOM_LENGTH);
} else {
continue 2; // no value provided, continue with while loop
......@@ -469,7 +474,7 @@ class Store {
}
}
$rawVal = isset(self::$raw[$store][$key]) ? self::$raw[$store][$key] : null;
$rawVal = isset(self::$raw[$store][$finalKey]) ? self::$raw[$store][$finalKey] : null;
if (self::$sanitizeStore[$store] && $sanitizeClass != '') {
if ($sanitizeClass == SANITIZE_ALLOW_PATTERN || $sanitizeClass == SANITIZE_ALLOW_MIN_MAX || $sanitizeClass == SANITIZE_ALLOW_MIN_MAX_DATE) {
// We do not have any pattern or min|max values at this point. For those who be affected, they already checked earlier. So set 'no check'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment