summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2006-01-21 20:27:47 +0100
committerAndreas Gohr <andi@splitbrain.org>2006-01-21 20:27:47 +0100
commitb6c6979fa2bc2a54befe6a451579ce8ff5515445 (patch)
tree5db8c38749c2bc5d49d91cfbe2cf1072ae470d23 /inc
parent474767f47cac6e7fe6c19f5838f5b1e7ded1f9ae (diff)
downloadrpg-b6c6979fa2bc2a54befe6a451579ce8ff5515445.tar.gz
rpg-b6c6979fa2bc2a54befe6a451579ce8ff5515445.tar.bz2
urlencode -> rawurlencode (related to #685)
This changes nearly all occurences of urlencode to rawurlencode. The latter encodes spaces as %20 while the former uses a + sign. For the use in browser URLs %20 is the correct form. darcs-hash:20060121192747-7ad00-6563b77368a41f071609495c6a145982938a8301.gz
Diffstat (limited to 'inc')
-rw-r--r--inc/common.php8
-rw-r--r--inc/parser/xhtml.php8
-rw-r--r--inc/template.php6
3 files changed, 11 insertions, 11 deletions
diff --git a/inc/common.php b/inc/common.php
index 8ad55efff..c943ffa3c 100644
--- a/inc/common.php
+++ b/inc/common.php
@@ -101,7 +101,7 @@ function buildURLparams($params){
if($amp) $url .= '&amp;';
$url .= $key.'=';
- $url .= urlencode($val);
+ $url .= rawurlencode($val);
$amp = true;
}
return $url;
@@ -232,7 +232,7 @@ function idfilter($id,$ue=true){
$id = strtr($id,':',';');
}
if($ue){
- $id = urlencode($id);
+ $id = rawurlencode($id);
$id = str_replace('%3A',':',$id); //keep as colon
$id = str_replace('%2F','/',$id); //keep as slash
}
@@ -296,9 +296,9 @@ function ml($id='',$more='',$direct=true){
$xlink .= 'lib/exe/fetch.php';
if($more){
$xlink .= '?'.$more;
- $xlink .= '&amp;media='.urlencode($id);
+ $xlink .= '&amp;media='.rawurlencode($id);
}else{
- $xlink .= '?media='.urlencode($id);
+ $xlink .= '?media='.rawurlencode($id);
}
return $xlink;
}
diff --git a/inc/parser/xhtml.php b/inc/parser/xhtml.php
index d03939542..9fd31f3b2 100644
--- a/inc/parser/xhtml.php
+++ b/inc/parser/xhtml.php
@@ -510,7 +510,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
//add search string
if($search){
($conf['userewrite']) ? $link['url'].='?s=' : $link['url'].='&amp;s=';
- $link['url'] .= urlencode($search);
+ $link['url'] .= rawurlencode($search);
}
//keep hash
@@ -594,7 +594,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
//replace placeholder
if(preg_match('#\{(URL|NAME|SCHEME|HOST|PORT|PATH|QUERY)\}#',$url)){
//use placeholders
- $url = str_replace('{URL}',urlencode($wikiUri),$url);
+ $url = str_replace('{URL}',rawurlencode($wikiUri),$url);
$url = str_replace('{NAME}',$wikiUri,$url);
$parsed = parse_url($wikiUri);
if(!$parsed['port']) $parsed['port'] = 80;
@@ -606,9 +606,9 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
$link['url'] = $url;
}else{
//default
- $link['url'] = $url.urlencode($wikiUri);
+ $link['url'] = $url.rawurlencode($wikiUri);
}
- if($hash) $link['url'] .= '#'.urlencode($hash);
+ if($hash) $link['url'] .= '#'.rawurlencode($hash);
$link['title'] = htmlspecialchars($link['url']);
diff --git a/inc/template.php b/inc/template.php
index 315373e21..7fc824bd5 100644
--- a/inc/template.php
+++ b/inc/template.php
@@ -688,7 +688,7 @@ function tpl_mediafilelist(){
$ask = $lang['del_confirm'].'\\n';
$ask .= $item['id'];
- $del = '<a href="'.DOKU_BASE.'lib/exe/media.php?delete='.urlencode($item['id']).'" '.
+ $del = '<a href="'.DOKU_BASE.'lib/exe/media.php?delete='.rawurlencode($item['id']).'" '.
'onclick="return confirm(\''.$ask.'\')" onkeypress="return confirm(\''.$ask.'\')">'.
'<img src="'.DOKU_BASE.'lib/images/del.png" alt="'.$lang['btn_delete'].'" '.
'title="'.$lang['btn_delete'].'" /></a>';
@@ -739,7 +739,7 @@ function tpl_mediafilelist(){
//add edit button
if($AUTH >= AUTH_UPLOAD && $item['meta']->getField('File.Mime') == 'image/jpeg'){
- print '<a href="'.DOKU_BASE.'lib/exe/media.php?edit='.urlencode($item['id']).'">';
+ print '<a href="'.DOKU_BASE.'lib/exe/media.php?edit='.rawurlencode($item['id']).'">';
print '<img src="'.DOKU_BASE.'lib/images/edit.gif" alt="'.$lang['metaedit'].'" title="'.$lang['metaedit'].'" />';
print '</a>';
}
@@ -927,7 +927,7 @@ function tpl_indexerWebBug(){
if(isHiddenPage($ID)) return; //no need to index hidden pages
$p = array();
- $p['src'] = DOKU_BASE.'lib/exe/indexer.php?id='.urlencode($ID).
+ $p['src'] = DOKU_BASE.'lib/exe/indexer.php?id='.rawurlencode($ID).
'&'.time();
$p['width'] = 1;
$p['height'] = 1;