r41486 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41485‎ | r41486 | r41487 >
Date:15:29, 1 October 2008
Author:mkroetzsch
Status:old
Tags:
Comment:
Escape ! in URIs
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/export/SMW_Exporter.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/export/SMW_Exporter.php
@@ -9,7 +9,7 @@
1010 * a format for easy serialisation in OWL or RDF.
1111 *
1212 * @author Markus Krötzsch
13 - * @note AUTOLOADED
 13+ * @ingroup SMW
1414 */
1515 class SMWExporter {
1616
@@ -260,8 +260,8 @@
261261 static public function encodeURI($uri) {
262262 $uri = str_replace( '-', '-2D', $uri);
263263 //$uri = str_replace( '_', '-5F', $uri); //not necessary
264 - $uri = str_replace( array(':', '"','#','&',"'",'+','%'),
265 - array('-3A', '-22','-23','-26','-27','-2B','-'),
 264+ $uri = str_replace( array(':','"','#','&',"'",'+','!','%'),
 265+ array('-3A', '-22','-23','-26','-27','-2B','-21','-'),
266266 $uri);
267267 return $uri;
268268 }
@@ -271,8 +271,8 @@
272272 * allows services that receive a URI to extract e.g. the according wiki page.
273273 */
274274 static public function decodeURI($uri) {
275 - $uri = str_replace( array('-22','-23','-26','-27','-2B','-'),
276 - array('"','#','&',"'",'+','%'),
 275+ $uri = str_replace( array('-22','-23','-26','-27','-2B','-21','-'),
 276+ array('"','#','&',"'",'+','!','%'),
277277 $uri);
278278 $uri = str_replace( '-2D', '-', $uri);
279279 return $uri;

Status & tagging log