X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Flibs%2Frewrite_functions.php;h=5b76d5a1b31859742baf55c5e72d3f37c8086820;hp=308b42da68ec462cf5ff66e39e2341c2dd36be69;hb=0715fa7aa8e5e70bcf1d957fb09ae655c3896c4e;hpb=185b046f093581351ebd2823c2028356f6a392be diff --git a/inc/libs/rewrite_functions.php b/inc/libs/rewrite_functions.php index 308b42da68..5b76d5a1b3 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/'; + $output = preg_replace('/' . $target2 . '(.*)&what=/i', $what, $output); // 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", $output)) { + $output = preg_replace("/&what=(.*)\/(.*)\/(.*)/i", "/wht/\$1/\$2/\$3", $output); + } // END - while // Return rewritten code - return $test; + return $output; } -// + +// [EOF] ?>