X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Flibs%2Frewrite_functions.php;h=9c36f08677617f2f937340f403a84d4982896f1e;hb=62d8f6d89c35bebe15b8f716a5629f14d95f3078;hp=13f9a3b48691528698b81342cea670b074b08462;hpb=dbe56bb043ba16ca1ec1e9efa9effdc1f0612261;p=mailer.git diff --git a/inc/libs/rewrite_functions.php b/inc/libs/rewrite_functions.php index 13f9a3b486..9c36f08677 100644 --- a/inc/libs/rewrite_functions.php +++ b/inc/libs/rewrite_functions.php @@ -1,7 +1,7 @@ to replacements - $REPLACE = array( - 'search' => array("u_id", "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"; - } - - // Replace all array elements through - foreach ($REPLACE['search'] as $k => $v) - { - if (eregi("$v=", $test)) - { - // Replace &u_id= with /u/ - $test = preg_replace("/&".$v."=/i", "/".$REPLACE['replace'][$k]."/", $test); - } - } + $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] ?>