Index: branches/REL1_13/phase3/includes/Setup.php |
— | — | @@ -114,6 +114,15 @@ |
115 | 115 | } |
116 | 116 | } |
117 | 117 | |
| 118 | +/** |
| 119 | + * Workaround for http://bugs.php.net/bug.php?id=45132 |
| 120 | + * escapeshellarg() destroys non-ASCII characters if LANG is not a UTF-8 locale |
| 121 | + */ |
| 122 | +if ( version_compare( PHP_VERSION, '5.2.6', '>=' ) ) { |
| 123 | + putenv( 'LC_CTYPE=en_US.UTF-8' ); |
| 124 | + setlocale( LC_CTYPE, 'en_US.UTF-8' ); |
| 125 | +} |
| 126 | + |
118 | 127 | if ( !class_exists( 'AutoLoader' ) ) { |
119 | 128 | require_once( "$IP/includes/AutoLoader.php" ); |
120 | 129 | } |
Index: branches/REL1_13/phase3/includes/DoubleRedirectJob.php |
— | — | @@ -66,6 +66,13 @@ |
67 | 67 | return true; |
68 | 68 | } |
69 | 69 | |
| 70 | + # Check for a suppression tag (used e.g. in periodically archived discussions) |
| 71 | + $mw = MagicWord::get( 'staticredirect' ); |
| 72 | + if ( $mw->match( $text ) ) { |
| 73 | + wfDebug( __METHOD__.": skipping: suppressed with __STATICREDIRECT__\n" ); |
| 74 | + return true; |
| 75 | + } |
| 76 | + |
70 | 77 | # Find the current final destination |
71 | 78 | $newTitle = self::getFinalDestination( $this->redirTitle ); |
72 | 79 | if ( !$newTitle ) { |
— | — | @@ -78,11 +85,15 @@ |
79 | 86 | wfDebug( __METHOD__.": skipping, already good\n" ); |
80 | 87 | } |
81 | 88 | |
| 89 | + # Preserve fragment (bug 14904) |
| 90 | + $newTitle = Title::makeTitle( $newTitle->getNamespace(), $newTitle->getDBkey(), |
| 91 | + $currentDest->getFragment() ); |
| 92 | + |
82 | 93 | # Fix the text |
83 | 94 | # Remember that redirect pages can have categories, templates, etc., |
84 | 95 | # so the regex has to be fairly general |
85 | 96 | $newText = preg_replace( '/ \[ \[ [^\]]* \] \] /x', |
86 | | - '[[' . $newTitle->getPrefixedText() . ']]', |
| 97 | + '[[' . $newTitle->getFullText() . ']]', |
87 | 98 | $text, 1 ); |
88 | 99 | |
89 | 100 | if ( $newText === $text ) { |
Index: branches/REL1_13/phase3/includes/MagicWord.php |
— | — | @@ -153,6 +153,7 @@ |
154 | 154 | 'noeditsection', |
155 | 155 | 'newsectionlink', |
156 | 156 | 'hiddencat', |
| 157 | + 'staticredirect', |
157 | 158 | ); |
158 | 159 | |
159 | 160 | |
Index: branches/REL1_13/phase3/includes/Title.php |
— | — | @@ -250,12 +250,13 @@ |
251 | 251 | * |
252 | 252 | * @param int $ns the namespace of the article |
253 | 253 | * @param string $title the unprefixed database key form |
| 254 | + * @param string $fragment The link fragment (after the "#") |
254 | 255 | * @return Title the new object |
255 | 256 | */ |
256 | | - public static function &makeTitle( $ns, $title ) { |
| 257 | + public static function &makeTitle( $ns, $title, $fragment = '' ) { |
257 | 258 | $t = new Title(); |
258 | 259 | $t->mInterwiki = ''; |
259 | | - $t->mFragment = ''; |
| 260 | + $t->mFragment = $fragment; |
260 | 261 | $t->mNamespace = $ns = intval( $ns ); |
261 | 262 | $t->mDbkeyform = str_replace( ' ', '_', $title ); |
262 | 263 | $t->mArticleID = ( $ns >= 0 ) ? -1 : 0; |
— | — | @@ -271,11 +272,12 @@ |
272 | 273 | * |
273 | 274 | * @param int $ns the namespace of the article |
274 | 275 | * @param string $title the database key form |
| 276 | + * @param string $fragment The link fragment (after the "#") |
275 | 277 | * @return Title the new object, or NULL on an error |
276 | 278 | */ |
277 | | - public static function makeTitleSafe( $ns, $title ) { |
| 279 | + public static function makeTitleSafe( $ns, $title, $fragment = '' ) { |
278 | 280 | $t = new Title(); |
279 | | - $t->mDbkeyform = Title::makeName( $ns, $title ); |
| 281 | + $t->mDbkeyform = Title::makeName( $ns, $title, $fragment ); |
280 | 282 | if( $t->secureAndSplit() ) { |
281 | 283 | return $t; |
282 | 284 | } else { |
— | — | @@ -391,13 +393,18 @@ |
392 | 394 | * Make a prefixed DB key from a DB key and a namespace index |
393 | 395 | * @param int $ns numerical representation of the namespace |
394 | 396 | * @param string $title the DB key form the title |
| 397 | + * @param string $fragment The link fragment (after the "#") |
395 | 398 | * @return string the prefixed form of the title |
396 | 399 | */ |
397 | | - public static function makeName( $ns, $title ) { |
| 400 | + public static function makeName( $ns, $title, $fragment = '' ) { |
398 | 401 | global $wgContLang; |
399 | 402 | |
400 | | - $n = $wgContLang->getNsText( $ns ); |
401 | | - return $n == '' ? $title : "$n:$title"; |
| 403 | + $namespace = $wgContLang->getNsText( $ns ); |
| 404 | + $name = $namespace == '' ? $title : "$namespace:$title"; |
| 405 | + if ( strval( $fragment ) != '' ) { |
| 406 | + $name .= '#' . $fragment; |
| 407 | + } |
| 408 | + return $name; |
402 | 409 | } |
403 | 410 | |
404 | 411 | /** |
Index: branches/REL1_13/phase3/languages/messages/MessagesEn.php |
— | — | @@ -340,6 +340,7 @@ |
341 | 341 | 'hiddencat' => array( 1, '__HIDDENCAT__' ), |
342 | 342 | 'pagesincategory' => array( 1, 'PAGESINCATEGORY', 'PAGESINCAT' ), |
343 | 343 | 'pagesize' => array( 1, 'PAGESIZE' ), |
| 344 | + 'staticredirect' => array( 1, '__STATICREDIRECT__' ), |
344 | 345 | ); |
345 | 346 | |
346 | 347 | /** |
— | — | @@ -440,7 +441,7 @@ |
441 | 442 | * Regular expression matching the "link trail", e.g. "ed" in [[Toast]]ed, as |
442 | 443 | * the first group, and the remainder of the string as the second group. |
443 | 444 | */ |
444 | | -$linkTrail = '/^(\p{L&}+)(.*)$/usD'; |
| 445 | +$linkTrail = '/^([a-z]+)(.*)$/sD'; |
445 | 446 | |
446 | 447 | /** |
447 | 448 | * List of filenames for some ui images that can be overridden per language |
Index: branches/REL1_13/phase3/RELEASE-NOTES |
— | — | @@ -3,7 +3,7 @@ |
4 | 4 | Security reminder: MediaWiki does not require PHP's register_globals |
5 | 5 | setting since version 1.2.0. If you have it on, turn it *off* if you can. |
6 | 6 | |
7 | | -== MediaWiki 1.13.0rc1 == |
| 7 | +== MediaWiki 1.13.0rc2 == |
8 | 8 | |
9 | 9 | This is a release candidate of the Summer 2008 quarterly snapshot release |
10 | 10 | of MediaWiki. |
— | — | @@ -19,6 +19,29 @@ |
20 | 20 | Those wishing to use the latest code instead of a branch release can obtain |
21 | 21 | it from source control: http://www.mediawiki.org/wiki/Download_from_SVN |
22 | 22 | |
| 23 | +== Changes since 1.13.0rc1 == |
| 24 | + |
| 25 | +* $wgForwardSearchUrl has been removed entirely. Documented setting since 1.4 |
| 26 | + has been $wgSearchForwardUrl. |
| 27 | +* (bug 14907) DatabasePostgres::fieldType now defined. |
| 28 | +* (bug 14966) Fix SearchEngineDummy class for silently non-functional search |
| 29 | + on Sqlite instead of horribly fatal error breaky one. |
| 30 | +* (bug 14987) Only fix double redirects on page move when the checkbox is |
| 31 | + checked |
| 32 | +* (bug 13376) Use $wgPasswordSender, not $wgEmergencyContact, as return |
| 33 | + address for page update notification mails. |
| 34 | +* API: Registration time of users registered before the DB field was created is now |
| 35 | + shown as empty instead of the current time. |
| 36 | +* (bug 14904): fragments were lost when redirects were fixed. |
| 37 | +* Added magic word __STATICREDIRECT__ to suppress the redirect fixer |
| 38 | +* (bug 15035) Revert English linkTrail to /^([a-z]+)(.*)$/sD, as it was before |
| 39 | + r36253. Multiple reports of breakage due to old (pre-5.0) PCRE libraries, |
| 40 | + both bundled with PHP and packaged with distros such as RHEL. |
| 41 | +* (bug 14944) Shell invocation of external programs such as ImageMagick convert |
| 42 | + was broken in PHP 5.2.6, if the server had a non-UTF-8 locale. |
| 43 | + |
| 44 | +== Changes since 1.12 == |
| 45 | + |
23 | 46 | === Configuration changes in 1.13 === |
24 | 47 | |
25 | 48 | * New option $wgFeed can be set false to turn off syndication feeds |
— | — | @@ -71,8 +94,6 @@ |
72 | 95 | creating new directories. |
73 | 96 | * (bug 14843) $wgCookiePrefix can be set by LocalSettings now, false defaults |
74 | 97 | current behavior. |
75 | | -* $wgForwardSearchUrl has been removed entirely. Documented setting since 1.4 |
76 | | - has been $wgSearchForwardUrl. |
77 | 98 | |
78 | 99 | === New features in 1.13 === |
79 | 100 | |
— | — | @@ -455,13 +476,6 @@ |
456 | 477 | * (bug 12568) configuration script now produce valid XHTML. |
457 | 478 | * The accesskey to edit a page is now disabled when editing the page, to pre- |
458 | 479 | vent conflicts with Safari shortcuts. |
459 | | -* (bug 14907) DatabasePostgres::fieldType now defined. |
460 | | -* (bug 14966) Fix SearchEngineDummy class for silently non-functional search |
461 | | - on Sqlite instead of horribly fatal error breaky one. |
462 | | -* (bug 14987) Only fix double redirects on page move when the checkbox is |
463 | | - checked |
464 | | -* (bug 13376) Use $wgPasswordSender, not $wgEmergencyContact, as return |
465 | | - address for page update notification mails. |
466 | 480 | |
467 | 481 | === API changes in 1.13 === |
468 | 482 | |
— | — | @@ -557,8 +571,6 @@ |
558 | 572 | * Added flag "top" to list=usercontribs if the user is the last contributor to |
559 | 573 | the page |
560 | 574 | * list=exturlusage in "list all links" mode can now filter by protocol |
561 | | -* Registration time of users registered before the DB field was created is now |
562 | | - shown as empty instead of the current time. |
563 | 575 | |
564 | 576 | === Languages updated in 1.13 === |
565 | 577 | |