http://www.mediawiki.org/wiki/Special:Code/MediaWiki/65407

Revision: 65407
Author:   kipcool
Date:     2010-04-21 18:22:28 +0000 (Wed, 21 Apr 2010)

Log Message:
-----------
Using wgArticlePath instead of wgScript. Also using urlencode to improve 
handling of special characters.

Modified Paths:
--------------
    trunk/extensions/Wikidata/OmegaWiki/type.php

Modified: trunk/extensions/Wikidata/OmegaWiki/type.php
===================================================================
--- trunk/extensions/Wikidata/OmegaWiki/type.php        2010-04-21 18:04:08 UTC 
(rev 65406)
+++ trunk/extensions/Wikidata/OmegaWiki/type.php        2010-04-21 18:22:28 UTC 
(rev 65407)
@@ -24,16 +24,20 @@
 }
 
 function pageAsURL( $nameSpace, $title, $usedc = true ) {
-       global
-               $wgScript;
 
-       $url = $wgScript . '?title=' . $nameSpace . ':' . htmlspecialchars( 
$title );
+       global $wgArticlePath;
+
+       $url = str_replace( "$1", urlencode( $nameSpace . ':' . $title ), 
$wgArticlePath );
+
        if ( $usedc ) {
                $dc = wdGetDataSetContext();
-               $url .= "&dataset=$dc";
+               if ( strpos($url , "?") ) {
+                       $url .= "&dataset=$dc";
+               } else {
+                       $url .= "?dataset=$dc";
+               }
        }
        return $url;
-               
 }
 
 function spellingAsURL( $spelling ) {



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to