Index: trunk/extensions/Wikidata/OmegaWiki/type.php |
— | — | @@ -24,16 +24,20 @@ |
25 | 25 | } |
26 | 26 | |
27 | 27 | function pageAsURL( $nameSpace, $title, $usedc = true ) { |
28 | | - global |
29 | | - $wgScript; |
30 | 28 | |
31 | | - $url = $wgScript . '?title=' . $nameSpace . ':' . htmlspecialchars( $title ); |
| 29 | + global $wgArticlePath; |
| 30 | + |
| 31 | + $url = str_replace( "$1", urlencode( $nameSpace . ':' . $title ), $wgArticlePath ); |
| 32 | + |
32 | 33 | if ( $usedc ) { |
33 | 34 | $dc = wdGetDataSetContext(); |
34 | | - $url .= "&dataset=$dc"; |
| 35 | + if ( strpos($url , "?") ) { |
| 36 | + $url .= "&dataset=$dc"; |
| 37 | + } else { |
| 38 | + $url .= "?dataset=$dc"; |
| 39 | + } |
35 | 40 | } |
36 | 41 | return $url; |
37 | | - |
38 | 42 | } |
39 | 43 | |
40 | 44 | function spellingAsURL( $spelling ) { |