From b174aeae6cff69a7877494b3731c849f09b3a24a Mon Sep 17 00:00:00 2001 From: chris Date: Tue, 31 Jan 2006 00:28:18 +0100 Subject: update wl,ml,buildURLParams with optional separator string, update config plugin redirect with new wl(), add meta & lang details for $conf['resendpasswd'] darcs-hash:20060130232818-9b6ab-2f395bc25c536b06bb5ade616a8252060ecb5278.gz --- inc/common.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'inc/common.php') diff --git a/inc/common.php b/inc/common.php index dbd2ed451..7e0ecf625 100644 --- a/inc/common.php +++ b/inc/common.php @@ -94,11 +94,11 @@ function pageinfo(){ * * @author Andreas Gohr */ -function buildURLparams($params){ +function buildURLparams($params, $sep='&'){ $url = ''; $amp = false; foreach($params as $key => $val){ - if($amp) $url .= '&'; + if($amp) $url .= $sep; $url .= $key.'='; $url .= rawurlencode($val); @@ -247,12 +247,12 @@ function idfilter($id,$ue=true){ * * @author Andreas Gohr */ -function wl($id='',$more='',$abs=false){ +function wl($id='',$more='',$abs=false,$sep='&'){ global $conf; if(is_array($more)){ - $more = buildURLparams($more); + $more = buildURLparams($more,$sep); }else{ - $more = str_replace(',','&',$more); + $more = str_replace(',',$sep,$more); } $id = idfilter($id); @@ -270,7 +270,7 @@ function wl($id='',$more='',$abs=false){ if($more) $xlink .= '?'.$more; }else{ $xlink .= DOKU_SCRIPT.'?id='.$id; - if($more) $xlink .= '&'.$more; + if($more) $xlink .= $sep.$more; } return $xlink; @@ -281,12 +281,12 @@ function wl($id='',$more='',$abs=false){ * * Will return a link to the detail page if $direct is false */ -function ml($id='',$more='',$direct=true){ +function ml($id='',$more='',$direct=true,$sep='&'){ global $conf; if(is_array($more)){ - $more = buildURLparams($more); + $more = buildURLparams($more,$sep); }else{ - $more = str_replace(',','&',$more); + $more = str_replace(',',$sep,$more); } $xlink = DOKU_BASE; @@ -296,7 +296,7 @@ function ml($id='',$more='',$direct=true){ $xlink .= 'lib/exe/fetch.php'; if($more){ $xlink .= '?'.$more; - $xlink .= '&media='.rawurlencode($id); + $xlink .= $sep.'media='.rawurlencode($id); }else{ $xlink .= '?media='.rawurlencode($id); } @@ -327,7 +327,7 @@ function ml($id='',$more='',$direct=true){ }else{ if($more){ $xlink .= $script.'?'.$more; - $xlink .= '&media='.$id; + $xlink .= $sep.'media='.$id; }else{ $xlink .= $script.'?media='.$id; } -- cgit v1.2.3