Index: trunk/phase3/includes/Title.php |
— | — | @@ -809,7 +809,7 @@ |
810 | 810 | */ |
811 | 811 | public function getLocalURL( $query = '', $variant = false ) { |
812 | 812 | global $wgArticlePath, $wgScript, $wgServer, $wgRequest; |
813 | | - global $wgVariantArticlePath, $wgContLang, $wgUser; |
| 813 | + global $wgVariantArticlePath, $wgContLang, $wgUser, $wgArticlePathForCurid; |
814 | 814 | |
815 | 815 | if( is_array( $query ) ) { |
816 | 816 | $query = wfArrayToCGI( $query ); |
— | — | @@ -833,7 +833,7 @@ |
834 | 834 | } |
835 | 835 | } else { |
836 | 836 | $dbkey = wfUrlencode( $this->getPrefixedDBkey() ); |
837 | | - if ( $query == '' ) { |
| 837 | + if ( $query == '' || ($wgArticlePathForCurid && substr_count( $query, '&' ) == 0 && strpos( $query, 'curid=' ) === 0 ) ) { |
838 | 838 | if( $variant != false && $wgContLang->hasVariants() ) { |
839 | 839 | if( $wgVariantArticlePath == false ) { |
840 | 840 | $variantArticlePath = "$wgScript?title=$1&variant=$2"; // default |
— | — | @@ -845,6 +845,13 @@ |
846 | 846 | } else { |
847 | 847 | $url = str_replace( '$1', $dbkey, $wgArticlePath ); |
848 | 848 | } |
| 849 | + if( $query ){ |
| 850 | + if( strpos( $url, '&' ) ){ |
| 851 | + $url .= '&' . $query; |
| 852 | + }else{ |
| 853 | + $url .= '?' . $query; |
| 854 | + } |
| 855 | + } |
849 | 856 | } else { |
850 | 857 | global $wgActionPaths; |
851 | 858 | $url = false; |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -3434,3 +3434,10 @@ |
3435 | 3435 | * Requires memcached. |
3436 | 3436 | */ |
3437 | 3437 | $wgPasswordAttemptThrottle = array( 'count' => 5, 'seconds' => 300 ); |
| 3438 | + |
| 3439 | +/** |
| 3440 | + * Allow using articlepath for links where the only querystring is a curid (e.g. use /wiki/Main_Page?curid=1) |
| 3441 | + * WARNING: This will not work for all hosts or configuration setup, so BE CAREFUL. |
| 3442 | + * Only use this setting if you have to, as it is not recommended. |
| 3443 | + */ |
| 3444 | +$wgArticlePathForCurid = false; |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -140,6 +140,8 @@ |
141 | 141 | restriction types on the protection form. |
142 | 142 | * (bug 8440) Allow preventing blocked users from editing their talk pages |
143 | 143 | * Improved upload file type detection for OpenDocument formats |
| 144 | +* (bug 15739) Add $wgArticlePathForCurid to make links with only curid=# as the |
| 145 | + query string use the article path, rather than the script path |
144 | 146 | |
145 | 147 | |
146 | 148 | === Bug fixes in 1.14 === |