1
0
Fork 0

Bugfix PHP 7.2+

Dieser Commit ist enthalten in:
o.pinke 2019-12-28 17:54:31 +01:00
Ursprung d098573903
Commit eb6290c403
1 geänderte Dateien mit 11 neuen und 24 gelöschten Zeilen

Datei anzeigen

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