// 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)) {
$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