Skip to content

Commit

Permalink
Fix bug in backwards compatibility for ZENCACHE_ALLOWED
Browse files Browse the repository at this point in the history
  • Loading branch information
raamdev committed Feb 24, 2016
1 parent f8f27df commit ff1e1ec
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/includes/classes/AdvCacheBackCompat.php
Expand Up @@ -51,17 +51,17 @@ public static function zenCacheConstants()
if (stripos($_constant, 'ZENCACHE_') !== 0) {
continue; // Nothing to do here.
}
if (!($_constant_sub_name = substr($_constant, 12))) {
if (!($_constant_sub_name = substr($_constant, 9))) {
continue; // Nothing to do here.
}
if (!defined(GLOBAL_NS.'_'.$_constant_sub_name)) {
define(GLOBAL_NS.'_'.$_constant_sub_name, $_value);
if (!defined(strtoupper(GLOBAL_NS).'_'.$_constant_sub_name)) {
define(strtoupper(GLOBAL_NS).'_'.$_constant_sub_name, $_value);
}
}
unset($_constant, $_value); // Housekeeping.

if (isset($_SERVER['ZENCACHE_ALLOWED']) && !isset($_SERVER[GLOBAL_NS.'_ALLOWED'])) {
$_SERVER[GLOBAL_NS.'_ALLOWED'] = $_SERVER['ZENCACHE_ALLOWED'];
if (isset($_SERVER['ZENCACHE_ALLOWED']) && !isset($_SERVER[strtoupper(GLOBAL_NS).'_ALLOWED'])) {
$_SERVER[strtoupper(GLOBAL_NS).'_ALLOWED'] = $_SERVER['ZENCACHE_ALLOWED'];
}
}
}

0 comments on commit ff1e1ec

Please sign in to comment.