From 5960757123f2ac46f76966307eb7abe32fb4ee1c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 18 Nov 2009 11:23:51 +0000 Subject: [PATCH] Fix for non-working rewrite-links (still this is lame code) --- inc/libs/rewrite_functions.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/inc/libs/rewrite_functions.php b/inc/libs/rewrite_functions.php index 3c3bbbf8d4..867346178a 100644 --- a/inc/libs/rewrite_functions.php +++ b/inc/libs/rewrite_functions.php @@ -48,12 +48,16 @@ function rewriteLinksInCode ($HTML) { // Generate target URL $target = '{?URL?}/cms/'; + $output = $HTML; - // Convert modules.php?module=... - $output = str_replace(getConfig('URL') . '/modules.php?module=', $target, $HTML); + // Final eval() + $eval = '$output = "' . compileCode(escapeQuotes($output)) . '";'; + eval($eval); // Convert modules.php?module=... - $output = str_replace('{?URL?}/modules.php?module=', $target, $output); + foreach (array(getConfig('URL'), '{?URL?}') as $rewrite) { + $output = str_replace($rewrite . '/modules.php?module=', $target, $output); + } // END - foreach // Do we have an URL linked to mxchange.org? if (eregi(getConfig('SERVER_URL'), $output)) { @@ -74,7 +78,7 @@ function rewriteLinksInCode ($HTML) { $output = preg_replace('/' . $target2 . '(.*)&action=/i', $action, $output); // "The same procedure as last variable"... now for &what= - $what = $target.'$1/wht/'; + $what = $target . '$1/wht/'; $output = preg_replace('/' . $target2 . '(.*)&what=/i', $what, $output); // Repair missed &what=??? entries -- 2.39.2