Index: branches/wmf/1.17wmf1/maintenance/language/messages.inc |
— | — | @@ -1094,7 +1094,6 @@ |
1095 | 1095 | 'right-reset-passwords', |
1096 | 1096 | 'right-override-export-depth', |
1097 | 1097 | 'right-sendemail', |
1098 | | - 'right-disableaccount', |
1099 | 1098 | ), |
1100 | 1099 | 'rightslog' => array( |
1101 | 1100 | 'rightslog', |
— | — | @@ -3212,17 +3211,6 @@ |
3213 | 3212 | 'sqlite-has-fts', |
3214 | 3213 | 'sqlite-no-fts', |
3215 | 3214 | ), |
3216 | | - 'disableaccount' => array( |
3217 | | - 'disableaccount', |
3218 | | - 'disableaccount-user', |
3219 | | - 'disableaccount-reason', |
3220 | | - 'disableaccount-confirm', |
3221 | | - 'disableaccount-mustconfirm', |
3222 | | - 'disableaccount-confirm', |
3223 | | - 'disableaccount-nosuchuser', |
3224 | | - 'disableaccount-success', |
3225 | | - 'disableaccount-logentry', |
3226 | | - ), |
3227 | 3215 | ); |
3228 | 3216 | |
3229 | 3217 | /** Comments for each block */ |
— | — | @@ -3436,5 +3424,4 @@ |
3437 | 3425 | 'db-error-messages' => 'Database error messages', |
3438 | 3426 | 'html-forms' => 'HTML forms', |
3439 | 3427 | 'sqlite' => 'SQLite database support', |
3440 | | - 'disableaccount' => 'Special:DisableAccount', |
3441 | 3428 | ); |
Index: branches/wmf/1.17wmf1/includes/CategoryPage.php |
— | — | @@ -197,6 +197,9 @@ |
198 | 198 | * entry in the categorylinks table is Category:A, not A, which it SHOULD be. |
199 | 199 | * Workaround: If sortkey == "Category:".$title, than use $title for sorting, |
200 | 200 | * else use sortkey... |
| 201 | + * |
| 202 | + * @param Title $title |
| 203 | + * @param string $sortkey The human-readable sortkey (before transforming to icu or whatever). |
201 | 204 | */ |
202 | 205 | function getSubcategorySortChar( $title, $sortkey ) { |
203 | 206 | global $wgContLang; |
— | — | @@ -299,7 +302,8 @@ |
300 | 303 | array( 'page', 'categorylinks', 'category' ), |
301 | 304 | array( 'page_id', 'page_title', 'page_namespace', 'page_len', |
302 | 305 | 'page_is_redirect', 'cl_sortkey', 'cat_id', 'cat_title', |
303 | | - 'cat_subcats', 'cat_pages', 'cat_files', 'cl_sortkey_prefix' ), |
| 306 | + 'cat_subcats', 'cat_pages', 'cat_files', |
| 307 | + 'cl_sortkey_prefix', 'cl_collation' ), |
304 | 308 | array_merge( array( 'cl_to' => $this->title->getDBkey() ), $extraConds ), |
305 | 309 | __METHOD__, |
306 | 310 | array( |
— | — | @@ -316,22 +320,29 @@ |
317 | 321 | $count = 0; |
318 | 322 | foreach ( $res as $row ) { |
319 | 323 | $title = Title::newFromRow( $row ); |
320 | | - $rawSortkey = $row->cl_sortkey; |
| 324 | + if ( $row->cl_collation === '' ) { |
| 325 | + // Hack to make sure that while updating from 1.16 schema |
| 326 | + // and db is inconsistent, that the sky doesn't fall. |
| 327 | + // See r83544. Could perhaps be removed in a couple decades... |
| 328 | + $humanSortkey = $row->cl_sortkey; |
| 329 | + } else { |
| 330 | + $humanSortkey = $title->getCategorySortkey( $row->cl_sortkey_prefix ); |
| 331 | + } |
321 | 332 | |
322 | 333 | if ( ++$count > $this->limit ) { |
323 | 334 | # We've reached the one extra which shows that there |
324 | 335 | # are additional pages to be had. Stop here... |
325 | | - $this->nextPage[$type] = $rawSortkey; |
| 336 | + $this->nextPage[$type] = $humanSortkey; |
326 | 337 | break; |
327 | 338 | } |
328 | 339 | |
329 | 340 | if ( $title->getNamespace() == NS_CATEGORY ) { |
330 | 341 | $cat = Category::newFromRow( $row, $title ); |
331 | | - $this->addSubcategoryObject( $cat, $rawSortkey, $row->page_len ); |
| 342 | + $this->addSubcategoryObject( $cat, $humanSortkey, $row->page_len ); |
332 | 343 | } elseif ( $title->getNamespace() == NS_FILE ) { |
333 | | - $this->addImage( $title, $rawSortkey, $row->page_len, $row->page_is_redirect ); |
| 344 | + $this->addImage( $title, $humanSortkey, $row->page_len, $row->page_is_redirect ); |
334 | 345 | } else { |
335 | | - $this->addPage( $title, $rawSortkey, $row->page_len, $row->page_is_redirect ); |
| 346 | + $this->addPage( $title, $humanSortkey, $row->page_len, $row->page_is_redirect ); |
336 | 347 | } |
337 | 348 | } |
338 | 349 | } |
Property changes on: branches/wmf/1.17wmf1/includes/CategoryPage.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
339 | 350 | Merged /trunk/phase3/includes/CategoryPage.php:r85377,85555,85583,86100,86121,86130,86142,86146,86183,86210 |
Index: branches/wmf/1.17wmf1/includes/Article.php |
— | — | @@ -3250,6 +3250,7 @@ |
3251 | 3251 | $dbw->delete( 'templatelinks', array( 'tl_from' => $id ) ); |
3252 | 3252 | $dbw->delete( 'externallinks', array( 'el_from' => $id ) ); |
3253 | 3253 | $dbw->delete( 'langlinks', array( 'll_from' => $id ) ); |
| 3254 | + $dbw->delete( 'iwlinks', array( 'iwl_from' => $id ) ); |
3254 | 3255 | $dbw->delete( 'redirect', array( 'rd_from' => $id ) ); |
3255 | 3256 | } |
3256 | 3257 | |
Property changes on: branches/wmf/1.17wmf1/includes/Article.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
3257 | 3258 | Merged /trunk/phase3/includes/Article.php:r85377,85555,85583,86100,86121,86130,86142,86146,86183,86210 |
Index: branches/wmf/1.17wmf1/includes/ImagePage.php |
— | — | @@ -990,16 +990,16 @@ |
991 | 991 | |
992 | 992 | // Uploading user |
993 | 993 | $row .= '<td>'; |
994 | | - if ( $local ) { |
995 | | - // Hide deleted usernames |
996 | | - if ( $file->isDeleted( File::DELETED_USER ) ) { |
997 | | - $row .= '<span class="history-deleted">' . wfMsgHtml( 'rev-deleted-user' ) . '</span>'; |
| 994 | + // Hide deleted usernames |
| 995 | + if ( $file->isDeleted( File::DELETED_USER ) ) { |
| 996 | + $row .= '<span class="history-deleted">' . wfMsgHtml( 'rev-deleted-user' ) . '</span>'; |
| 997 | + } else { |
| 998 | + if ( $local ) { |
| 999 | + $row .= $this->skin->userLink( $user, $usertext ) . ' <span style="white-space: nowrap;">' . |
| 1000 | + $this->skin->userToolLinks( $user, $usertext ) . '</span>'; |
998 | 1001 | } else { |
999 | | - $row .= $this->skin->userLink( $user, $usertext ) . " <span style='white-space: nowrap;'>" . |
1000 | | - $this->skin->userToolLinks( $user, $usertext ) . "</span>"; |
| 1002 | + $row .= htmlspecialchars( $usertext ); |
1001 | 1003 | } |
1002 | | - } else { |
1003 | | - $row .= htmlspecialchars( $usertext ); |
1004 | 1004 | } |
1005 | 1005 | $row .= '</td><td>'; |
1006 | 1006 | |
Index: branches/wmf/1.17wmf1/includes/OutputPage.php |
— | — | @@ -2280,7 +2280,9 @@ |
2281 | 2281 | $wgUser->getOption( 'editondblclick' ) |
2282 | 2282 | ) |
2283 | 2283 | { |
2284 | | - $bodyAttrs['ondblclick'] = "document.location = '" . Xml::escapeJsString( $this->getTitle()->getEditURL() ) . "'"; |
| 2284 | + $editUrl = $this->getTitle()->getLocalUrl( $sk->editUrlOptions() ); |
| 2285 | + $bodyAttrs['ondblclick'] = "document.location = '" . |
| 2286 | + Xml::escapeJsString( $editUrl ) . "'"; |
2285 | 2287 | } |
2286 | 2288 | |
2287 | 2289 | # Class bloat |
Property changes on: branches/wmf/1.17wmf1/includes/OutputPage.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
2288 | 2290 | Merged /trunk/phase3/includes/OutputPage.php:r85377,85555,85583,86100,86121,86130,86142,86146,86183,86210 |
Index: branches/wmf/1.17wmf1/includes/AutoLoader.php |
— | — | @@ -633,7 +633,6 @@ |
634 | 634 | 'SpecialBookSources' => 'includes/specials/SpecialBooksources.php', |
635 | 635 | 'SpecialCategories' => 'includes/specials/SpecialCategories.php', |
636 | 636 | 'SpecialComparePages' => 'includes/specials/SpecialComparePages.php', |
637 | | - 'SpecialDisableAccount' => 'includes/specials/SpecialDisableAccount.php', |
638 | 637 | 'SpecialExport' => 'includes/specials/SpecialExport.php', |
639 | 638 | 'SpecialFilepath' => 'includes/specials/SpecialFilepath.php', |
640 | 639 | 'SpecialImport' => 'includes/specials/SpecialImport.php', |
Property changes on: branches/wmf/1.17wmf1/includes/AutoLoader.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
641 | 640 | Merged /trunk/phase3/includes/AutoLoader.php:r85377,85555,85583,86100,86121,86130,86142,86146,86183,86210 |
Index: branches/wmf/1.17wmf1/includes/DefaultSettings.php |
— | — | @@ -3324,11 +3324,6 @@ |
3325 | 3325 | // For private suppression log access |
3326 | 3326 | #$wgGroupPermissions['suppress']['suppressionlog'] = true; |
3327 | 3327 | |
3328 | | -// Permission to disable user accounts |
3329 | | -// Note that disabling an account is not reversible without a system administrator |
3330 | | -// who has direct access to the database |
3331 | | -#$wgGroupPermissions['bureaucrat']['disableaccount'] = true; |
3332 | | - |
3333 | 3328 | /** |
3334 | 3329 | * The developer group is deprecated, but can be activated if need be |
3335 | 3330 | * to use the 'lockdb' and 'unlockdb' special pages. Those require |
Property changes on: branches/wmf/1.17wmf1/includes/DefaultSettings.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
3336 | 3331 | Merged /trunk/phase3/includes/DefaultSettings.php:r85377,85555,85583,86100,86121,86130,86142,86146,86183,86210 |
Index: branches/wmf/1.17wmf1/includes/specials/SpecialDisableAccount.php |
— | — | @@ -1,73 +0,0 @@ |
2 | | -<?php |
3 | | - |
4 | | -class SpecialDisableAccount extends SpecialPage { |
5 | | - function __construct() { |
6 | | - parent::__construct( 'DisableAccount', 'disableaccount', |
7 | | - true, array( $this, 'show' ) ); |
8 | | - } |
9 | | - |
10 | | - public function show( $par ) { |
11 | | - $formFields = array( |
12 | | - 'account' => array( |
13 | | - 'type' => 'text', |
14 | | - 'validation-callback' => array( __CLASS__, 'validateUser' ), |
15 | | - 'label-message' => 'disableaccount-user', |
16 | | - ), |
17 | | - 'comment' => array( |
18 | | - 'type' => 'text', |
19 | | - 'label-message' => 'disableaccount-reason', |
20 | | - ), |
21 | | - 'confirm' => array( |
22 | | - 'type' => 'toggle', |
23 | | - 'validation-callback' => array( __CLASS__, 'checkConfirmation' ), |
24 | | - 'label-message' => 'disableaccount-confirm', |
25 | | - ), |
26 | | - ); |
27 | | - |
28 | | - $htmlForm = new HTMLForm( $formFields, 'disableaccount' ); |
29 | | - |
30 | | - $htmlForm->setSubmitCallback( array( __CLASS__, 'submit' ) ); |
31 | | - $htmlForm->setTitle( $this->getTitle() ); |
32 | | - |
33 | | - $htmlForm->show(); |
34 | | - } |
35 | | - |
36 | | - static function validateUser( $field, $allFields ) { |
37 | | - $u = User::newFromName( $field ); |
38 | | - |
39 | | - if ( $u && $u->getID() != 0 ) { |
40 | | - return true; |
41 | | - } else { |
42 | | - return wfMsgExt( 'disableaccount-nosuchuser', 'parseinline', array( $field ) ); |
43 | | - } |
44 | | - } |
45 | | - |
46 | | - static function checkConfirmation( $field, $allFields ) { |
47 | | - if ( $field ) { |
48 | | - return true; |
49 | | - } else { |
50 | | - return wfMsgExt( 'disableaccount-mustconfirm', 'parseinline' ); |
51 | | - } |
52 | | - } |
53 | | - |
54 | | - static function submit( $fields ) { |
55 | | - $user = User::newFromName( $fields['account'] ); |
56 | | - |
57 | | - $user->setPassword( null ); |
58 | | - $user->setEmail( null ); |
59 | | - $user->setToken(); |
60 | | - $user->addGroup( 'inactive' ); |
61 | | - |
62 | | - $user->saveSettings(); |
63 | | - $user->invalidateCache(); |
64 | | - |
65 | | - $logPage = new LogPage( 'rights' ); |
66 | | - |
67 | | - $logPage->addEntry( 'disable', $user->getUserPage(), $fields['comment'] ); |
68 | | - |
69 | | - global $wgOut; |
70 | | - $wgOut->addWikiMsg( 'disableaccount-success', $user->getName() ); |
71 | | - |
72 | | - return true; |
73 | | - } |
74 | | -} |
\ No newline at end of file |
Index: branches/wmf/1.17wmf1/includes/SpecialPage.php |
— | — | @@ -133,7 +133,6 @@ |
134 | 134 | 'Listbots' => array( 'SpecialRedirectToSpecial', 'Listbots', 'Listusers', 'bot' ), |
135 | 135 | 'Activeusers' => 'SpecialActiveUsers', |
136 | 136 | 'Userrights' => 'UserrightsPage', |
137 | | - 'DisableAccount' => 'SpecialDisableAccount', |
138 | 137 | |
139 | 138 | # Recent changes and logs |
140 | 139 | 'Newimages' => array( 'IncludableSpecialPage', 'Newimages' ), |
— | — | @@ -1063,4 +1062,4 @@ |
1064 | 1063 | global $wgUser; |
1065 | 1064 | return SpecialPage::getTitleFor( 'Listfiles', $wgUser->getName() ); |
1066 | 1065 | } |
1067 | | -} |
\ No newline at end of file |
| 1066 | +} |
Property changes on: branches/wmf/1.17wmf1/includes/SpecialPage.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
1068 | 1067 | Merged /trunk/phase3/includes/SpecialPage.php:r85377,85555,85583,86100,86121,86130,86142,86146,86183,86210 |
Index: branches/wmf/1.17wmf1/includes/normal/UtfNormal.php |
— | — | @@ -79,19 +79,30 @@ |
80 | 80 | * @return string a clean, shiny, normalized UTF-8 string |
81 | 81 | */ |
82 | 82 | static function cleanUp( $string ) { |
83 | | - if( NORMALIZE_ICU || NORMALIZE_INTL ) { |
84 | | - # We exclude a few chars that ICU would not. |
85 | | - $string = preg_replace( |
86 | | - '/[\x00-\x08\x0b\x0c\x0e-\x1f]/', |
87 | | - UTF8_REPLACEMENT, |
88 | | - $string ); |
89 | | - $string = str_replace( UTF8_FFFE, UTF8_REPLACEMENT, $string ); |
90 | | - $string = str_replace( UTF8_FFFF, UTF8_REPLACEMENT, $string ); |
| 83 | + if( NORMALIZE_ICU ) { |
| 84 | + $string = self::replaceForNativeNormalize( $string ); |
91 | 85 | |
92 | 86 | # UnicodeString constructor fails if the string ends with a |
93 | 87 | # head byte. Add a junk char at the end, we'll strip it off. |
94 | | - if ( NORMALIZE_ICU ) return rtrim( utf8_normalize( $string . "\x01", UNORM_NFC ), "\x01" ); |
95 | | - if ( NORMALIZE_INTL ) return normalizer_normalize( $string, Normalizer::FORM_C ); |
| 88 | + return rtrim( utf8_normalize( $string . "\x01", UNORM_NFC ), "\x01" ); |
| 89 | + } elseif( NORMALIZE_INTL ) { |
| 90 | + $string = self::replaceForNativeNormalize( $string ); |
| 91 | + $norm = normalizer_normalize( $string, Normalizer::FORM_C ); |
| 92 | + if( $norm === null || $norm === false ) { |
| 93 | + # normalizer_normalize will either return false or null |
| 94 | + # (depending on which doc you read) if invalid utf8 string. |
| 95 | + # quickIsNFCVerify cleans up invalid sequences. |
| 96 | + |
| 97 | + if( UtfNormal::quickIsNFCVerify( $string ) ) { |
| 98 | + # if that's true, the string is actually already normal. |
| 99 | + return $string; |
| 100 | + } else { |
| 101 | + # Now we are valid but non-normal |
| 102 | + return normalizer_normalize( $string, Normalizer::FORM_C ); |
| 103 | + } |
| 104 | + } else { |
| 105 | + return $norm; |
| 106 | + } |
96 | 107 | } elseif( UtfNormal::quickIsNFCVerify( $string ) ) { |
97 | 108 | # Side effect -- $string has had UTF-8 errors cleaned up. |
98 | 109 | return $string; |
— | — | @@ -748,4 +759,20 @@ |
749 | 760 | } |
750 | 761 | return $out; |
751 | 762 | } |
| 763 | + /** |
| 764 | + * Function to replace some characters that we don't want |
| 765 | + * but most of the native normalize functions keep. |
| 766 | + * |
| 767 | + * @param $string String The string |
| 768 | + * @return String String with the character codes replaced. |
| 769 | + */ |
| 770 | + private static function replaceForNativeNormalize( $string ) { |
| 771 | + $string = preg_replace( |
| 772 | + '/[\x00-\x08\x0b\x0c\x0e-\x1f]/', |
| 773 | + UTF8_REPLACEMENT, |
| 774 | + $string ); |
| 775 | + $string = str_replace( UTF8_FFFE, UTF8_REPLACEMENT, $string ); |
| 776 | + $string = str_replace( UTF8_FFFF, UTF8_REPLACEMENT, $string ); |
| 777 | + return $string; |
| 778 | + } |
752 | 779 | } |
Index: branches/wmf/1.17wmf1/includes/DjVuImage.php |
— | — | @@ -254,8 +254,7 @@ |
255 | 255 | $txt = wfShellExec( $cmd, $retval ); |
256 | 256 | wfProfileOut( 'djvutxt' ); |
257 | 257 | if( $retval == 0) { |
258 | | - # Get rid of invalid UTF-8, strip control characters |
259 | | - $txt = UtfNormal::cleanUp( $txt ); |
| 258 | + # Strip some control characters |
260 | 259 | $txt = preg_replace( "/[\013\035\037]/", "", $txt ); |
261 | 260 | $reg = <<<EOR |
262 | 261 | /\(page\s[\d-]*\s[\d-]*\s[\d-]*\s[\d-]*\s*" |
— | — | @@ -279,7 +278,8 @@ |
280 | 279 | } |
281 | 280 | |
282 | 281 | function pageTextCallback( $matches ) { |
283 | | - return '<PAGE value="' . htmlspecialchars( $matches[1] ) . '" />'; |
| 282 | + # Get rid of invalid UTF-8, strip control characters |
| 283 | + return '<PAGE value="' . htmlspecialchars( UtfNormal::cleanUp( $matches[1] ) ) . '" />'; |
284 | 284 | } |
285 | 285 | |
286 | 286 | /** |
Index: branches/wmf/1.17wmf1/languages/messages/MessagesEn.php |
— | — | @@ -1931,7 +1931,6 @@ |
1932 | 1932 | 'right-reset-passwords' => "Reset other users' passwords", |
1933 | 1933 | 'right-override-export-depth' => 'Export pages including linked pages up to a depth of 5', |
1934 | 1934 | 'right-sendemail' => 'Send e-mail to other users', |
1935 | | -'right-disableaccount' => 'Disable accounts', |
1936 | 1935 | |
1937 | 1936 | # User rights log |
1938 | 1937 | 'rightslog' => 'User rights log', |
— | — | @@ -4366,18 +4365,4 @@ |
4367 | 4366 | # SQLite database support |
4368 | 4367 | 'sqlite-has-fts' => '$1 with full-text search support', |
4369 | 4368 | 'sqlite-no-fts' => '$1 without full-text search support', |
4370 | | - |
4371 | | -# Special:DisableAccount |
4372 | | -'disableaccount' => 'Disable a user account', |
4373 | | -'disableaccount-user' => 'Username:', |
4374 | | -'disableaccount-reason' => 'Reason:', |
4375 | | -'disableaccount-confirm' => "Disable this user account. |
4376 | | -The user will not be able to log in, reset their password, or receive e-mail notifications. |
4377 | | -If the user is currently logged in anywhere, they will be immediately logged out. |
4378 | | -''Note that disabling an account is not reversible without system administrator intervention.''", |
4379 | | -'disableaccount-mustconfirm' => 'You must confirm that you wish to disable this account.', |
4380 | | -'disableaccount-nosuchuser' => 'The user account "$1" does not exist.', |
4381 | | -'disableaccount-success' => 'The user account "$1" has been permanently disabled.', |
4382 | | -'disableaccount-logentry' => 'permanently disabled the user account [[$1]]', |
4383 | | - |
4384 | 4369 | ); |
Property changes on: branches/wmf/1.17wmf1/languages/messages/MessagesEn.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
4385 | 4370 | Merged /trunk/phase3/languages/messages/MessagesEn.php:r85377,85555,85583,86100,86121,86130,86142,86146,86183,86210 |
Index: branches/wmf/1.17wmf1/RELEASE-NOTES |
— | — | @@ -505,6 +505,9 @@ |
506 | 506 | since length can vary by localization. |
507 | 507 | * (bug 28242) Make redirects generated by urls containing a local interwiki |
508 | 508 | prefix be a 301 instead of a 302. |
| 509 | +* (bug 28306) Fix exposure of suppressed usernames in ForeignDBRepo |
| 510 | +* (bug 28444) Fix regression: edit-on-doubleclick retains revision id again |
| 511 | +* UtfNormal::cleanUp on an invalid utf-8 sequence no longer returns false if intl installed. |
509 | 512 | |
510 | 513 | === API changes in 1.18 === |
511 | 514 | * (bug 26339) Throw warning when truncating an overlarge API result |
Property changes on: branches/wmf/1.17wmf1/RELEASE-NOTES |
___________________________________________________________________ |
Modified: svn:mergeinfo |
512 | 515 | Merged /trunk/phase3/RELEASE-NOTES:r85377,85555,85583,86100,86121,86130,86142,86146,86183,86210 |