X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Flibs%2Frewrite_functions.php;h=9c36f08677617f2f937340f403a84d4982896f1e;hb=62d8f6d89c35bebe15b8f716a5629f14d95f3078;hp=6a23cf91bfdce1e71335fda64b22300c2e9540e0;hpb=5c299c999d8b5106dc007dea5317bbb9209e829f;p=mailer.git diff --git a/inc/libs/rewrite_functions.php b/inc/libs/rewrite_functions.php index 6a23cf91bf..9c36f08677 100644 --- a/inc/libs/rewrite_functions.php +++ b/inc/libs/rewrite_functions.php @@ -14,8 +14,6 @@ * $Date:: $ * * $Tag:: 0.2.1-FINAL $ * * $Author:: $ * - * Needs to be in all Files and every File needs "svn propset * - * svn:keywords Date Revision" (autoprobset!) at least!!!!!! * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * * Copyright (c) 2009, 2010 by Mailer Developer Team * @@ -43,30 +41,25 @@ if (!defined('__SECURITY')) { } // Rewrite links in HTML for better SEO (ugly part of mx!) -function rewriteLinksInCode ($HTML) { +function rewriteLinksInCode ($code) { // Skip rewriting for configured modules - if (isInStringIgnoreCase(getModule(), getConfig('rewrite_skip')) !== false) return $HTML; + if (isInStringIgnoreCase(getModule(), getConfig('rewrite_skip')) !== false) return $code; // Generate target URL - $target = '{?URL?}/cms/'; - $output = $HTML; - - // Final eval() - $eval = '$output = "' . compileCode(escapeQuotes($output)) . '";'; - eval($eval); + $target = getUrl() . '/cms/'; // Convert modules.php?module=... - foreach (array(getConfig('URL'), '{?URL?}') as $rewrite) { - $output = str_replace($rewrite . '/modules.php?module=', $target, $output); + foreach (array(getUrl(), '{?URL?}') as $rewrite) { + $code = str_replace($rewrite . '/modules.php?module=', $target, $code); } // END - foreach // Do we have an URL linked to mxchange.org? - if (isInStringIgnoreCase(getConfig('SERVER_URL'), $output)) { + if (isInStringIgnoreCase(getServerUrl(), $code)) { // Convert URLs from my server - $output = str_replace('{?URL?}/modules.php?module=', getConfig('SERVER_URL') . '/cms/', $output); + $code = str_replace('{?URL?}/modules.php?module=', getServerUrl() . '/cms/', $code); // Convert URLs from my server - $output = str_replace(getConfig('URL') . '/modules.php?module=', getConfig('SERVER_URL') . '/cms/', $output); + $code = str_replace(getUrl() . '/modules.php?module=', getServerUrl() . '/cms/', $code); } // END - if // Strip slashes as above for the main URL @@ -76,19 +69,19 @@ function rewriteLinksInCode ($HTML) { $action = $target . '$1/act/'; // Convert &|&action=... - $output = preg_replace('/' . $target2 . '(.*)&action=/i', $action, $output); + $code = preg_replace('/' . $target2 . '(.*)&action=/i', $action, $code); // "The same procedure as last variable"... now for &what= $what = $target . '$1/wht/'; - $output = preg_replace('/' . $target2 . '(.*)&what=/i', $what, $output); + $code = preg_replace('/' . $target2 . '(.*)&what=/i', $what, $code); // Repair missed &what=??? entries - while (preg_match("/&what=(.*)\/(.*)\/(.*)/i", $output)) { - $output = preg_replace("/&what=(.*)\/(.*)\/(.*)/i", "/wht/\$1/\$2/\$3", $output); + while (preg_match("/&what=(.*)\/(.*)\/(.*)/i", $code)) { + $code = preg_replace("/&what=(.*)\/(.*)\/(.*)/i", "/wht/\$1/\$2/\$3", $code); } // END - while // Return rewritten code - return $output; + return $code; } // [EOF]