diff --git a/includes/functions.mod_rewrite.php b/includes/functions.mod_rewrite.php index 28bc291..658c81e 100644 --- a/includes/functions.mod_rewrite.php +++ b/includes/functions.mod_rewrite.php @@ -479,11 +479,9 @@ function mr_buildGeneratedCode($code) { $sseStarttime = getmicrotime(); // anchor hack - $code = preg_replace_callback( - "/]*)href\s*=\s*[\"|\'][\/]#(.?|.+?)[\"|\']([^>]*)>/i", - create_function('$matches', 'return ModRewrite::rewriteHtmlAnchor($matches);'), - $code - ); + $code = preg_replace_callback("/]*)href\s*=\s*[\"|\'][\/]#(.?|.+?)[\"|\']([^>]*)>/i", function($match) { + return ModRewrite::rewriteHtmlAnchor($match); + }, $code); // remove tinymce single quote entities: $code = str_replace("'", "'", $code); @@ -492,13 +490,6 @@ function mr_buildGeneratedCode($code) { $sBaseUri = $cfgClient[$client]['path']['htmlpath']; $sBaseUri = CEC_Hook::execute("Contenido.Frontend.BaseHrefGeneration", $sBaseUri); - // IE hack with wrong base href interpretation - $code = preg_replace_callback( - "/([\"|\'|=])upload\/(.?|.+?)([\"|\'|>])/i", - create_function('$matches', 'return stripslashes($matches[1]' . $sBaseUri . ' . "upload/" . $matches[2] . $matches[3]);'), - $code - ); - // define some preparations to replace /front_content.php & ./front_content.php // against front_content.php, because urls should start with front_content.php $aPattern = array( @@ -527,22 +518,18 @@ function mr_buildGeneratedCode($code) { // ok let it beginn, build the clean urls $code = str_replace('"front_content.php"', '"' . mr_buildNewUrl('front_content.php') . '"', $code); $code = str_replace("'front_content.php'", "'" . mr_buildNewUrl('front_content.php') . "'", $code); - $code = preg_replace_callback( - "/([\"|\'|=])front_content\.php(.?|.+?)([\"|\'|>])/i", - create_function('$aMatches', 'return $aMatches[1] . mr_buildNewUrl("front_content.php" . $aMatches[2]) . $aMatches[3];'), - $code - ); + $code = preg_replace_callback("/([\"|\'|=])front_content\.php(.?|.+?)([\"|\'|>])/i", function($match) { + return $match[1] . mr_buildNewUrl('front_content.php' . $match[2]) . $match[3]; + }, $code); ModRewriteDebugger::add($code, 'mr_buildGeneratedCode() out'); $sseEndtime = getmicrotime(); } else { // anchor hack for non modrewrite websites - $code = preg_replace_callback( - "/]*)href\s*=\s*[\"|\'][\/]#(.?|.+?)[\"|\']([^>]*)>/i", - create_function('$matches', 'return ModRewrite::contenidoHtmlAnchor($matches, $GLOBALS["is_XHTML"]);'), - $code - ); + $code = preg_replace_callback("/]*)href\s*=\s*[\"|\'][\/]#(.?|.+?)[\"|\']([^>]*)>/i", function($match) { + return ModRewrite::contenidoHtmlAnchor($match, $GLOBALS['is_XHTML']); + }, $code); } ModRewriteDebugger::add(($sseEndtime - $sseStarttime), 'mr_buildGeneratedCode() total spend time'); @@ -623,7 +610,7 @@ function mr_loadConfiguration($clientId, $forceReload = false) { function mr_getConfigurationFilePath($clientId) { $clientConfig = cRegistry::getClientConfig((int) $clientId); $fePath = $clientConfig['path']['frontend']; - return $fePath . 'data/config/' . CON_ENVIRONMENT . '/config.mod_rewrite.php'; + return $fePath . 'data/config/' . CL_ENVIRONMENT . '/config.mod_rewrite.php'; } /** @@ -655,7 +642,7 @@ function mr_getConfiguration($clientId) { if (!is_file($file) || !is_readable($file)) { return null; } - + if ($content = file_get_contents($file)) { $content = unserialize($content); if (array_key_exists("mod_rewrite", $content)) {