Skip to content
Snippets Groups Projects
Commit b6c6979f authored by Andreas Gohr's avatar Andreas Gohr
Browse files

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
parent 474767f4
No related branches found
No related tags found
No related merge requests found
......@@ -101,7 +101,7 @@ function buildURLparams($params){
if($amp) $url .= '&';
$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 .= '&media='.urlencode($id);
$xlink .= '&media='.rawurlencode($id);
}else{
$xlink .= '?media='.urlencode($id);
$xlink .= '?media='.rawurlencode($id);
}
return $xlink;
}
......
......@@ -510,7 +510,7 @@ class Doku_Renderer_xhtml extends Doku_Renderer {
//add search string
if($search){
($conf['userewrite']) ? $link['url'].='?s=' : $link['url'].='&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']);
......
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment