소스 검색

Added var $link to set_url_var so we correctly can set the new uri with
& if it concerns a link or & when it concerns a header redirect.

stekkel 23 년 전
부모
커밋
36e62adf71
1개의 변경된 파일5개의 추가작업 그리고 3개의 파일을 삭제
  1. 5 3
      functions/html.php

+ 5 - 3
functions/html.php

@@ -79,7 +79,7 @@
 
 
     /* handy function to set url vars */
     /* handy function to set url vars */
     /* especially usefull when $url = $PHP_SELF */
     /* especially usefull when $url = $PHP_SELF */
-    function set_url_var($url, $var, $val=0) {
+    function set_url_var($url, $var, $val=0, $link=true) {
         $k = '';
         $k = '';
         $ret = '';
         $ret = '';
         $pat_a = array (
         $pat_a = array (
@@ -88,7 +88,7 @@
                        '/.+(\\?'.$var.')=(.*)$/AU',     /* at front and only var */
                        '/.+(\\?'.$var.')=(.*)$/AU',     /* at front and only var */
                        '/.+(\\&'.$var.')=(.*)$/AU'      /* at the end */
                        '/.+(\\&'.$var.')=(.*)$/AU'      /* at the end */
                      );
                      );
-//	preg_replace('/&/','&',$url);	     
+	preg_replace('/&/','&',$url);	     
         switch (true) {
         switch (true) {
             case (preg_match($pat_a[0],$url,$regs)):
             case (preg_match($pat_a[0],$url,$regs)):
                 $k = $regs[1];
                 $k = $regs[1];
@@ -120,7 +120,9 @@
         if ($k) {
         if ($k) {
             if ($val) {
             if ($val) {
                 $rpl = "$k=$val";
                 $rpl = "$k=$val";
-//		$rpl = preg_replace('/&/','&',$rpl);
+		if ($link) {
+		    $rpl = preg_replace('/&/','&',$rpl);
+		}
             } else {
             } else {
                 $rpl = '';
                 $rpl = '';
             }
             }