From 7d14f333e1ca0847509579c575a7d7335a7775e6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Tue, 10 Mar 2009 20:59:46 +0000 Subject: [PATCH] Next try to fix it (simple quotes) --- inc/libs/rewrite_functions.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/inc/libs/rewrite_functions.php b/inc/libs/rewrite_functions.php index 121f0c4579..fb52234bc9 100644 --- a/inc/libs/rewrite_functions.php +++ b/inc/libs/rewrite_functions.php @@ -42,40 +42,40 @@ if (!defined('__SECURITY')) { require($INC); } -// +// Rewrite links in HTML for better SEO (ugly part of mx!) function REWRITE_LINKS ($HTML) { - // Skip rewriting for the admin area (which search engine may enter here???) - if (ereg($GLOBALS['module'], getConfig('rewrite_skip'))) return $HTML; + // Skip rewriting for configured modules + if (eregi($GLOBALS['module'], getConfig('rewrite_skip')) !== false) return $HTML; // Strip slashes with double-backslashes for the preg_replace() function - $URL = str_replace("/", "\\/", constant('URL')); + $URL = str_replace('/', '\/', constant('URL')); // Generate target URL $target = constant('URL')."/cms/"; // Convert modules.php?module=... - $output = preg_replace("/".$URL."\\/modules.php\\?module=/i", $target, $HTML); + $output = preg_replace('/' . $URL . '\/modules.php\?module=/i', $target, $HTML); if (eregi(constant('SERVER_URL'), $output)) { // Strip slashes with double-backslashes for the preg_replace() function - $URL = str_replace("/", "\\/", constant('SERVER_URL')); + $URL = str_replace('/', '\/', constant('SERVER_URL')); // Convert URLs from my server - $output = preg_replace("/".$URL."\\/modules.php\\?module=/i", constant('SERVER_URL')."/cms/", $output); + $output = preg_replace('/' . $URL . '\/modules.php\?module=/i', constant('SERVER_URL')."/cms/", $output); } // END - if // Strip slashes as above for the main URL - $target2 = str_replace("/", "\\/", $target); + $target2 = str_replace('/', '\/', $target); // Action variable $act = $target."\$1/act/"; // Convert &|&action=... - $output = preg_replace("/".$target2."(.*)&action=/i", $act, $output); + $output = preg_replace('/'.$target2."(.*)&action=/i", $act, $output); // "The same procedure as last variable"... now for &what= $wht = $target."\$1/wht/"; - $output = preg_replace("/".$target2."(.*)&what=/i", $wht, $output); + $output = preg_replace('/'.$target2."(.*)&what=/i", $wht, $output); // Repair missed &what=??? entries while (preg_match("/&what=(.*)\/(.*)\/(.*)/i", $output)) { -- 2.30.2