]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/rewrite_functions.php
fooRequestElementBar() functions renamed, adding of request parameters added:
[mailer.git] / inc / libs / rewrite_functions.php
index 83d131c421de7dfa1d6bd70f0bf3c44dd159aa08..867346178a9bab90cf695cfc95a50ca52c3f00c4 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /************************************************************************
- * MXChange v0.2.1                                    Start: 10/24/2004 *
- * ===============                              Last change: 11/14/2004 *
+ * Mailer v0.2.1-FINAL                                Start: 10/24/2004 *
+ * ===================                          Last change: 11/14/2004 *
  *                                                                      *
  * -------------------------------------------------------------------- *
  * File              : 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 . '(.*)&amp;action=/i', $action, $output);
 
        // "The same procedure as last variable"... now for &amp;what=
-       $what = $target.'$1/wht/';
+       $what = $target . '$1/wht/';
        $output = preg_replace('/' . $target2 . '(.*)&amp;what=/i', $what, $output);
 
        // Repair missed &amp;what=??? entries