Index: branches/REL1_18/extensions/TalkHere/TalkHereHooks.php |
— | — | @@ -333,7 +333,7 @@ |
334 | 334 | |
335 | 335 | public function internalAttemptSave( &$result, $bot = false ) { |
336 | 336 | $res = parent::internalAttemptSave( $result, $bot ); |
337 | | - $this->code = $res; |
| 337 | + $this->code = $res->value; |
338 | 338 | if ( isset( $result['sectionanchor'] ) ) { |
339 | 339 | $this->sectionanchor = $result['sectionanchor']; |
340 | 340 | } |
Index: branches/REL1_18/extensions/SemanticForms/specials/SF_FormEdit.php |
— | — | @@ -307,7 +307,8 @@ |
308 | 308 | |
309 | 309 | // Try to save the page! |
310 | 310 | $resultDetails = array(); |
311 | | - $saveResultCode = $editor->internalAttemptSave( $resultDetails ); |
| 311 | + $saveResult = $editor->internalAttemptSave( $resultDetails ); |
| 312 | + $saveResultCode = $saveResult->value; |
312 | 313 | |
313 | 314 | if ( ( $saveResultCode == EditPage::AS_HOOK_ERROR || $saveResultCode == EditPage::AS_HOOK_ERROR_EXPECTED ) && $redirectOnError ) { |
314 | 315 | |
Index: branches/REL1_18/extensions/FlaggedRevs/presentation/FlaggedPageView.php |
— | — | @@ -704,7 +704,7 @@ |
705 | 705 | # Update page sync status for tracking purposes. |
706 | 706 | # NOTE: avoids master hits and doesn't have to be perfect for what it does |
707 | 707 | if ( $this->article->syncedInTracking() != $synced ) { |
708 | | - if ( wfGetDB( DB_SLAVE )->getLag() <= 5 ) { // avoid write-delay cycles |
| 708 | + if ( wfGetLB()->safeGetLag( wfGetDB( DB_SLAVE ) ) <= 5 ) { // avoid write-delay cycles |
709 | 709 | $this->article->updateSyncStatus( $synced ); |
710 | 710 | } |
711 | 711 | } |
Index: branches/REL1_18/extensions/ArchiveLinks/spider.php |
— | — | @@ -162,7 +162,7 @@ |
163 | 163 | |
164 | 164 | $this->jobs = array(); |
165 | 165 | |
166 | | - $wait_time = $this->db_slave->getLag() * 3; |
| 166 | + $wait_time = wfGetLB()->safeGetLag( $this->db_slave ) * 3; |
167 | 167 | $pid = (string) microtime() . ' - ' . getmypid(); |
168 | 168 | $time = time(); |
169 | 169 | |
— | — | @@ -287,4 +287,4 @@ |
288 | 288 | } |
289 | 289 | |
290 | 290 | $maintClass = 'ArchiveLinksSpider'; |
291 | | -require_once RUN_MAINTENANCE_IF_MAIN; |
\ No newline at end of file |
| 291 | +require_once RUN_MAINTENANCE_IF_MAIN; |
Index: branches/REL1_18/extensions/WikiEditor/WikiEditor.php |
— | — | @@ -311,6 +311,7 @@ |
312 | 312 | 'wikieditor-toolbar-characters-page-greek', |
313 | 313 | 'wikieditor-toolbar-characters-page-cyrillic', |
314 | 314 | 'wikieditor-toolbar-characters-page-arabic', |
| 315 | + 'wikieditor-toolbar-characters-page-arabicextended', |
315 | 316 | 'wikieditor-toolbar-characters-page-persian', |
316 | 317 | 'wikieditor-toolbar-characters-page-hebrew', |
317 | 318 | 'wikieditor-toolbar-characters-page-bangla', |
Index: branches/REL1_18/extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.config.js |
— | — | @@ -650,19 +650,108 @@ |
651 | 651 | "\u042f", "\u044f" |
652 | 652 | ] |
653 | 653 | }, |
| 654 | + // The core 28-letter alphabet, special letters for the Arabic language, |
| 655 | + // vowels, punctuation, digits. |
| 656 | + // Names of letters are written as in the Unicode charts. |
654 | 657 | 'arabic': { |
655 | 658 | 'labelMsg': 'wikieditor-toolbar-characters-page-arabic', |
656 | 659 | 'layout': 'characters', |
657 | 660 | 'language': 'ar', |
658 | 661 | 'direction': 'rtl', |
659 | 662 | 'characters': [ |
660 | | - "\u061b", "\u061f", "\u0621", "\u0622", "\u0623", "\u0624", "\u0625", "\u0626", "\u0627", |
661 | | - "\u0628", "\u0629", "\u062a", "\u062b", "\u062c", "\u062d", "\u062e", "\u062f", "\u0630", |
662 | | - "\u0631", "\u0632", "\u0633", "\u0634", "\u0635", "\u0636", "\u0637", "\u0638", "\u0639", |
663 | | - "\u063a", "\u0641", "\u0642", "\u0643", "\u0644", "\u0645", "\u0646", "\u0647", "\u0648", |
664 | | - "\u0649", "\u064a", "\u060c", "\u067e", "\u0686", "\u0698", "\u06af", "\u06ad" |
| 663 | + // core alphabet |
| 664 | + "\u0627", "\u0628", "\u062a", "\u062b", "\u062c", "\u062d", "\u062e", "\u062f", |
| 665 | + "\u0630", "\u0631", "\u0632", "\u0633", "\u0634", "\u0635", "\u0636", "\u0637", |
| 666 | + "\u0638", "\u0639", "\u063a", "\u0641", "\u0642", "\u0643", "\u0644", "\u0645", |
| 667 | + "\u0646", "\u0647", "\u0648", "\u064a", |
| 668 | + // special letters for the Arabic language |
| 669 | + "\u0621", // Hamza |
| 670 | + "\u0622", "\u0623", "\u0625", "\u0671", // Alef |
| 671 | + "\u0624", // Waw hamza |
| 672 | + "\u0626", // Yeh hamza |
| 673 | + "\u0649", // Alef maksura |
| 674 | + "\u0629", // Teh marbuta |
| 675 | + // vowels |
| 676 | + "\u064E", "\u064F", "\u0650", "\u064B", "\u064C", "\u064D", "\u0651", "\u0652", |
| 677 | + "\u0670", |
| 678 | + // punctuation |
| 679 | + "\u060c", "\u061b", "\u061f", "\u0640", |
| 680 | + // digits |
| 681 | + "\u0660", "\u0661", "\u0662", "\u0663", "\u0664", "\u0665", "\u0666", "\u0667", |
| 682 | + "\u0668", "\u0669", "\u066A", "\u066B", "\u066C", "\u066D" |
665 | 683 | ] |
666 | 684 | }, |
| 685 | + // Characters for languages other than Arabic. |
| 686 | + 'arabicextended': { |
| 687 | + 'labelMsg': 'wikieditor-toolbar-characters-page-arabicextended', |
| 688 | + 'layout': 'characters', |
| 689 | + 'language': 'ar', |
| 690 | + 'direction': 'rtl', |
| 691 | + 'characters': [ |
| 692 | + // Alef |
| 693 | + "\u0672", "\u0673", "\u0674", "\u0675", "\u0773", "\u0774", |
| 694 | + // Beh |
| 695 | + "\u066E", "\u067B", "\u067E", "\u0680", "\u0750", "\u0751", "\u0752", "\u0753", |
| 696 | + "\u0754", "\u0755", "\u0756", |
| 697 | + // Teh |
| 698 | + "\u0679", "\u067A", "\u067C", "\u067D", "\u067F", |
| 699 | + // Jeem |
| 700 | + "\u0681", "\u0682", "\u0683", "\u0684", "\u0685", "\u0686", "\u0687", "\u06BF", |
| 701 | + // Hah |
| 702 | + "\u0757", "\u0758", "\u076E", "\u076F", "\u0772", "\u077C", |
| 703 | + // Dal |
| 704 | + "\u0688", "\u0689", "\u068A", "\u068B", "\u068C", "\u068D", "\u068E", "\u068F", |
| 705 | + "\u0690", "\u06EE", "\u0759", "\u075A", |
| 706 | + // Reh |
| 707 | + "\u0691", "\u0692", "\u0693", "\u0694", "\u0695", "\u0696", "\u0697", "\u0698", |
| 708 | + "\u0699", "\u06EF", "\u075B", "\u076B", "\u076C", "\u0771", |
| 709 | + // Seen |
| 710 | + "\u069A", "\u069B", "\u069C", "\u077D", |
| 711 | + // Sheen |
| 712 | + "\u06FA", "\u075C", "\u076D", "\u0770", "\u077E", |
| 713 | + // Sad |
| 714 | + "\u069D", "\u069E", |
| 715 | + // Dad |
| 716 | + "\u06FB", |
| 717 | + // Tah |
| 718 | + "\u069F", |
| 719 | + // Ain |
| 720 | + "\u06A0", "\u075D", "\u075E", "\u075F", |
| 721 | + // Ghain |
| 722 | + "\u06FC", |
| 723 | + // Feh |
| 724 | + "\u06A1", "\u06A2", "\u06A3", "\u06A4", "\u06A5", "\u06A6", "\u0760", "\u0761", |
| 725 | + // Qaf |
| 726 | + "\u066F", "\u06A7", "\u06A8", |
| 727 | + // Kaf |
| 728 | + "\u063B", "\u063C", "\u06A9", "\u06AA", "\u06AB", "\u06AC", "\u06AD", "\u06AE", |
| 729 | + "\u06AF", "\u06B0", "\u06B1", "\u06B2", "\u06B3", "\u06B4", "\u0762", "\u0763", |
| 730 | + "\u0764", "\u077F", |
| 731 | + // Lam |
| 732 | + "\u06B5", "\u06B6", "\u06B7", "\u06B8", "\u076A", |
| 733 | + // Meem |
| 734 | + "\u0765", "\u0766", |
| 735 | + // Noon |
| 736 | + "\u06B9", "\u06BA", "\u06BB", "\u06BC", "\u06BD", "\u0767", "\u0768", "\u0769", |
| 737 | + // Heh |
| 738 | + "\u06BE", "\u06C0", "\u06C1", "\u06C2", "\u06C3", "\u06D5", "\u06FF", |
| 739 | + // Waw |
| 740 | + "\u0676", "\u0677", "\u06C4", "\u06C5", "\u06C6", "\u06C7", "\u06C8", "\u06C9", |
| 741 | + "\u06CA", "\u06CB", "\u06CF", "\u0778", "\u0779", |
| 742 | + // Yeh |
| 743 | + "\u0620", "\u063D", "\u063E", "\u063F", "\u0678", "\u06CC", "\u06CD", "\u06CE", |
| 744 | + "\u06D0", "\u06D1", "\u06D2", "\u06D3", "\u0775", "\u0776", "\u0777", "\u077A", |
| 745 | + "\u077B", |
| 746 | + // diacritics |
| 747 | + "\u0656", "\u0657", "\u0658", "\u0659", "\u065A", "\u065B", "\u065C", "\u065D", |
| 748 | + "\u065E", "\u065F", |
| 749 | + // special punctuation |
| 750 | + "\u06D4", "\u06FD", "\u06FE", |
| 751 | + // special digits |
| 752 | + "\u06F0", "\u06F1", "\u06F2", "\u06F3", "\u06F4", "\u06F5", "\u06F6", "\u06F7", |
| 753 | + "\u06F8", "\u06F9", |
| 754 | + ] |
| 755 | + }, |
667 | 756 | 'hebrew': { |
668 | 757 | 'labelMsg': 'wikieditor-toolbar-characters-page-hebrew', |
669 | 758 | 'layout': 'characters', |
Index: branches/REL1_18/extensions/WikiEditor/WikiEditor.i18n.php |
— | — | @@ -180,6 +180,7 @@ |
181 | 181 | 'wikieditor-toolbar-characters-page-greek' => 'Greek', |
182 | 182 | 'wikieditor-toolbar-characters-page-cyrillic' => 'Cyrillic', |
183 | 183 | 'wikieditor-toolbar-characters-page-arabic' => 'Arabic', |
| 184 | + 'wikieditor-toolbar-characters-page-arabicextended' => 'Arabic extended', |
184 | 185 | 'wikieditor-toolbar-characters-page-persian' => 'Persian', |
185 | 186 | 'wikieditor-toolbar-characters-page-hebrew' => 'Hebrew', |
186 | 187 | 'wikieditor-toolbar-characters-page-bangla' => 'Bangla', |
Index: branches/REL1_18/extensions/RefreshSpecial/RefreshSpecial.body.php |
— | — | @@ -241,7 +241,7 @@ |
242 | 242 | |
243 | 243 | # Wait for the slave to catch up |
244 | 244 | $slaveDB = wfGetDB( DB_SLAVE, array( 'QueryPage::recache', 'vslow' ) ); |
245 | | - while( $slaveDB->getLag() > REFRESHSPECIAL_SLAVE_LAG_LIMIT ) { |
| 245 | + while( wfGetLB()->safeGetLag( $slaveDB ) > REFRESHSPECIAL_SLAVE_LAG_LIMIT ) { |
246 | 246 | $wgOut->addHTML( wfMsg( 'refreshspecial-slave-lagged' ) . '<br />' ); |
247 | 247 | sleep( REFRESHSPECIAL_SLAVE_LAG_SLEEP ); |
248 | 248 | } |
— | — | @@ -290,4 +290,4 @@ |
291 | 291 | $link_back = $sk->makeKnownLinkObj( $titleObj, wfMsg( 'refreshspecial-link-back' ) ); |
292 | 292 | $wgOut->addHTML( '<br /><b>' . $link_back . '</b>' ); |
293 | 293 | } |
294 | | -} |
\ No newline at end of file |
| 294 | +} |
Index: branches/REL1_18/extensions/ParserFunctions/ParserFunctions.i18n.php |
— | — | @@ -459,7 +459,7 @@ |
460 | 460 | 'pfunc-convert-unit-volume-kilolitre' => '{{PLURAL:$1|kilollitru|kilollitros}}', |
461 | 461 | 'pfunc-convert-unit-volume-litre' => '{{PLURAL:$1|llitru|llitros}}', |
462 | 462 | 'pfunc-convert-unit-volume-centilitre' => '{{PLURAL:$1|centillitru|centillitros}}', |
463 | | - 'pfunc-convert-unit-volume-millilitre' => '{{PLURAL:$1|millillitru|millillitros}}', |
| 463 | + 'pfunc-convert-unit-volume-millilitre' => '{{PLURAL:$1|milillitru|milillitros}}', |
464 | 464 | 'pfunc-convert-unit-volume-cubicmetre-abbr' => 'm<sup>3</sup>', |
465 | 465 | 'pfunc-convert-unit-volume-cubiccentimetre-abbr' => 'cm<sup>3</sup>', |
466 | 466 | 'pfunc-convert-unit-volume-cubicmillimetre-abbr' => 'mm<sup>3</sup>', |
— | — | @@ -468,7 +468,7 @@ |
469 | 469 | 'pfunc-convert-unit-pressure-pascal' => '{{PLURAL:$1|$2pascal|$2pascales}}', |
470 | 470 | 'pfunc-convert-unit-pressure-bar' => 'bar', |
471 | 471 | 'pfunc-convert-unit-pressure-decibar' => 'decibar', |
472 | | - 'pfunc-convert-unit-pressure-millibar' => 'millibar', |
| 472 | + 'pfunc-convert-unit-pressure-millibar' => 'milibar', |
473 | 473 | 'pfunc-convert-unit-pressure-kilobarye' => 'kilobario', |
474 | 474 | 'pfunc-convert-unit-pressure-barye' => 'bario', |
475 | 475 | 'pfunc-convert-unit-pressure-atmosphere' => '{{PLURAL:$1|atmósfera|atmósferes}}', |
— | — | @@ -767,7 +767,7 @@ |
768 | 768 | 'pfunc-convert-prefix-deca' => 'deka', |
769 | 769 | 'pfunc-convert-prefix-deci' => 'deci', |
770 | 770 | 'pfunc-convert-prefix-centi' => 'centi', |
771 | | - 'pfunc-convert-prefix-milli' => 'milli', |
| 771 | + 'pfunc-convert-prefix-milli' => 'mili', |
772 | 772 | 'pfunc-convert-prefix-micro' => 'mikro', |
773 | 773 | 'pfunc-convert-prefix-nano' => 'nano', |
774 | 774 | 'pfunc-convert-prefix-pico' => 'piko', |
— | — | @@ -2344,7 +2344,7 @@ |
2345 | 2345 | 'pfunc-convert-prefix-deca' => 'deka', |
2346 | 2346 | 'pfunc-convert-prefix-deci' => 'desi', |
2347 | 2347 | 'pfunc-convert-prefix-centi' => 'senti', |
2348 | | - 'pfunc-convert-prefix-milli' => 'milli', |
| 2348 | + 'pfunc-convert-prefix-milli' => 'mili', |
2349 | 2349 | 'pfunc-convert-prefix-micro' => 'mikro', |
2350 | 2350 | 'pfunc-convert-prefix-nano' => 'nano', |
2351 | 2351 | 'pfunc-convert-prefix-pico' => 'piko', |
— | — | @@ -2386,7 +2386,7 @@ |
2387 | 2387 | 'pfunc-convert-unit-area-squarekilometre' => '{{PLURAL:$1|kilometer persegi|kilometer persegi}}', |
2388 | 2388 | 'pfunc-convert-unit-area-squaremetre' => '{{PLURAL:$1|meter persegi|meter persegi}}', |
2389 | 2389 | 'pfunc-convert-unit-area-squarecentimetre' => '{{PLURAL:$1|sentimeter persegi|sentimeter persegi}}', |
2390 | | - 'pfunc-convert-unit-area-squaremillimetre' => '{{PLURAL:$1|millimeter persegi|millimeter persegi}}', |
| 2390 | + 'pfunc-convert-unit-area-squaremillimetre' => '{{PLURAL:$1|milimeter persegi|milimeter persegi}}', |
2391 | 2391 | 'pfunc-convert-unit-area-hectare' => '{{PLURAL:$1|hektar|hektar}}', |
2392 | 2392 | 'pfunc-convert-unit-area-squaremile' => '{{PLURAL:$1|batu persegi|batu persegi}}', |
2393 | 2393 | 'pfunc-convert-unit-area-acre' => '{{PLURAL:$1|ekar|ekar}}', |
— | — | @@ -2421,11 +2421,11 @@ |
2422 | 2422 | 'pfunc-convert-unit-time-minute-abbr' => 'min', |
2423 | 2423 | 'pfunc-convert-unit-volume-cubicmetre' => '{{PLURAL:$1|meter padu|meter padu}}', |
2424 | 2424 | 'pfunc-convert-unit-volume-cubiccentimetre' => '{{PLURAL:$1|sentimeter padu|sentimeter padu}}', |
2425 | | - 'pfunc-convert-unit-volume-cubicmillimetre' => '{{PLURAL:$1|millimeter padu|millimeter padu}}', |
| 2425 | + 'pfunc-convert-unit-volume-cubicmillimetre' => '{{PLURAL:$1|milimeter padu|milimeter padu}}', |
2426 | 2426 | 'pfunc-convert-unit-volume-kilolitre' => '{{PLURAL:$1|kilolite|kiloliter}}', |
2427 | 2427 | 'pfunc-convert-unit-volume-litre' => '{{PLURAL:$1|liter|liter}}', |
2428 | 2428 | 'pfunc-convert-unit-volume-centilitre' => '{{PLURAL:$1|sentiliter|sentiliter}}', |
2429 | | - 'pfunc-convert-unit-volume-millilitre' => '{{PLURAL:$1|milliliter|milliliter}}', |
| 2429 | + 'pfunc-convert-unit-volume-millilitre' => '{{PLURAL:$1|mililiter|mililiter}}', |
2430 | 2430 | 'pfunc-convert-unit-volume-cubicyard' => '{{PLURAL:$1|ela padu|ela padu}}', |
2431 | 2431 | 'pfunc-convert-unit-volume-cubicfoot' => '{{PLURAL:$1|kaki padu|kaki padu}}', |
2432 | 2432 | 'pfunc-convert-unit-volume-cubicinch' => '{{PLURAL:$1|inci padu|inci padu}}', |
— | — | @@ -2479,12 +2479,12 @@ |
2480 | 2480 | 'pfunc-convert-unit-pressure-pascal' => '{{PLURAL:$1|$2pascal|$2pascal}}', |
2481 | 2481 | 'pfunc-convert-unit-pressure-bar' => 'bar', |
2482 | 2482 | 'pfunc-convert-unit-pressure-decibar' => 'desibar', |
2483 | | - 'pfunc-convert-unit-pressure-millibar' => 'millibar', |
| 2483 | + 'pfunc-convert-unit-pressure-millibar' => 'milibar', |
2484 | 2484 | 'pfunc-convert-unit-pressure-kilobarye' => 'kilobarye', |
2485 | 2485 | 'pfunc-convert-unit-pressure-barye' => 'barye', |
2486 | 2486 | 'pfunc-convert-unit-pressure-atmosphere' => '{{PLURAL:$1|atmosfera|atmosfera}}', |
2487 | 2487 | 'pfunc-convert-unit-pressure-torr' => '{{PLURAL:$1|Torr|Torr}}', |
2488 | | - 'pfunc-convert-unit-pressure-mmhg' => '{{PLURAL:$1|millimeter raksa|millimeter raksa}}', |
| 2488 | + 'pfunc-convert-unit-pressure-mmhg' => '{{PLURAL:$1|milimeter raksa|milimeter raksa}}', |
2489 | 2489 | 'pfunc-convert-unit-pressure-inhg' => '{{PLURAL:$1|inci raksa|inci raksa}}', |
2490 | 2490 | 'pfunc-convert-unit-pressure-psi' => '{{PLURAL:$1|paun seinci persegi|paun seinci persegi}}', |
2491 | 2491 | 'pfunc-convert-unit-pressure-pascal-abbr' => '$2Pa', |
— | — | @@ -2903,7 +2903,7 @@ |
2904 | 2904 | 'pfunc-convert-prefix-deca' => 'deka', |
2905 | 2905 | 'pfunc-convert-prefix-deci' => 'decy', |
2906 | 2906 | 'pfunc-convert-prefix-centi' => 'centy', |
2907 | | - 'pfunc-convert-prefix-milli' => 'milli', |
| 2907 | + 'pfunc-convert-prefix-milli' => 'mili', |
2908 | 2908 | 'pfunc-convert-prefix-micro' => 'mikro', |
2909 | 2909 | 'pfunc-convert-prefix-nano' => 'nano', |
2910 | 2910 | 'pfunc-convert-prefix-pico' => 'piko', |
— | — | @@ -2945,7 +2945,7 @@ |
2946 | 2946 | 'pfunc-convert-unit-area-squarekilometre' => '{{PLURAL:$1|kilometr kwadratowy|kilometry kwadratowe|kilometrów kwadratowych}}', |
2947 | 2947 | 'pfunc-convert-unit-area-squaremetre' => '{{PLURAL:$1|metr kwadratowy|metry kwadratowe|metrów kwadratowych}}', |
2948 | 2948 | 'pfunc-convert-unit-area-squarecentimetre' => '{{PLURAL:$1|centymetr kwadratowy|centymetry kwadratowe|centymetrów kwadratowych}}', |
2949 | | - 'pfunc-convert-unit-area-squaremillimetre' => '{{PLURAL:$1|millimetr kwadratowy|millimetry kwadratowe|millimetrów kwadratowych}}', |
| 2949 | + 'pfunc-convert-unit-area-squaremillimetre' => '{{PLURAL:$1|milimetr kwadratowy|milimetry kwadratowe|milimetrów kwadratowych}}', |
2950 | 2950 | 'pfunc-convert-unit-area-hectare' => '{{PLURAL:$1|hektar|hektary|hektarów}}', |
2951 | 2951 | 'pfunc-convert-unit-area-squaremile' => '{{PLURAL:$1|mila kwadratowa|mile kwadratowe|mil kwadratowych}}', |
2952 | 2952 | 'pfunc-convert-unit-area-acre' => '{{PLURAL:$1|akr|akry|akrów}}', |
— | — | @@ -2980,11 +2980,11 @@ |
2981 | 2981 | 'pfunc-convert-unit-time-minute-abbr' => 'min', |
2982 | 2982 | 'pfunc-convert-unit-volume-cubicmetre' => '{{PLURAL:$1|metr sześcienny|metry sześcienne|metrów sześciennych}}', |
2983 | 2983 | 'pfunc-convert-unit-volume-cubiccentimetre' => '{{PLURAL:$1|centymetr sześcienny|centymetry sześcienne|centymetrów sześciennych}}', |
2984 | | - 'pfunc-convert-unit-volume-cubicmillimetre' => '{{PLURAL:$1|millimetr sześcienny|millimetry sześcienne|millimetrów sześciennych}}', |
| 2984 | + 'pfunc-convert-unit-volume-cubicmillimetre' => '{{PLURAL:$1|milimetr sześcienny|milimetry sześcienne|milimetrów sześciennych}}', |
2985 | 2985 | 'pfunc-convert-unit-volume-kilolitre' => '{{PLURAL:$1|tysiąc litrów|tysiące litrów|tysięcy litrów}}', |
2986 | 2986 | 'pfunc-convert-unit-volume-litre' => '{{PLURAL:$1|litr|litry|litrów}}', |
2987 | 2987 | 'pfunc-convert-unit-volume-centilitre' => '{{PLURAL:$1|dziesiąta część|dziesiąte części|dziesiątych części}} litra', |
2988 | | - 'pfunc-convert-unit-volume-millilitre' => '{{PLURAL:$1|millilitr|millilitry|millilitrów}}', |
| 2988 | + 'pfunc-convert-unit-volume-millilitre' => '{{PLURAL:$1|mililitr|mililitry|mililitrów}}', |
2989 | 2989 | 'pfunc-convert-unit-volume-quart' => '{{PLURAL:$1|jard|jardów}}', |
2990 | 2990 | 'pfunc-convert-unit-volume-cubicmetre-abbr' => 'm<sup>3</sup>', |
2991 | 2991 | 'pfunc-convert-unit-volume-cubiccentimetre-abbr' => 'cm<sup>3</sup>', |
— | — | @@ -2997,7 +2997,7 @@ |
2998 | 2998 | 'pfunc-convert-unit-pressure-millibar' => 'millibarów', |
2999 | 2999 | 'pfunc-convert-unit-pressure-kilobarye' => 'kilobarów', |
3000 | 3000 | 'pfunc-convert-unit-pressure-atmosphere' => '{{PLURAL:$1|atmosfera|atmosfer}}', |
3001 | | - 'pfunc-convert-unit-pressure-mmhg' => '{{PLURAL:$1|millimtr słupka rtęci|millimetrów słupka rtęci}}', |
| 3001 | + 'pfunc-convert-unit-pressure-mmhg' => '{{PLURAL:$1|milimtr słupka rtęci|milimetrów słupka rtęci}}', |
3002 | 3002 | 'pfunc-convert-unit-pressure-inhg' => '{{PLURAL:$1|cal słupka rtęci|cali słupka rtęci}}', |
3003 | 3003 | 'pfunc-convert-unit-pressure-pascal-abbr' => '$2Pa', |
3004 | 3004 | 'pfunc-convert-unit-pressure-bar-abbr' => 'bar.', |
— | — | @@ -3704,7 +3704,7 @@ |
3705 | 3705 | 'pfunc-convert-prefix-deca' => 'deka', |
3706 | 3706 | 'pfunc-convert-prefix-deci' => 'deci', |
3707 | 3707 | 'pfunc-convert-prefix-centi' => 'centi', |
3708 | | - 'pfunc-convert-prefix-milli' => 'milli', |
| 3708 | + 'pfunc-convert-prefix-milli' => 'mili', |
3709 | 3709 | 'pfunc-convert-prefix-micro' => 'mikro', |
3710 | 3710 | 'pfunc-convert-prefix-nano' => 'nano', |
3711 | 3711 | 'pfunc-convert-prefix-pico' => 'piko', |
— | — | @@ -3748,7 +3748,7 @@ |
3749 | 3749 | 'pfunc-convert-unit-area-squarekilometre' => '{{PLURAL:$1|kvadratni kilometer|kvadratna kilometra|kvadratni kilometri|kvadratnih kilometrov}}', |
3750 | 3750 | 'pfunc-convert-unit-area-squaremetre' => '{{PLURAL:$1|kvadratni meter|kvadratna metra|kvadratni metri|kvadratnih metrov}}', |
3751 | 3751 | 'pfunc-convert-unit-area-squarecentimetre' => '{{PLURAL:$1|kvadratni centimeter|kvadratna centimetra|kvadratni centimetri|kvadratnih centimetrov}}', |
3752 | | - 'pfunc-convert-unit-area-squaremillimetre' => '{{PLURAL:$1|kvadratni millimeter|kvadratna millimetra|kvadratni millimetri|kvadratnih millimetrov}}', |
| 3752 | + 'pfunc-convert-unit-area-squaremillimetre' => '{{PLURAL:$1|kvadratni milimeter|kvadratna milimetra|kvadratni milimetri|kvadratnih milimetrov}}', |
3753 | 3753 | 'pfunc-convert-unit-area-hectare' => '{{PLURAL:$1|hektar|hektara|hektare|hektarov}}', |
3754 | 3754 | 'pfunc-convert-unit-area-squaremile' => '{{PLURAL:$1|kvadratna milja|kvadratni milji|kvadratne milje|kvadratnih milj}}', |
3755 | 3755 | 'pfunc-convert-unit-area-acre' => '{{PLURAL:$1|aker|akra|akri|akrov}}', |
— | — | @@ -3783,11 +3783,11 @@ |
3784 | 3784 | 'pfunc-convert-unit-time-minute-abbr' => 'min', |
3785 | 3785 | 'pfunc-convert-unit-volume-cubicmetre' => '{{PLURAL:$1|kubični meter|kubična metra|kubični metri|kubičnih metrov}}', |
3786 | 3786 | 'pfunc-convert-unit-volume-cubiccentimetre' => '{{PLURAL:$1|kubični centimeter|kubična centimetra|kubični centimetri|kubičnih centimetrov}}', |
3787 | | - 'pfunc-convert-unit-volume-cubicmillimetre' => '{{PLURAL:$1|kubični millimeter|kubična millimetra|kubični millimetri|kubičnih millimetrov}}', |
| 3787 | + 'pfunc-convert-unit-volume-cubicmillimetre' => '{{PLURAL:$1|kubični milimeter|kubična milimetra|kubični milimetri|kubičnih milimetrov}}', |
3788 | 3788 | 'pfunc-convert-unit-volume-kilolitre' => 'kilo{{PLURAL:$1|liter|litra|litri|litrov}}', |
3789 | 3789 | 'pfunc-convert-unit-volume-litre' => '{{PLURAL:$1|liter|litra|litri|litrov}}', |
3790 | 3790 | 'pfunc-convert-unit-volume-centilitre' => 'centi{{PLURAL:$1|liter|litra|litri|litrov}}', |
3791 | | - 'pfunc-convert-unit-volume-millilitre' => 'milli{{PLURAL:$1|liter|litra|litri|litrov}}', |
| 3791 | + 'pfunc-convert-unit-volume-millilitre' => 'mili{{PLURAL:$1|liter|litra|litri|litrov}}', |
3792 | 3792 | 'pfunc-convert-unit-volume-cubicyard' => '{{PLURAL:$1|kubični jard|kubična jarda|kubični jardi|kubičnih jardov}}', |
3793 | 3793 | 'pfunc-convert-unit-volume-cubicfoot' => '{{PLURAL:$1|kubični čevelj|kubična čevlja|kubični čevlji|kubičnih čevljev}}', |
3794 | 3794 | 'pfunc-convert-unit-volume-cubicinch' => '{{PLURAL:$1|kubični palec|kubična palca|kubični palci|kubičnih palcev}}', |
— | — | @@ -3841,12 +3841,12 @@ |
3842 | 3842 | 'pfunc-convert-unit-pressure-pascal' => '{{PLURAL:$1|paskal|paskala|paskali|paskalov}}', |
3843 | 3843 | 'pfunc-convert-unit-pressure-bar' => 'bar', |
3844 | 3844 | 'pfunc-convert-unit-pressure-decibar' => 'decibar', |
3845 | | - 'pfunc-convert-unit-pressure-millibar' => 'millibar', |
| 3845 | + 'pfunc-convert-unit-pressure-millibar' => 'milibar', |
3846 | 3846 | 'pfunc-convert-unit-pressure-kilobarye' => 'kilobarye', |
3847 | 3847 | 'pfunc-convert-unit-pressure-barye' => 'barye', |
3848 | 3848 | 'pfunc-convert-unit-pressure-atmosphere' => '{{PLURAL:$1|atmosfera|atmosferi|atmosfere|atmosfer}}', |
3849 | 3849 | 'pfunc-convert-unit-pressure-torr' => '{{PLURAL:$1|torr|torra|torri|torrov}}', |
3850 | | - 'pfunc-convert-unit-pressure-mmhg' => '{{PLURAL:$1|millimeter|millimetra|millimetri|millimetrov}} živega srebra', |
| 3850 | + 'pfunc-convert-unit-pressure-mmhg' => '{{PLURAL:$1|milimeter|milimetra|milimetri|milimetrov}} živega srebra', |
3851 | 3851 | 'pfunc-convert-unit-pressure-inhg' => '{{PLURAL:$1|palec|palca|palci|palcev}} živega srebra', |
3852 | 3852 | 'pfunc-convert-unit-pressure-psi' => '{{PLURAL:$1|funt|funta|funti|funtov}} na kvadratni palec', |
3853 | 3853 | 'pfunc-convert-unit-pressure-pascal-abbr' => 'Pa', |
— | — | @@ -4426,7 +4426,7 @@ |
4427 | 4427 | 'pfunc-convert-prefix-deca' => 'đềca', |
4428 | 4428 | 'pfunc-convert-prefix-deci' => 'đêxi', |
4429 | 4429 | 'pfunc-convert-prefix-centi' => 'xenti', |
4430 | | - 'pfunc-convert-prefix-milli' => 'milli', |
| 4430 | + 'pfunc-convert-prefix-milli' => 'mili', |
4431 | 4431 | 'pfunc-convert-prefix-micro' => 'micrô', |
4432 | 4432 | 'pfunc-convert-prefix-nano' => 'nanô', |
4433 | 4433 | 'pfunc-convert-prefix-pico' => 'picô', |
— | — | @@ -4503,11 +4503,11 @@ |
4504 | 4504 | 'pfunc-convert-unit-time-minute-abbr' => 'min', |
4505 | 4505 | 'pfunc-convert-unit-volume-cubicmetre' => '{{PLURAL:$1}}mét khối', |
4506 | 4506 | 'pfunc-convert-unit-volume-cubiccentimetre' => '{{PLURAL:$1}}xentimét khối', |
4507 | | - 'pfunc-convert-unit-volume-cubicmillimetre' => '{{PLURAL:$1}}millimét khối', |
| 4507 | + 'pfunc-convert-unit-volume-cubicmillimetre' => '{{PLURAL:$1}}milimét khối', |
4508 | 4508 | 'pfunc-convert-unit-volume-kilolitre' => '{{PLURAL:$1}}kilôlít', |
4509 | 4509 | 'pfunc-convert-unit-volume-litre' => '{{PLURAL:$1}}lít', |
4510 | 4510 | 'pfunc-convert-unit-volume-centilitre' => '{{PLURAL:$1}}xentilít', |
4511 | | - 'pfunc-convert-unit-volume-millilitre' => '{{PLURAL:$1}}millilít', |
| 4511 | + 'pfunc-convert-unit-volume-millilitre' => '{{PLURAL:$1}}mililít', |
4512 | 4512 | 'pfunc-convert-unit-volume-cubicyard' => '{{PLURAL:$1}}yard khối', |
4513 | 4513 | 'pfunc-convert-unit-volume-cubicfoot' => '{{PLURAL:$1}}foot khối', |
4514 | 4514 | 'pfunc-convert-unit-volume-cubicinch' => '{{PLURAL:$1}}inch khối', |
— | — | @@ -4561,12 +4561,12 @@ |
4562 | 4562 | 'pfunc-convert-unit-pressure-pascal' => '{{PLURAL:$1}}$2pascal', |
4563 | 4563 | 'pfunc-convert-unit-pressure-bar' => 'ba', |
4564 | 4564 | 'pfunc-convert-unit-pressure-decibar' => 'đêxiba', |
4565 | | - 'pfunc-convert-unit-pressure-millibar' => 'milliba', |
| 4565 | + 'pfunc-convert-unit-pressure-millibar' => 'miliba', |
4566 | 4566 | 'pfunc-convert-unit-pressure-kilobarye' => 'kilôbarye', |
4567 | 4567 | 'pfunc-convert-unit-pressure-barye' => 'barye', |
4568 | 4568 | 'pfunc-convert-unit-pressure-atmosphere' => '{{PLURAL:$1}}atmôtphe', |
4569 | 4569 | 'pfunc-convert-unit-pressure-torr' => '{{PLURAL:$1}}torr', |
4570 | | - 'pfunc-convert-unit-pressure-mmhg' => '{{PLURAL:$1}}millimét thủy ngân', |
| 4570 | + 'pfunc-convert-unit-pressure-mmhg' => '{{PLURAL:$1}}milimét thủy ngân', |
4571 | 4571 | 'pfunc-convert-unit-pressure-inhg' => '{{PLURAL:$1}}inch thủy ngân', |
4572 | 4572 | 'pfunc-convert-unit-pressure-psi' => '{{PLURAL:$1}}pound một inch vuông', |
4573 | 4573 | 'pfunc-convert-unit-pressure-pascal-abbr' => '$2Pa', |
Index: branches/REL1_18/extensions/InterwikiIntegration/SpecialInterwikiWatchlist.php |
— | — | @@ -222,7 +222,8 @@ |
223 | 223 | } |
224 | 224 | |
225 | 225 | # Show a message about slave lag, if applicable |
226 | | - if( ( $lag = $dbr->getLag() ) > 0 ) |
| 226 | + $lag = wfGetLB()->safeGetLag( $dbr ); |
| 227 | + if( $lag > 0 ) |
227 | 228 | $wgOut->showLagWarning( $lag ); |
228 | 229 | |
229 | 230 | # Create output form |
Index: branches/REL1_18/extensions/CollabWatchlist/includes/SpecialCollabWatchlist.php |
— | — | @@ -197,7 +197,8 @@ |
198 | 198 | } |
199 | 199 | |
200 | 200 | # Show a message about slave lag, if applicable |
201 | | - if( ( $lag = $dbr->getLag() ) > 0 ) |
| 201 | + $lag = wfGetLB()->safeGetLag( $dbr ); |
| 202 | + if ( $lag > 0 ) |
202 | 203 | $wgOut->showLagWarning( $lag ); |
203 | 204 | |
204 | 205 | # Create output form |
Index: branches/REL1_18/extensions/CreateRedirect/CreateRedirect.body.php |
— | — | @@ -125,7 +125,8 @@ |
126 | 126 | } |
127 | 127 | |
128 | 128 | $resultDetails = false; |
129 | | - $value = $crEdit->internalAttemptSave( $resultDetails, $wgUser->isAllowed( 'bot' ) && $wgRequest->getBool( 'bot', true ) ); |
| 129 | + $status = $crEdit->internalAttemptSave( $resultDetails, $wgUser->isAllowed( 'bot' ) && $wgRequest->getBool( 'bot', true ) ); |
| 130 | + $value = $status->value; |
130 | 131 | |
131 | 132 | if ( $value == EditPage::AS_SUCCESS_UPDATE || $value == EditPage::AS_SUCCESS_NEW_ARTICLE ) { |
132 | 133 | $wgOut->wrapWikiMsg( |
Index: branches/REL1_18/phase3/maintenance/language/messages.inc |
— | — | @@ -1135,7 +1135,6 @@ |
1136 | 1136 | 'right-userrights', |
1137 | 1137 | 'right-userrights-interwiki', |
1138 | 1138 | 'right-siteadmin', |
1139 | | - 'right-reset-passwords', |
1140 | 1139 | 'right-override-export-depth', |
1141 | 1140 | 'right-sendemail', |
1142 | 1141 | ), |
Index: branches/REL1_18/phase3/RELEASE-NOTES-1.18 |
— | — | @@ -175,8 +175,11 @@ |
176 | 176 | * (bug 28904) (bug 29773) Update jQuery version from 1.4.4 to 1.6.2 (the latest version) |
177 | 177 | * (bug 29441) Expose CapitalLinks config in JS to allow modules to properly |
178 | 178 | handle titles on case-sensitive wikis. |
179 | | -* In MySQL 4.1.9+ with replication enabled, the slave lag should come from |
180 | | - SHOW SLAVE STATUS instead of SHOW PROCESSLIST. |
| 179 | +* In MySQL 4.1.9+ with replication enabled, fetch the slave lag from SHOW SLAVE |
| 180 | + STATUS instead of SHOW PROCESSLIST. This ensures that lag is reported |
| 181 | + correctly in the case where there are no write events occurring. Note that |
| 182 | + the DB user now needs to have the REPLICATION CLIENT privilege if you are |
| 183 | + using replication. |
181 | 184 | * Language codes in $wgDummyLanguageCodes are now excluded on localization |
182 | 185 | statistics (maintenance/language/transstat.php) |
183 | 186 | * (bug 29586) Make the (next 200) links on categories link directly to |
— | — | @@ -435,6 +438,7 @@ |
436 | 439 | * (bug 30264) Changed installer-generated LocalSettings.php to use require_once() |
437 | 440 | instead require() for included extensions. |
438 | 441 | * Tracking categories are no longer shown in footer for special pages |
| 442 | +* (bug 30684) Fix bad escaping in mw.message for inexistent messages (i.e. <key>) |
439 | 443 | |
440 | 444 | === API changes in 1.18 === |
441 | 445 | * BREAKING CHANGE: action=watch now requires POST and token. |
Property changes on: branches/REL1_18/phase3/RELEASE-NOTES-1.18 |
___________________________________________________________________ |
Modified: svn:mergeinfo |
442 | 446 | Merged /trunk/phase3/RELEASE-NOTES-1.18:r95562,95570,95597,95608,95647-95648,95674,95790,95999,96087 |
443 | 447 | Merged /trunk/phase3/RELEASE-NOTES-1.19:r95999 |
Index: branches/REL1_18/phase3/tests/qunit/suites/resources/mediawiki/mediawiki.js |
— | — | @@ -80,7 +80,7 @@ |
81 | 81 | }); |
82 | 82 | |
83 | 83 | test( 'mw.message & mw.messages', function() { |
84 | | - expect(16); |
| 84 | + expect(17); |
85 | 85 | |
86 | 86 | ok( mw.messages, 'messages defined' ); |
87 | 87 | ok( mw.messages instanceof mw.Map, 'mw.messages instance of mw.Map' ); |
— | — | @@ -113,12 +113,16 @@ |
114 | 114 | var goodbye = mw.message( 'goodbye' ); |
115 | 115 | strictEqual( goodbye.exists(), false, 'Message.exists returns false for inexisting messages' ); |
116 | 116 | |
117 | | - equal( goodbye.toString(), '<goodbye>', 'Message.toString returns <key> if key does not exist' ); |
| 117 | + equal( goodbye.plain(), '<goodbye>', 'Message.toString returns plain <key> if format is "plain" and key does not exist' ); |
| 118 | + // bug 30684 |
| 119 | + equal( goodbye.escaped(), '<goodbye>', 'Message.toString returns properly escaped <key> if format is "escaped" and key does not exist' ); |
118 | 120 | }); |
119 | 121 | |
120 | 122 | test( 'mw.msg', function() { |
121 | | - expect(2); |
| 123 | + expect(3); |
122 | 124 | |
| 125 | + ok( mw.messages.set( 'hello', 'Hello <b>awesome</b> world' ), 'mw.messages.set: Register' ); |
| 126 | + |
123 | 127 | equal( mw.msg( 'hello' ), 'Hello <b>awesome</b> world', 'Gets message with default options (existing message)' ); |
124 | 128 | equal( mw.msg( 'goodbye' ), '<goodbye>', 'Gets message with default options (inexisting message)' ); |
125 | 129 | }); |
Property changes on: branches/REL1_18/phase3/tests/qunit/suites/resources/mediawiki/mediawiki.js |
___________________________________________________________________ |
Added: svn:mergeinfo |
126 | 130 | Merged /branches/new-installer/phase3/tests/qunit/suites/resources/mediawiki/mediawiki.js:r43664-66004 |
127 | 131 | Merged /branches/REL1_15/phase3/tests/qunit/suites/resources/mediawiki/mediawiki.js:r51646 |
128 | 132 | Merged /branches/REL1_17/phase3/tests/qunit/suites/resources/mediawiki/mediawiki.js:r81445,81448 |
129 | 133 | Merged /trunk/phase3/tests/qunit/suites/resources/mediawiki/mediawiki.test.js:r95999 |
130 | 134 | Merged /branches/sqlite/tests/qunit/suites/resources/mediawiki/mediawiki.js:r58211-58321 |
131 | 135 | Merged /trunk/phase3/tests/qunit/suites/resources/mediawiki/mediawiki.js:r92580,92634,92713,92762,92765,92791,92854,92884,92886-92887,92894,92898,92907,92932,92958,93141,93149,93151,93233-93234,93258,93266,93303,93516-93518,93520,93818-93822,93847,93858,93891,93935-93936,94058,94062,94068,94107,94155,94235,94277,94346,94372,94422,94425,94444,94448,94456,94498,94517,94601,94630,94728,94738,94825,94862,94995-94997,95023,95042,95072-95073,95155,95327,95332,95410,95422,95426,95442,95468,95601,95812 |
Index: branches/REL1_18/phase3/includes/db/DatabaseMysql.php |
— | — | @@ -376,9 +376,9 @@ |
377 | 377 | return $this->mFakeSlaveLag; |
378 | 378 | } |
379 | 379 | |
380 | | - /*if ( version_compare( $this->getServerVersion(), '4.1.9', '>=' ) ) { |
| 380 | + if ( version_compare( $this->getServerVersion(), '4.1.9', '>=' ) ) { |
381 | 381 | return $this->getLagFromSlaveStatus(); |
382 | | - } else */{ |
| 382 | + } else { |
383 | 383 | return $this->getLagFromProcesslist(); |
384 | 384 | } |
385 | 385 | } |
Index: branches/REL1_18/phase3/includes/db/DatabaseOracle.php |
— | — | @@ -697,11 +697,11 @@ |
698 | 698 | FROM all_sequences asq, all_tab_columns atc |
699 | 699 | WHERE decode(atc.table_name, '{$this->mTablePrefix}MWUSER', '{$this->mTablePrefix}USER', atc.table_name) || '_' || |
700 | 700 | atc.column_name || '_SEQ' = '{$this->mTablePrefix}' || asq.sequence_name |
701 | | - AND asq.sequence_owner = '{$this->mDBname}' |
702 | | - AND atc.owner = '{$this->mDBname}'" ); |
| 701 | + AND asq.sequence_owner = upper('{$this->mDBname}') |
| 702 | + AND atc.owner = upper('{$this->mDBname}')" ); |
703 | 703 | |
704 | 704 | while ( ( $row = $result->fetchRow() ) !== false ) { |
705 | | - $this->sequenceData[$this->tableName( $row[1] )] = array( |
| 705 | + $this->sequenceData[$row[1]] = array( |
706 | 706 | 'sequence' => $row[0], |
707 | 707 | 'column' => $row[2] |
708 | 708 | ); |
— | — | @@ -1172,6 +1172,24 @@ |
1173 | 1173 | if ( is_array($conds) ) { |
1174 | 1174 | $conds = $this->wrapConditionsForWhere( $table, $conds ); |
1175 | 1175 | } |
| 1176 | + // a hack for deleting pages, users and images (which have non-nullable FKs) |
| 1177 | + // all deletions on these tables have transactions so final failure rollbacks these updates |
| 1178 | + $table = $this->tableName( $table ); |
| 1179 | + if ( $table == $this->tableName( 'page' ) ) { |
| 1180 | + $this->update( 'recentchanges', array( 'rc_cur_id' => 0 ), array( 'rc_cur_id' => $conds['page_id'] ), $fname ); |
| 1181 | + } elseif ( $table == $this->tableName( 'user' ) ) { |
| 1182 | + $this->update( 'archive', array( 'ar_user' => 0 ), array( 'ar_user' => $conds['user_id'] ), $fname ); |
| 1183 | + $this->update( 'ipblocks', array( 'ipb_user' => 0 ), array( 'ipb_user' => $conds['user_id'] ), $fname ); |
| 1184 | + $this->update( 'image', array( 'img_user' => 0 ), array( 'img_user' => $conds['user_id'] ), $fname ); |
| 1185 | + $this->update( 'oldimage', array( 'oi_user' => 0 ), array( 'oi_user' => $conds['user_id'] ), $fname ); |
| 1186 | + $this->update( 'filearchive', array( 'fa_deleted_user' => 0 ), array( 'fa_deleted_user' => $conds['user_id'] ), $fname ); |
| 1187 | + $this->update( 'filearchive', array( 'fa_user' => 0 ), array( 'fa_user' => $conds['user_id'] ), $fname ); |
| 1188 | + $this->update( 'uploadstash', array( 'us_user' => 0 ), array( 'us_user' => $conds['user_id'] ), $fname ); |
| 1189 | + $this->update( 'recentchanges', array( 'rc_user' => 0 ), array( 'rc_user' => $conds['user_id'] ), $fname ); |
| 1190 | + $this->update( 'logging', array( 'log_user' => 0 ), array( 'log_user' => $conds['user_id'] ), $fname ); |
| 1191 | + } elseif ( $table == $this->tableName( 'image' ) ) { |
| 1192 | + $this->update( 'oldimage', array( 'oi_name' => 0 ), array( 'oi_name' => $conds['img_name'] ), $fname ); |
| 1193 | + } |
1176 | 1194 | return parent::delete( $table, $conds, $fname ); |
1177 | 1195 | } |
1178 | 1196 | |
Index: branches/REL1_18/phase3/includes/db/Database.php |
— | — | @@ -2857,8 +2857,12 @@ |
2858 | 2858 | } |
2859 | 2859 | |
2860 | 2860 | /** |
2861 | | - * Get slave lag. |
2862 | | - * Currently supported only by MySQL |
| 2861 | + * Get slave lag. Currently supported only by MySQL. |
| 2862 | + * |
| 2863 | + * Note that this function will generate a fatal error on many |
| 2864 | + * installations. Most callers should use LoadBalancer::safeGetLag() |
| 2865 | + * instead. |
| 2866 | + * |
2863 | 2867 | * @return Database replication lag in seconds |
2864 | 2868 | */ |
2865 | 2869 | function getLag() { |
Property changes on: branches/REL1_18/phase3/includes/db/Database.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
2866 | 2870 | Merged /trunk/phase3/includes/db/Database.php:r95562,95570,95597,95608,95647-95648,95674,95790,95999,96087 |
Index: branches/REL1_18/phase3/includes/db/LoadBalancer.php |
— | — | @@ -928,7 +928,9 @@ |
929 | 929 | /** |
930 | 930 | * Get the hostname and lag time of the most-lagged slave. |
931 | 931 | * This is useful for maintenance scripts that need to throttle their updates. |
932 | | - * May attempt to open connections to slaves on the default DB. |
| 932 | + * May attempt to open connections to slaves on the default DB. If there is |
| 933 | + * no lag, the maximum lag will be reported as -1. |
| 934 | + * |
933 | 935 | * @param $wiki string Wiki ID, or false for the default database |
934 | 936 | * |
935 | 937 | * @return array ( host, max lag, index of max lagged host ) |
— | — | @@ -937,23 +939,25 @@ |
938 | 940 | $maxLag = -1; |
939 | 941 | $host = ''; |
940 | 942 | $maxIndex = 0; |
941 | | - foreach ( $this->mServers as $i => $conn ) { |
942 | | - $conn = false; |
943 | | - if ( $wiki === false ) { |
944 | | - $conn = $this->getAnyOpenConnection( $i ); |
| 943 | + if ( $this->getServerCount() > 1 ) { // no replication = no lag |
| 944 | + foreach ( $this->mServers as $i => $conn ) { |
| 945 | + $conn = false; |
| 946 | + if ( $wiki === false ) { |
| 947 | + $conn = $this->getAnyOpenConnection( $i ); |
| 948 | + } |
| 949 | + if ( !$conn ) { |
| 950 | + $conn = $this->openConnection( $i, $wiki ); |
| 951 | + } |
| 952 | + if ( !$conn ) { |
| 953 | + continue; |
| 954 | + } |
| 955 | + $lag = $conn->getLag(); |
| 956 | + if ( $lag > $maxLag ) { |
| 957 | + $maxLag = $lag; |
| 958 | + $host = $this->mServers[$i]['host']; |
| 959 | + $maxIndex = $i; |
| 960 | + } |
945 | 961 | } |
946 | | - if ( !$conn ) { |
947 | | - $conn = $this->openConnection( $i, $wiki ); |
948 | | - } |
949 | | - if ( !$conn ) { |
950 | | - continue; |
951 | | - } |
952 | | - $lag = $conn->getLag(); |
953 | | - if ( $lag > $maxLag ) { |
954 | | - $maxLag = $lag; |
955 | | - $host = $this->mServers[$i]['host']; |
956 | | - $maxIndex = $i; |
957 | | - } |
958 | 962 | } |
959 | 963 | return array( $host, $maxLag, $maxIndex ); |
960 | 964 | } |
— | — | @@ -971,12 +975,37 @@ |
972 | 976 | if ( isset( $this->mLagTimes ) ) { |
973 | 977 | return $this->mLagTimes; |
974 | 978 | } |
975 | | - # No, send the request to the load monitor |
976 | | - $this->mLagTimes = $this->getLoadMonitor()->getLagTimes( array_keys( $this->mServers ), $wiki ); |
| 979 | + if ( $this->getServerCount() == 1 ) { |
| 980 | + # No replication |
| 981 | + $this->mLagTimes = array( 0 => 0 ); |
| 982 | + } else { |
| 983 | + # Send the request to the load monitor |
| 984 | + $this->mLagTimes = $this->getLoadMonitor()->getLagTimes( |
| 985 | + array_keys( $this->mServers ), $wiki ); |
| 986 | + } |
977 | 987 | return $this->mLagTimes; |
978 | 988 | } |
979 | 989 | |
980 | 990 | /** |
| 991 | + * Get the lag in seconds for a given connection, or zero if this load |
| 992 | + * balancer does not have replication enabled. |
| 993 | + * |
| 994 | + * This should be used in preference to Database::getLag() in cases where |
| 995 | + * replication may not be in use, since there is no way to determine if |
| 996 | + * replication is in use at the connection level without running |
| 997 | + * potentially restricted queries such as SHOW SLAVE STATUS. Using this |
| 998 | + * function instead of Database::getLag() avoids a fatal error in this |
| 999 | + * case on many installations. |
| 1000 | + */ |
| 1001 | + function safeGetLag( $conn ) { |
| 1002 | + if ( $this->getServerCount() == 1 ) { |
| 1003 | + return 0; |
| 1004 | + } else { |
| 1005 | + return $conn->getLag(); |
| 1006 | + } |
| 1007 | + } |
| 1008 | + |
| 1009 | + /** |
981 | 1010 | * Clear the cache for getLagTimes |
982 | 1011 | */ |
983 | 1012 | function clearLagTimeCache() { |
Property changes on: branches/REL1_18/phase3/includes/db/LoadBalancer.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
984 | 1013 | Merged /trunk/phase3/includes/db/LoadBalancer.php:r95562,95570,95597,95608,95647-95648,95674,95790,95999,96087 |
Index: branches/REL1_18/phase3/includes/db/LoadMonitor.php |
— | — | @@ -106,6 +106,11 @@ |
107 | 107 | * @return array |
108 | 108 | */ |
109 | 109 | function getLagTimes( $serverIndexes, $wiki ) { |
| 110 | + if ( count( $serverIndexes ) == 1 && reset( $serverIndexes ) == 0 ) { |
| 111 | + // Single server only, just return zero without caching |
| 112 | + return array( 0 => 0 ); |
| 113 | + } |
| 114 | + |
110 | 115 | wfProfileIn( __METHOD__ ); |
111 | 116 | $expiry = 5; |
112 | 117 | $requestRate = 10; |
Index: branches/REL1_18/phase3/includes/EditPage.php |
— | — | @@ -856,32 +856,42 @@ |
857 | 857 | * @param $result |
858 | 858 | * @param $bot bool |
859 | 859 | * |
860 | | - * @return int one of the constants describing the result |
| 860 | + * @return Status object, possibly with a message, but always with one of the AS_* constants in $status->value, |
| 861 | + * |
| 862 | + * FIXME: This interface is TERRIBLE, but hard to get rid of due to various error display idiosyncrasies. There are |
| 863 | + * also lots of cases where error metadata is set in the object and retrieved later instead of being returned, e.g. |
| 864 | + * AS_CONTENT_TOO_BIG and AS_BLOCKED_PAGE_FOR_USER. All that stuff needs to be cleaned up some time. |
861 | 865 | */ |
862 | 866 | function internalAttemptSave( &$result, $bot = false ) { |
863 | 867 | global $wgFilterCallback, $wgUser, $wgParser; |
864 | 868 | global $wgMaxArticleSize; |
| 869 | + |
| 870 | + $status = Status::newGood(); |
865 | 871 | |
866 | 872 | wfProfileIn( __METHOD__ ); |
867 | 873 | wfProfileIn( __METHOD__ . '-checks' ); |
868 | 874 | |
869 | 875 | if ( !wfRunHooks( 'EditPage::attemptSave', array( $this ) ) ) { |
870 | 876 | wfDebug( "Hook 'EditPage::attemptSave' aborted article saving\n" ); |
| 877 | + $status->fatal( 'hookaborted' ); |
| 878 | + $status->value = self::AS_HOOK_ERROR; |
871 | 879 | wfProfileOut( __METHOD__ . '-checks' ); |
872 | 880 | wfProfileOut( __METHOD__ ); |
873 | | - return self::AS_HOOK_ERROR; |
| 881 | + return $status; |
874 | 882 | } |
875 | 883 | |
876 | 884 | # Check image redirect |
877 | 885 | if ( $this->mTitle->getNamespace() == NS_FILE && |
878 | 886 | Title::newFromRedirect( $this->textbox1 ) instanceof Title && |
879 | 887 | !$wgUser->isAllowed( 'upload' ) ) { |
880 | | - $isAnon = $wgUser->isAnon(); |
| 888 | + $code = $wgUser->isAnon() ? self::AS_IMAGE_REDIRECT_ANON : self::AS_IMAGE_REDIRECT_LOGGED; |
| 889 | + $status->setResult( false, $code ); |
881 | 890 | |
882 | 891 | wfProfileOut( __METHOD__ . '-checks' ); |
| 892 | + |
883 | 893 | wfProfileOut( __METHOD__ ); |
884 | 894 | |
885 | | - return $isAnon ? self::AS_IMAGE_REDIRECT_ANON : self::AS_IMAGE_REDIRECT_LOGGED; |
| 895 | + return $status; |
886 | 896 | } |
887 | 897 | |
888 | 898 | # Check for spam |
— | — | @@ -895,71 +905,88 @@ |
896 | 906 | $pdbk = $this->mTitle->getPrefixedDBkey(); |
897 | 907 | $match = str_replace( "\n", '', $match ); |
898 | 908 | wfDebugLog( 'SpamRegex', "$ip spam regex hit [[$pdbk]]: \"$match\"" ); |
| 909 | + $status->fatal( 'spamprotectionmatch', $match ); |
| 910 | + $status->value = self::AS_SPAM_ERROR; |
899 | 911 | wfProfileOut( __METHOD__ . '-checks' ); |
900 | 912 | wfProfileOut( __METHOD__ ); |
901 | | - return self::AS_SPAM_ERROR; |
| 913 | + return $status; |
902 | 914 | } |
903 | 915 | if ( $wgFilterCallback && $wgFilterCallback( $this->mTitle, $this->textbox1, $this->section, $this->hookError, $this->summary ) ) { |
904 | 916 | # Error messages or other handling should be performed by the filter function |
| 917 | + $status->setResult( false, self::AS_FILTERING ); |
905 | 918 | wfProfileOut( __METHOD__ . '-checks' ); |
906 | 919 | wfProfileOut( __METHOD__ ); |
907 | | - return self::AS_FILTERING; |
| 920 | + return $status; |
908 | 921 | } |
909 | 922 | if ( !wfRunHooks( 'EditFilter', array( $this, $this->textbox1, $this->section, &$this->hookError, $this->summary ) ) ) { |
910 | 923 | # Error messages etc. could be handled within the hook... |
| 924 | + $status->fatal( 'hookaborted' ); |
| 925 | + $status->value = self::AS_HOOK_ERROR; |
911 | 926 | wfProfileOut( __METHOD__ . '-checks' ); |
912 | 927 | wfProfileOut( __METHOD__ ); |
913 | | - return self::AS_HOOK_ERROR; |
| 928 | + return $status; |
914 | 929 | } elseif ( $this->hookError != '' ) { |
915 | 930 | # ...or the hook could be expecting us to produce an error |
| 931 | + $status->fatal( 'hookaborted' ); |
| 932 | + $status->value = self::AS_HOOK_ERROR_EXPECTED; |
916 | 933 | wfProfileOut( __METHOD__ . '-checks' ); |
917 | 934 | wfProfileOut( __METHOD__ ); |
918 | | - return self::AS_HOOK_ERROR_EXPECTED; |
| 935 | + return $status; |
919 | 936 | } |
920 | 937 | if ( $wgUser->isBlockedFrom( $this->mTitle, false ) ) { |
921 | 938 | # Check block state against master, thus 'false'. |
| 939 | + $status->setResult( false, self::AS_BLOCKED_PAGE_FOR_USER ); |
922 | 940 | wfProfileOut( __METHOD__ . '-checks' ); |
923 | 941 | wfProfileOut( __METHOD__ ); |
924 | | - return self::AS_BLOCKED_PAGE_FOR_USER; |
| 942 | + return $status; |
925 | 943 | } |
926 | 944 | $this->kblength = (int)( strlen( $this->textbox1 ) / 1024 ); |
927 | 945 | if ( $this->kblength > $wgMaxArticleSize ) { |
928 | 946 | // Error will be displayed by showEditForm() |
929 | 947 | $this->tooBig = true; |
| 948 | + $status->setResult( false, self::AS_CONTENT_TOO_BIG ); |
930 | 949 | wfProfileOut( __METHOD__ . '-checks' ); |
931 | 950 | wfProfileOut( __METHOD__ ); |
932 | | - return self::AS_CONTENT_TOO_BIG; |
| 951 | + return $status; |
933 | 952 | } |
934 | 953 | |
935 | 954 | if ( !$wgUser->isAllowed( 'edit' ) ) { |
936 | 955 | if ( $wgUser->isAnon() ) { |
| 956 | + $status->setResult( false, self::AS_READ_ONLY_PAGE_ANON ); |
937 | 957 | wfProfileOut( __METHOD__ . '-checks' ); |
938 | 958 | wfProfileOut( __METHOD__ ); |
939 | | - return self::AS_READ_ONLY_PAGE_ANON; |
| 959 | + return $status; |
940 | 960 | } else { |
| 961 | + $status->fatal( 'readonlytext' ); |
| 962 | + $status->value = self::AS_READ_ONLY_PAGE_LOGGED; |
941 | 963 | wfProfileOut( __METHOD__ . '-checks' ); |
942 | 964 | wfProfileOut( __METHOD__ ); |
943 | | - return self::AS_READ_ONLY_PAGE_LOGGED; |
| 965 | + return $status; |
944 | 966 | } |
945 | 967 | } |
946 | 968 | |
947 | 969 | if ( wfReadOnly() ) { |
| 970 | + $status->fatal( 'readonlytext' ); |
| 971 | + $status->value = self::AS_READ_ONLY_PAGE; |
948 | 972 | wfProfileOut( __METHOD__ . '-checks' ); |
949 | 973 | wfProfileOut( __METHOD__ ); |
950 | | - return self::AS_READ_ONLY_PAGE; |
| 974 | + return $status; |
951 | 975 | } |
952 | 976 | if ( $wgUser->pingLimiter() ) { |
| 977 | + $status->fatal( 'actionthrottledtext' ); |
| 978 | + $status->value = self::AS_RATE_LIMITED; |
953 | 979 | wfProfileOut( __METHOD__ . '-checks' ); |
954 | 980 | wfProfileOut( __METHOD__ ); |
955 | | - return self::AS_RATE_LIMITED; |
| 981 | + return $status; |
956 | 982 | } |
957 | 983 | |
958 | 984 | # If the article has been deleted while editing, don't save it without |
959 | 985 | # confirmation |
960 | 986 | if ( $this->wasDeletedSinceLastEdit() && !$this->recreate ) { |
| 987 | + $status->setResult( false, self::AS_ARTICLE_WAS_DELETED ); |
961 | 988 | wfProfileOut( __METHOD__ . '-checks' ); |
962 | 989 | wfProfileOut( __METHOD__ ); |
963 | | - return self::AS_ARTICLE_WAS_DELETED; |
| 990 | + return $status; |
964 | 991 | } |
965 | 992 | |
966 | 993 | wfProfileOut( __METHOD__ . '-checks' ); |
— | — | @@ -971,34 +998,43 @@ |
972 | 999 | if ( $new ) { |
973 | 1000 | // Late check for create permission, just in case *PARANOIA* |
974 | 1001 | if ( !$this->mTitle->userCan( 'create' ) ) { |
| 1002 | + $status->fatal( 'nocreatetext' ); |
| 1003 | + $status->value = self::AS_NO_CREATE_PERMISSION; |
975 | 1004 | wfDebug( __METHOD__ . ": no create permission\n" ); |
976 | 1005 | wfProfileOut( __METHOD__ ); |
977 | | - return self::AS_NO_CREATE_PERMISSION; |
| 1006 | + return $status; |
978 | 1007 | } |
979 | 1008 | |
980 | 1009 | # Don't save a new article if it's blank. |
981 | 1010 | if ( $this->textbox1 == '' ) { |
| 1011 | + $status->setResult( false, self::AS_BLANK_ARTICLE ); |
982 | 1012 | wfProfileOut( __METHOD__ ); |
983 | | - return self::AS_BLANK_ARTICLE; |
| 1013 | + return $status; |
984 | 1014 | } |
985 | 1015 | |
986 | 1016 | // Run post-section-merge edit filter |
987 | 1017 | if ( !wfRunHooks( 'EditFilterMerged', array( $this, $this->textbox1, &$this->hookError, $this->summary ) ) ) { |
988 | 1018 | # Error messages etc. could be handled within the hook... |
| 1019 | + $status->fatal( 'hookaborted' ); |
| 1020 | + $status->value = self::AS_HOOK_ERROR; |
989 | 1021 | wfProfileOut( __METHOD__ ); |
990 | | - return self::AS_HOOK_ERROR; |
| 1022 | + return $status; |
991 | 1023 | } elseif ( $this->hookError != '' ) { |
992 | 1024 | # ...or the hook could be expecting us to produce an error |
| 1025 | + $status->fatal( 'hookaborted' ); |
| 1026 | + $status->value = self::AS_HOOK_ERROR_EXPECTED; |
993 | 1027 | wfProfileOut( __METHOD__ ); |
994 | | - return self::AS_HOOK_ERROR_EXPECTED; |
| 1028 | + return $status; |
995 | 1029 | } |
996 | 1030 | |
997 | 1031 | # Handle the user preference to force summaries here. Check if it's not a redirect. |
998 | 1032 | if ( !$this->allowBlankSummary && !Title::newFromRedirect( $this->textbox1 ) ) { |
999 | 1033 | if ( md5( $this->summary ) == $this->autoSumm ) { |
1000 | 1034 | $this->missingSummary = true; |
| 1035 | + $status->fatal( 'missingsummary' ); // or 'missingcommentheader' if $section == 'new'. Blegh |
| 1036 | + $status->value = self::AS_SUMMARY_NEEDED; |
1001 | 1037 | wfProfileOut( __METHOD__ ); |
1002 | | - return self::AS_SUMMARY_NEEDED; |
| 1038 | + return $status; |
1003 | 1039 | } |
1004 | 1040 | } |
1005 | 1041 | |
— | — | @@ -1007,7 +1043,7 @@ |
1008 | 1044 | $text = wfMsgForContent( 'newsectionheaderdefaultlevel', $this->summary ) . "\n\n" . $text; |
1009 | 1045 | } |
1010 | 1046 | |
1011 | | - $retval = self::AS_SUCCESS_NEW_ARTICLE; |
| 1047 | + $status->value = self::AS_SUCCESS_NEW_ARTICLE; |
1012 | 1048 | |
1013 | 1049 | } else { |
1014 | 1050 | |
— | — | @@ -1067,8 +1103,9 @@ |
1068 | 1104 | } |
1069 | 1105 | |
1070 | 1106 | if ( $this->isConflict ) { |
| 1107 | + $status->setResult( false, self::AS_CONFLICT_DETECTED ); |
1071 | 1108 | wfProfileOut( __METHOD__ ); |
1072 | | - return self::AS_CONFLICT_DETECTED; |
| 1109 | + return $status; |
1073 | 1110 | } |
1074 | 1111 | |
1075 | 1112 | $oldtext = $this->mArticle->getContent(); |
— | — | @@ -1076,12 +1113,16 @@ |
1077 | 1114 | // Run post-section-merge edit filter |
1078 | 1115 | if ( !wfRunHooks( 'EditFilterMerged', array( $this, $text, &$this->hookError, $this->summary ) ) ) { |
1079 | 1116 | # Error messages etc. could be handled within the hook... |
| 1117 | + $status->fatal( 'hookaborted' ); |
| 1118 | + $status->value = self::AS_HOOK_ERROR; |
1080 | 1119 | wfProfileOut( __METHOD__ ); |
1081 | | - return self::AS_HOOK_ERROR; |
| 1120 | + return $status; |
1082 | 1121 | } elseif ( $this->hookError != '' ) { |
1083 | 1122 | # ...or the hook could be expecting us to produce an error |
| 1123 | + $status->fatal( 'hookaborted' ); |
| 1124 | + $status->value = self::AS_HOOK_ERROR_EXPECTED; |
1084 | 1125 | wfProfileOut( __METHOD__ ); |
1085 | | - return self::AS_HOOK_ERROR_EXPECTED; |
| 1126 | + return $status; |
1086 | 1127 | } |
1087 | 1128 | |
1088 | 1129 | # Handle the user preference to force summaries here, but not for null edits |
— | — | @@ -1099,8 +1140,10 @@ |
1100 | 1141 | if ( $this->section == 'new' && !$this->allowBlankSummary ) { |
1101 | 1142 | if ( trim( $this->summary ) == '' ) { |
1102 | 1143 | $this->missingSummary = true; |
| 1144 | + $status->fatal( 'missingsummary' ); // or 'missingcommentheader' if $section == 'new'. Blegh |
| 1145 | + $status->value = self::AS_SUMMARY_NEEDED; |
1103 | 1146 | wfProfileOut( __METHOD__ ); |
1104 | | - return self::AS_SUMMARY_NEEDED; |
| 1147 | + return $status; |
1105 | 1148 | } |
1106 | 1149 | } |
1107 | 1150 | |
— | — | @@ -1110,9 +1153,11 @@ |
1111 | 1154 | if ( $this->section == 'new' ) { |
1112 | 1155 | if ( $this->textbox1 == '' ) { |
1113 | 1156 | $this->missingComment = true; |
| 1157 | + $status->fatal( 'missingcommenttext' ); |
| 1158 | + $status->value = self::AS_TEXTBOX_EMPTY; |
1114 | 1159 | wfProfileOut( __METHOD__ . '-sectionanchor' ); |
1115 | 1160 | wfProfileOut( __METHOD__ ); |
1116 | | - return self::AS_TEXTBOX_EMPTY; |
| 1161 | + return $status; |
1117 | 1162 | } |
1118 | 1163 | if ( $this->summary != '' ) { |
1119 | 1164 | $sectionanchor = $wgParser->guessLegacySectionNameFromWikiText( $this->summary ); |
— | — | @@ -1142,15 +1187,16 @@ |
1143 | 1188 | $this->textbox1 = $text; |
1144 | 1189 | $this->section = ''; |
1145 | 1190 | |
1146 | | - $retval = self::AS_SUCCESS_UPDATE; |
| 1191 | + $status->value = self::AS_SUCCESS_UPDATE; |
1147 | 1192 | } |
1148 | 1193 | |
1149 | 1194 | // Check for length errors again now that the section is merged in |
1150 | 1195 | $this->kblength = (int)( strlen( $text ) / 1024 ); |
1151 | 1196 | if ( $this->kblength > $wgMaxArticleSize ) { |
1152 | 1197 | $this->tooBig = true; |
| 1198 | + $status->setResult( false, self::AS_MAX_ARTICLE_SIZE_EXCEEDED ); |
1153 | 1199 | wfProfileOut( __METHOD__ ); |
1154 | | - return self::AS_MAX_ARTICLE_SIZE_EXCEEDED; |
| 1200 | + return $status; |
1155 | 1201 | } |
1156 | 1202 | |
1157 | 1203 | $flags = EDIT_DEFER_UPDATES | EDIT_AUTOSUMMARY | |
— | — | @@ -1158,17 +1204,18 @@ |
1159 | 1205 | ( ( $this->minoredit && !$this->isNew ) ? EDIT_MINOR : 0 ) | |
1160 | 1206 | ( $bot ? EDIT_FORCE_BOT : 0 ); |
1161 | 1207 | |
1162 | | - $status = $this->mArticle->doEdit( $text, $this->summary, $flags ); |
| 1208 | + $doEditStatus = $this->mArticle->doEdit( $text, $this->summary, $flags ); |
1163 | 1209 | |
1164 | | - if ( $status->isOK() ) { |
| 1210 | + if ( $doEditStatus->isOK() ) { |
1165 | 1211 | $result['redirect'] = Title::newFromRedirect( $text ) !== null; |
1166 | 1212 | $this->commitWatch(); |
1167 | 1213 | wfProfileOut( __METHOD__ ); |
1168 | | - return $retval; |
| 1214 | + return $status; |
1169 | 1215 | } else { |
1170 | 1216 | $this->isConflict = true; |
| 1217 | + $doEditStatus->value = self::AS_END; // Destroys data doEdit() put in $status->value but who cares |
1171 | 1218 | wfProfileOut( __METHOD__ ); |
1172 | | - return self::AS_END; |
| 1219 | + return $doEditStatus; |
1173 | 1220 | } |
1174 | 1221 | } |
1175 | 1222 | |
— | — | @@ -2803,13 +2850,14 @@ |
2804 | 2851 | $resultDetails = false; |
2805 | 2852 | # Allow bots to exempt some edits from bot flagging |
2806 | 2853 | $bot = $wgUser->isAllowed( 'bot' ) && $this->bot; |
2807 | | - $value = $this->internalAttemptSave( $resultDetails, $bot ); |
| 2854 | + $status = $this->internalAttemptSave( $resultDetails, $bot ); |
| 2855 | + // FIXME: once the interface for internalAttemptSave() is made nicer, this should use the message in $status |
2808 | 2856 | |
2809 | | - if ( $value == self::AS_SUCCESS_UPDATE || $value == self::AS_SUCCESS_NEW_ARTICLE ) { |
| 2857 | + if ( $status->value == self::AS_SUCCESS_UPDATE || $status->value == self::AS_SUCCESS_NEW_ARTICLE ) { |
2810 | 2858 | $this->didSave = true; |
2811 | 2859 | } |
2812 | 2860 | |
2813 | | - switch ( $value ) { |
| 2861 | + switch ( $status->value ) { |
2814 | 2862 | case self::AS_HOOK_ERROR_EXPECTED: |
2815 | 2863 | case self::AS_CONTENT_TOO_BIG: |
2816 | 2864 | case self::AS_ARTICLE_WAS_DELETED: |
Property changes on: branches/REL1_18/phase3/includes/EditPage.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
2817 | 2865 | Merged /trunk/phase3/includes/EditPage.php:r95562,95570,95597,95608,95647-95648,95674,95790,95999,96087 |
Index: branches/REL1_18/phase3/includes/api/ApiEditPage.php |
— | — | @@ -270,11 +270,11 @@ |
271 | 271 | $oldRequest = $wgRequest; |
272 | 272 | $wgRequest = $req; |
273 | 273 | |
274 | | - $retval = $ep->internalAttemptSave( $result, $wgUser->isAllowed( 'bot' ) && $params['bot'] ); |
| 274 | + $status = $ep->internalAttemptSave( $result, $wgUser->isAllowed( 'bot' ) && $params['bot'] ); |
275 | 275 | $wgRequest = $oldRequest; |
276 | 276 | global $wgMaxArticleSize; |
277 | 277 | |
278 | | - switch( $retval ) { |
| 278 | + switch( $status->value ) { |
279 | 279 | case EditPage::AS_HOOK_ERROR: |
280 | 280 | case EditPage::AS_HOOK_ERROR_EXPECTED: |
281 | 281 | $this->dieUsageMsg( 'hookaborted' ); |
— | — | @@ -353,15 +353,12 @@ |
354 | 354 | $this->dieUsageMsg( 'summaryrequired' ); |
355 | 355 | |
356 | 356 | case EditPage::AS_END: |
357 | | - // This usually means some kind of race condition |
358 | | - // or DB weirdness occurred. Fall through to throw an unknown |
359 | | - // error. |
360 | | - |
361 | | - // This needs fixing higher up, as EditPage::internalAttemptSave |
362 | | - // should return the Status object, so that specific error |
363 | | - // conditions can be returned |
| 357 | + // $status came from WikiPage::doEdit() |
| 358 | + $errors = $status->getErrorsArray(); |
| 359 | + $this->dieUsageMsg( $errors[0] ); // TODO: Add new errors to message map |
| 360 | + break; |
364 | 361 | default: |
365 | | - $this->dieUsageMsg( array( 'unknownerror', $retval ) ); |
| 362 | + $this->dieUsageMsg( array( 'unknownerror', $status->value ) ); |
366 | 363 | } |
367 | 364 | $apiResult->addValue( null, $this->getModuleName(), $r ); |
368 | 365 | } |
Index: branches/REL1_18/phase3/includes/api/ApiBase.php |
— | — | @@ -1164,6 +1164,12 @@ |
1165 | 1165 | 'emptynewsection' => array( 'code' => 'emptynewsection', 'info' => 'Creating empty new sections is not possible.' ), |
1166 | 1166 | 'revwrongpage' => array( 'code' => 'revwrongpage', 'info' => "r\$1 is not a revision of ``\$2''" ), |
1167 | 1167 | 'undo-failure' => array( 'code' => 'undofailure', 'info' => 'Undo failed due to conflicting intermediate edits' ), |
| 1168 | + |
| 1169 | + // Messages from WikiPage::doEit() |
| 1170 | + 'edit-hook-aborted' => array( 'code' => 'edit-hook-aborted', 'info' => "Your edit was aborted by an ArticleSave hook" ), |
| 1171 | + 'edit-gone-missing' => array( 'code' => 'edit-gone-missing', 'info' => "The page you tried to edit doesn't seem to exist anymore" ), |
| 1172 | + 'edit-conflict' => array( 'code' => 'editconflict', 'info' => "Edit conflict detected" ), |
| 1173 | + 'edit-already-exists' => array( 'code' => 'edit-already-exists', 'info' => "It seems the page you tried to create already exist" ), |
1168 | 1174 | |
1169 | 1175 | // uploadMsgs |
1170 | 1176 | 'invalid-session-key' => array( 'code' => 'invalid-session-key', 'info' => 'Not a valid session key' ), |
Index: branches/REL1_18/phase3/includes/specials/SpecialEditWatchlist.php |
— | — | @@ -150,7 +150,7 @@ |
151 | 151 | } |
152 | 152 | } else { |
153 | 153 | $this->clearWatchlist(); |
154 | | - $this->getLang()->invalidateCache(); |
| 154 | + $this->getUser()->invalidateCache(); |
155 | 155 | $this->successMessage .= wfMessage( |
156 | 156 | 'watchlistedit-raw-removed', |
157 | 157 | $this->getLang()->formatNum( count( $current ) ) |
Index: branches/REL1_18/phase3/includes/specials/SpecialContributions.php |
— | — | @@ -172,7 +172,8 @@ |
173 | 173 | $wgOut->addWikiMsg( 'nocontribs', $target ); |
174 | 174 | } else { |
175 | 175 | # Show a message about slave lag, if applicable |
176 | | - if( ( $lag = $pager->getDatabase()->getLag() ) > 0 ) |
| 176 | + $lag = wfGetLB()->safeGetLag( $pager->getDatabase() ); |
| 177 | + if( $lag > 0 ) |
177 | 178 | $wgOut->showLagWarning( $lag ); |
178 | 179 | |
179 | 180 | $wgOut->addHTML( |
Index: branches/REL1_18/phase3/includes/specials/SpecialDeletedContributions.php |
— | — | @@ -326,7 +326,8 @@ |
327 | 327 | } |
328 | 328 | |
329 | 329 | # Show a message about slave lag, if applicable |
330 | | - if( ( $lag = $pager->getDatabase()->getLag() ) > 0 ) |
| 330 | + $lag = wfGetLB()->safeGetLag( $pager->getDatabase() ); |
| 331 | + if( $lag > 0 ) |
331 | 332 | $wgOut->showLagWarning( $lag ); |
332 | 333 | |
333 | 334 | $wgOut->addHTML( |
Index: branches/REL1_18/phase3/includes/specials/SpecialWatchlist.php |
— | — | @@ -240,7 +240,7 @@ |
241 | 241 | } |
242 | 242 | |
243 | 243 | # Show a message about slave lag, if applicable |
244 | | - $lag = $dbr->getLag(); |
| 244 | + $lag = wfGetLB()->safeGetLag( $dbr ); |
245 | 245 | if( $lag > 0 ) { |
246 | 246 | $output->showLagWarning( $lag ); |
247 | 247 | } |
Index: branches/REL1_18/phase3/languages/messages/MessagesEn.php |
— | — | @@ -1965,7 +1965,6 @@ |
1966 | 1966 | 'right-userrights' => 'Edit all user rights', |
1967 | 1967 | 'right-userrights-interwiki' => 'Edit user rights of users on other wikis', |
1968 | 1968 | 'right-siteadmin' => 'Lock and unlock the database', |
1969 | | -'right-reset-passwords' => "Reset other users' passwords", |
1970 | 1969 | 'right-override-export-depth' => 'Export pages including linked pages up to a depth of 5', |
1971 | 1970 | 'right-sendemail' => 'Send e-mail to other users', |
1972 | 1971 | |
Index: branches/REL1_18/phase3/resources/mediawiki/mediawiki.js |
— | — | @@ -144,7 +144,11 @@ |
145 | 145 | */ |
146 | 146 | Message.prototype.toString = function() { |
147 | 147 | if ( !this.map.exists( this.key ) ) { |
148 | | - // Return <key> if key does not exist |
| 148 | + // Use <key> as text if key does not exist |
| 149 | + if ( this.format !== 'plain' ) { |
| 150 | + // format 'escape' and 'parse' need to have the brackets and key html escaped |
| 151 | + return mw.html.escape( '<' + this.key + '>' ); |
| 152 | + } |
149 | 153 | return '<' + this.key + '>'; |
150 | 154 | } |
151 | 155 | var text = this.map.get( this.key ); |