X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Flibs%2Frewrite_functions.php;h=ae1854d4d2289ff2afb853884b96c80d37b3b5a7;hp=36399f1662a418a971f643f5436067f8076a9c56;hb=64d1c97381cc29f3fe639d18e8884098df580f2b;hpb=cc478ddc4e5b62cba3dfe8ac32f269c9faee245f diff --git a/inc/libs/rewrite_functions.php b/inc/libs/rewrite_functions.php index 36399f1662..ae1854d4d2 100644 --- a/inc/libs/rewrite_functions.php +++ b/inc/libs/rewrite_functions.php @@ -1,7 +1,7 @@ to replacements - $REPLACE = array( - 'search' => array("uid", "url", "page", "offset", "mid", "bid", "sub", "home"), - 'replace' => array("u" , "url", "page", "offset", "m" , "b" , "s" , "h") - ); - - if ((EXT_IS_ACTIVE("admins")) && (eregi("admin=", $test))) { - // Replace &admin= with "/aid/" - $REPLACE['search'][] = "admin"; - $REPLACE['replace'][] = "aid"; - } // END - if - - // Replace all array elements through - foreach ($REPLACE['search'] as $k => $v) { - if (eregi("$v=", $test)) { - // Replace &uid= with /u/ - $test = preg_replace("/&".$v."=/i", "/".$REPLACE['replace'][$k]."/", $test); - } // END - if - } // END - foreach + $what = $target . '$1/wht/'; + $code = preg_replace('/' . $target2 . '(.*)&what=/i', $what, $code); // Repair missed &what=??? entries - while (preg_match("/&what=(.*)\/(.*)\/(.*)/i", $test)) { - $test = preg_replace("/&what=(.*)\/(.*)\/(.*)/i", "/wht/\$1/\$2/\$3", $test); + while (preg_match("/&what=(.*)\/(.*)\/(.*)/i", $code)) { + $code = preg_replace("/&what=(.*)\/(.*)\/(.*)/i", "/wht/\$1/\$2/\$3", $code); } // END - while // Return rewritten code - return $test; + return $code; } -// + +// [EOF] ?>