Index: branches/REL1_18/extensions/OAI/OAIRepo_body.php |
— | — | @@ -875,7 +875,12 @@ |
876 | 876 | array( 'img_name' => $this->_row->page_title ), |
877 | 877 | $fname ); |
878 | 878 | if( $imageRow ) { |
879 | | - $url = wfFindFile( $imageRow->img_name )->getUrl(); |
| 879 | + $file = wfFindFile( $imageRow->img_name ); |
| 880 | + if ( !$file ) { |
| 881 | + wfDebug( 'Invalid image row retrieved. Image name: ' . $imageRow->img_name ); |
| 882 | + return ''; |
| 883 | + } |
| 884 | + $url = $file->getUrl(); |
880 | 885 | |
881 | 886 | if( $url{0} == '/' ) { |
882 | 887 | global $wgServer; |
— | — | @@ -904,8 +909,6 @@ |
905 | 910 | } |
906 | 911 | return '<contributor>' . $tag . '</contributor>'; |
907 | 912 | } |
908 | | - |
909 | | - |
910 | 913 | } |
911 | 914 | |
912 | 915 | /** For the very first page output siteinfo, else same sa XmlDumpWriter */ |
Property changes on: branches/REL1_18/extensions/OAI |
___________________________________________________________________ |
Added: svn:mergeinfo |
913 | 916 | Merged /trunk/extensions/OAI:r95169 |
Index: branches/REL1_18/extensions/ArticleFeedback/populateAFRevisions.php |
— | — | @@ -40,12 +40,11 @@ |
41 | 41 | |
42 | 42 | $lastRevID = 0; |
43 | 43 | $i = 0; |
44 | | - $dbr = wfGetDB( DB_SLAVE ); |
45 | 44 | $dbw = wfGetDB( DB_MASTER ); |
46 | 45 | $this->output( "Reading data from article_feedback ...\n" ); |
47 | 46 | while ( true ) { |
48 | 47 | // Get the next revision ID |
49 | | - $row = $dbr->selectRow( 'article_feedback', array( 'aa_revision', 'aa_page_id' ), |
| 48 | + $row = $dbw->selectRow( 'article_feedback', array( 'aa_revision', 'aa_page_id' ), |
50 | 49 | "aa_revision > $lastRevID", __METHOD__, |
51 | 50 | array( 'ORDER BY' => 'aa_revision', 'LIMIT' => 1 ) |
52 | 51 | ); |
— | — | @@ -57,7 +56,7 @@ |
58 | 57 | $pageid = intval( $row->aa_page_id ); |
59 | 58 | |
60 | 59 | // Get all article_feedback rows for this revision |
61 | | - $res = $dbr->select( 'article_feedback', |
| 60 | + $res = $dbw->select( 'article_feedback', |
62 | 61 | array( 'aa_rating_id', 'aa_rating_value', 'aa_user_id', 'aa_user_anon_token' ), |
63 | 62 | array( 'aa_revision' => $revid ), |
64 | 63 | __METHOD__ |
Index: branches/REL1_18/extensions/ArticleFeedback/api/ApiArticleFeedback.php |
— | — | @@ -37,11 +37,12 @@ |
38 | 38 | $this->dieUsage( 'ArticleFeedback is not enabled on this page', 'invalidpage' ); |
39 | 39 | } |
40 | 40 | |
41 | | - $dbr = wfGetDB( DB_SLAVE ); |
| 41 | + $dbw = wfGetDB( DB_MASTER ); |
42 | 42 | |
43 | 43 | // Query the latest ratings by this user for this page, |
44 | 44 | // possibly for an older revision |
45 | | - $res = $dbr->select( |
| 45 | + // Select from the master to prevent replag-induced bugs |
| 46 | + $res = $dbw->select( |
46 | 47 | 'article_feedback', |
47 | 48 | array( 'aa_rating_id', 'aa_rating_value', 'aa_revision' ), |
48 | 49 | array( |
— | — | @@ -454,4 +455,4 @@ |
455 | 456 | public function getVersion() { |
456 | 457 | return __CLASS__ . ': $Id$'; |
457 | 458 | } |
458 | | -} |
\ No newline at end of file |
| 459 | +} |
Property changes on: branches/REL1_18/extensions/ArticleFeedback/api/ApiArticleFeedback.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
459 | 460 | Merged /trunk/extensions/ArticleFeedback/api/ApiArticleFeedback.php:r94404,94509 |
Property changes on: branches/REL1_18/extensions/ArticleFeedback/api/ApiQueryArticleFeedback.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
460 | 461 | Merged /trunk/extensions/ArticleFeedback/api/ApiQueryArticleFeedback.php:r94404,94509 |
Property changes on: branches/REL1_18/extensions/ArticleFeedback |
___________________________________________________________________ |
Added: svn:mergeinfo |
461 | 462 | Merged /trunk/extensions/ArticleFeedback:r94404,94509 |
Property changes on: branches/REL1_18/extensions/UploadWizard/resources/mw.LanguageUpWiz.js |
___________________________________________________________________ |
Modified: svn:mergeinfo |
462 | 463 | Merged /trunk/extensions/UploadWizard/resources/mw.LanguageUpWiz.js:r93384,95412 |
Index: branches/REL1_18/extensions/UploadWizard/resources/mw.UploadWizardDetails.js |
— | — | @@ -485,9 +485,8 @@ |
486 | 486 | $j.each( [ 'datetimeoriginal', 'datetimedigitized', 'datetime', 'date' ], function( i, propName ) { |
487 | 487 | var dateInfo = metadata[propName]; |
488 | 488 | if ( ! mw.isEmpty( dateInfo ) ) { |
489 | | - var matches = $j.trim( dateInfo ).match( yyyyMmDdRegex ); |
490 | | - // EXIF was founded in 1995, so anything before that is very unlikely |
491 | | - if ( ! mw.isEmpty( matches ) && parseInt( matches[1], 10 ) > 1994) { |
| 489 | + var matches = $j.trim( dateInfo ).match( yyyyMmDdRegex ); |
| 490 | + if ( ! mw.isEmpty( matches ) ) { |
492 | 491 | dateObj = new Date( parseInt( matches[1], 10 ), |
493 | 492 | parseInt( matches[2], 10 ) - 1, |
494 | 493 | parseInt( matches[3], 10 ) ); |
Property changes on: branches/REL1_18/extensions/UploadWizard |
___________________________________________________________________ |
Modified: svn:mergeinfo |
495 | 494 | Merged /trunk/extensions/UploadWizard:r93384,95412 |
Index: branches/REL1_18/extensions/GoogleNewsSitemap/GoogleNewsSitemap_body.php |
— | — | @@ -56,16 +56,17 @@ |
57 | 57 | |
58 | 58 | // Check to make sure that feed type is supported. |
59 | 59 | if ( FeedUtils::checkFeedOutput( $params['feed'] ) ) { |
60 | | - |
61 | | - if ( !wfEmptyMsg( 'feed-' . $params['feed'] ) ) { |
| 60 | + $msg = wfMessage( 'feed-' . $params['feed'] )->inContentLanguage(); |
| 61 | + if ( $msg->exists() ) { |
62 | 62 | // This seems a little icky since |
63 | 63 | // its re-using another message in a |
64 | 64 | // different context. |
65 | 65 | // uses feed-rss and feed-atom messages. |
66 | | - $feedType = wfMsgForContent( 'feed-' . $params['feed'] ); |
| 66 | + $feedType = $msg->text(); |
67 | 67 | } else { |
68 | 68 | $feedType = $wgContLang->uc( $params['feed'] ); |
69 | 69 | } |
| 70 | + |
70 | 71 | $feed = new $wgFeedClasses[ $params['feed'] ]( |
71 | 72 | wfMsgExt( 'googlenewssitemap_feedtitle', |
72 | 73 | array( 'parsemag', 'content' ), |
Property changes on: branches/REL1_18/extensions/GoogleNewsSitemap |
___________________________________________________________________ |
Added: svn:mergeinfo |
73 | 74 | Merged /trunk/extensions/GoogleNewsSitemap:r95178,95342 |
Index: branches/REL1_18/extensions/SiteMatrix/SiteMatrixApi.php |
— | — | @@ -57,7 +57,7 @@ |
58 | 58 | |
59 | 59 | $url = $matrix->getUrl( $lang, $site ); |
60 | 60 | $site_out = array( |
61 | | - 'url' => $url, |
| 61 | + 'url' => wfExpandUrl( $url ), |
62 | 62 | 'dbname' => $matrix->getDBName( $lang, $site ), |
63 | 63 | 'code' => $site, |
64 | 64 | ); |
— | — | @@ -91,7 +91,7 @@ |
92 | 92 | $url = $matrix->getUrl( $lang, $site ); |
93 | 93 | |
94 | 94 | $wiki = array(); |
95 | | - $wiki['url'] = $url; |
| 95 | + $wiki['url'] = wfExpandUrl( $url ); |
96 | 96 | $wiki['dbname'] = $matrix->getDBName( $lang, $site ); |
97 | 97 | $wiki['code'] = str_replace( '_', '-', $lang ) . ( $site != 'wiki' ? $site : '' ); |
98 | 98 | |
Property changes on: branches/REL1_18/extensions/SiteMatrix |
___________________________________________________________________ |
Added: svn:mergeinfo |
99 | 99 | Merged /trunk/extensions/SiteMatrix:r94369 |
Index: branches/REL1_18/extensions/CentralAuth/ApiQueryGlobalUserInfo.php |
— | — | @@ -82,7 +82,7 @@ |
83 | 83 | |
84 | 84 | $a = array( |
85 | 85 | 'wiki' => $dbname, |
86 | | - 'url' => $this->getUrl( $dbname ), |
| 86 | + 'url' => wfExpandUrl( $this->getUrl( $dbname ) ), |
87 | 87 | 'timestamp' => wfTimestamp( TS_ISO_8601, $account['attachedTimestamp'] ), |
88 | 88 | 'method' => $account['attachedMethod'], |
89 | 89 | 'editcount' => $account['editCount'] |
Property changes on: branches/REL1_18/extensions/CentralAuth/specials/SpecialWikiSets.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
90 | 90 | Merged /trunk/extensions/CentralAuth/specials/SpecialWikiSets.php:r94371 |
Property changes on: branches/REL1_18/extensions/CentralAuth |
___________________________________________________________________ |
Added: svn:mergeinfo |
91 | 91 | Merged /trunk/extensions/CentralAuth:r94371 |
Index: branches/REL1_18/extensions/FlaggedRevs/maintenance/populateRevTimestamp.php |
— | — | @@ -19,7 +19,7 @@ |
20 | 20 | php populateRevTimestamp.php [--startrev <ID>] |
21 | 21 | |
22 | 22 | --help : This help message |
23 | | - --<ID> : The ID of the starting rev |
| 23 | + --<ID> : The ID of the starting rev or 'prev' (from last run) |
24 | 24 | |
25 | 25 | TEXT; |
26 | 26 | exit(0); |
— | — | @@ -27,7 +27,13 @@ |
28 | 28 | |
29 | 29 | error_reporting( E_ALL ); |
30 | 30 | |
31 | | -$startRev = isset( $options['startrev'] ) ? |
32 | | - (int)$options['startrev'] : null; |
| 31 | +$startRev = null; |
| 32 | +if ( isset( $options['startrev'] ) ) { |
| 33 | + if ( $options['startrev'] === 'prev' ) { |
| 34 | + $startRev = (int)file_get_contents( last_pos_file() ); |
| 35 | + } else { |
| 36 | + $startRev = (int)$options['startrev']; |
| 37 | + } |
| 38 | +} |
33 | 39 | |
34 | 40 | populate_fr_rev_timestamp( $startRev ); |
Index: branches/REL1_18/extensions/FlaggedRevs/maintenance/populateRevTimestamp.inc |
— | — | @@ -1,12 +1,12 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | 4 | function populate_fr_rev_timestamp( $start = null ) { |
5 | | - echo "Populating and correcting flaggedrevs columns\n"; |
6 | | - |
| 5 | + echo "Populating and correcting flaggedrevs columns from $start\n"; |
| 6 | + |
7 | 7 | $BATCH_SIZE = 1000; |
8 | | - |
| 8 | + |
9 | 9 | $db = wfGetDB( DB_MASTER ); |
10 | | - |
| 10 | + |
11 | 11 | if ( $start === null ) { |
12 | 12 | $start = $db->selectField( 'flaggedrevs', 'MIN(fr_rev_id)', false, __FUNCTION__ ); |
13 | 13 | } |
— | — | @@ -26,7 +26,7 @@ |
27 | 27 | $cond = "fr_rev_id BETWEEN $blockStart AND $blockEnd AND fr_rev_timestamp = ''"; |
28 | 28 | $res = $db->select( |
29 | 29 | array( 'flaggedrevs', 'revision', 'archive' ), |
30 | | - array( 'fr_rev_id', 'rev_timestamp', 'ar_timestamp' ), |
| 30 | + array( 'fr_rev_id', 'rev_timestamp', 'ar_timestamp' ), |
31 | 31 | $cond, |
32 | 32 | __FUNCTION__, |
33 | 33 | array(), |
— | — | @@ -59,5 +59,10 @@ |
60 | 60 | $blockEnd += $BATCH_SIZE; |
61 | 61 | wfWaitForSlaves( 5 ); |
62 | 62 | } |
| 63 | + file_put_contents( last_pos_file(), $end ); |
63 | 64 | echo "fr_rev_timestamp columns update complete ... {$count} rows [{$changed} changed]\n"; |
64 | 65 | } |
| 66 | + |
| 67 | +function last_pos_file() { |
| 68 | + return dirname( __FILE__ ) . "/popRevTimestampLast-" . wfWikiID(); |
| 69 | +} |
Property changes on: branches/REL1_18/extensions/FlaggedRevs |
___________________________________________________________________ |
Modified: svn:mergeinfo |
65 | 70 | Merged /trunk/extensions/FlaggedRevs:r93036 |
Index: branches/REL1_18/extensions/Collection/Collection.body.php |
— | — | @@ -944,11 +944,7 @@ |
945 | 945 | } |
946 | 946 | |
947 | 947 | function renderCollection( $collection, $referrer, $writer ) { |
948 | | - global $wgOut; |
949 | | - global $wgContLang; |
950 | | - global $wgServer; |
951 | | - global $wgScriptPath; |
952 | | - global $wgScriptExtension; |
| 948 | + global $wgOut, $wgContLang, $wgScriptPath, $wgScriptExtension; |
953 | 949 | |
954 | 950 | if ( !$writer ) { |
955 | 951 | $writer = 'rl'; |
— | — | @@ -956,7 +952,7 @@ |
957 | 953 | |
958 | 954 | $response = self::mwServeCommand( 'render', array( |
959 | 955 | 'metabook' => $this->buildJSONCollection( $collection ), |
960 | | - 'base_url' => $wgServer . $wgScriptPath, |
| 956 | + 'base_url' => wfExpandUrl( $wgScriptPath ), |
961 | 957 | 'script_extension' => $wgScriptExtension, |
962 | 958 | 'template_blacklist' => wfMsgForContent( 'coll-template_blacklist_title' ), |
963 | 959 | 'template_exclusion_category' => wfMsgForContent( 'coll-exclusion_category_title' ), |
— | — | @@ -982,19 +978,14 @@ |
983 | 979 | } |
984 | 980 | |
985 | 981 | function forceRenderCollection() { |
986 | | - global $wgOut; |
987 | | - global $wgContLang; |
988 | | - global $wgRequest; |
989 | | - global $wgServer; |
990 | | - global $wgScriptPath; |
991 | | - global $wgScriptExtension; |
| 982 | + global $wgOut, $wgContLang, $wgRequest, $wgScriptPath, $wgScriptExtension; |
992 | 983 | |
993 | 984 | $collectionID = $wgRequest->getVal( 'collection_id', '' ); |
994 | 985 | $writer = $wgRequest->getVal( 'writer', 'rl' ); |
995 | 986 | |
996 | 987 | $response = self::mwServeCommand( 'render', array( |
997 | 988 | 'collection_id' => $collectionID, |
998 | | - 'base_url' => $wgServer . $wgScriptPath, |
| 989 | + 'base_url' => wfExpandUrl( $wgScriptPath ), |
999 | 990 | 'script_extension' => $wgScriptExtension, |
1000 | 991 | 'template_blacklist' => wfMsgForContent( 'coll-template_blacklist_title' ), |
1001 | 992 | 'template_exclusion_category' => wfMsgForContent( 'coll-exclusion_category_title' ), |
— | — | @@ -1020,13 +1011,7 @@ |
1021 | 1012 | } |
1022 | 1013 | |
1023 | 1014 | function renderRenderingPage() { |
1024 | | - global $wgCollectionVersion; |
1025 | | - global $wgJsMimeType; |
1026 | | - global $wgLang; |
1027 | | - global $wgOut; |
1028 | | - global $wgRequest; |
1029 | | - global $wgScriptPath; |
1030 | | - global $wgServer; |
| 1015 | + global $wgCollectionVersion, $wgJsMimeType, $wgLang, $wgOut, $wgRequest, $wgScriptPath; |
1031 | 1016 | |
1032 | 1017 | $response = self::mwServeCommand( 'render_status', array( |
1033 | 1018 | 'collection_id' => $wgRequest->getVal( 'collection_id' ), |
— | — | @@ -1075,7 +1060,7 @@ |
1076 | 1061 | $wgOut->setPageTitle( wfMsg( 'coll-rendering_finished_title' ) ); |
1077 | 1062 | |
1078 | 1063 | $template = new CollectionFinishedTemplate(); |
1079 | | - $template->set( 'download_url', $wgServer . SkinTemplate::makeSpecialUrl( 'Book', 'bookcmd=download&' . $query ) ); |
| 1064 | + $template->set( 'download_url', wfExpandUrl( SkinTemplate::makeSpecialUrl( 'Book', 'bookcmd=download&' . $query ) ) ); |
1080 | 1065 | $template->set( 'is_cached', $wgRequest->getVal( 'is_cached' ) ); |
1081 | 1066 | $template->set( 'query', $query ); |
1082 | 1067 | $template->set( 'return_to', $return_to ); |
— | — | @@ -1156,10 +1141,7 @@ |
1157 | 1142 | } |
1158 | 1143 | |
1159 | 1144 | function postZIP( $collection, $partner ) { |
1160 | | - global $wgServer; |
1161 | | - global $wgScriptPath; |
1162 | | - global $wgScriptExtension; |
1163 | | - global $wgOut; |
| 1145 | + global $wgScriptPath, $wgScriptExtension, $wgOut; |
1164 | 1146 | |
1165 | 1147 | if ( !isset( $this->mPODPartners[$partner] ) ) { |
1166 | 1148 | $wgOut->showErrorPage( 'coll-invalid_podpartner_title', 'coll-invalid_podpartner_msg' ); |
— | — | @@ -1168,7 +1150,7 @@ |
1169 | 1151 | |
1170 | 1152 | $response = self::mwServeCommand( 'zip_post', array( |
1171 | 1153 | 'metabook' => $this->buildJSONCollection( $collection ), |
1172 | | - 'base_url' => $wgServer . $wgScriptPath, |
| 1154 | + 'base_url' => wfExpandUrl( $wgScriptPath ), |
1173 | 1155 | 'script_extension' => $wgScriptExtension, |
1174 | 1156 | 'template_blacklist' => wfMsgForContent( 'coll-template_blacklist_title' ), |
1175 | 1157 | 'template_exclusion_category' => wfMsgForContent( 'coll-exclusion_category_title' ), |
Index: branches/REL1_18/extensions/Collection/Collection.templates.php |
— | — | @@ -444,11 +444,10 @@ |
445 | 445 | |
446 | 446 | // needed for Ajax functions |
447 | 447 | function getProposalList () { |
448 | | - global $wgServer; |
449 | | - global $wgScript; |
| 448 | + global $wgScript, $wgScriptPath; |
450 | 449 | |
451 | | - $mediapath = $GLOBALS['wgScriptPath'] . '/extensions/Collection/images/'; |
452 | | - $baseUrl = $wgServer . $wgScript . "/"; |
| 450 | + $mediapath = $wgScriptPath . '/extensions/Collection/images/'; |
| 451 | + $baseUrl = $wgScript . "/"; |
453 | 452 | |
454 | 453 | $prop = $this->data['proposals']; |
455 | 454 | $out = ''; |
Property changes on: branches/REL1_18/extensions/Collection |
___________________________________________________________________ |
Added: svn:mergeinfo |
456 | 455 | Merged /trunk/extensions/Collection:r94376 |
Index: branches/REL1_18/extensions/WikiEditor/modules/jquery.wikiEditor.dialogs.js |
— | — | @@ -86,10 +86,12 @@ |
87 | 87 | } |
88 | 88 | // If the dialog already exists, but for another textarea, simply remove it |
89 | 89 | var $existingDialog = $( '#' + module.id ); |
90 | | - if ( $existingDialog.size() > 0 && $existingDialog.data( 'context' ).$textarea != context.$textarea ) { |
| 90 | + if ( $existingDialog.length > 0 && $existingDialog.data( 'context' ).$textarea != context.$textarea ) { |
91 | 91 | $existingDialog.remove(); |
92 | 92 | } |
93 | | - if ( !filtered && $.wikiEditor.isSupported( module ) && $existingDialog.size() == 0 ) { |
| 93 | + // Re-select from the DOM, we might have removed the dialog just now |
| 94 | + $existingDialog = $( '#' + module.id ); |
| 95 | + if ( !filtered && $.wikiEditor.isSupported( module ) && $existingDialog.size() === 0 ) { |
94 | 96 | $.wikiEditor.modules.dialogs.modules[mod] = module; |
95 | 97 | // If this dialog requires the iframe, set it up |
96 | 98 | if ( typeof context.$iframe == 'undefined' && $.wikiEditor.isRequired( module, 'iframe' ) ) { |
Property changes on: branches/REL1_18/extensions/WikiEditor |
___________________________________________________________________ |
Added: svn:mergeinfo |
97 | 99 | Merged /trunk/extensions/WikiEditor:r95079 |
Index: branches/REL1_18/extensions/ParserFunctions/ParserFunctions_body.php |
— | — | @@ -505,10 +505,12 @@ |
506 | 506 | return '<strong class="error">' . wfMsgForContent( 'pfunc_time_too_long' ) . '</strong>'; |
507 | 507 | } else { |
508 | 508 | if ( $ts < 100000000000000 ) { // Language can't deal with years after 9999 |
509 | | - if ( $language !== '' ) { // use whatever language is passed as a parameter |
| 509 | + if ( Language::isValidBuiltInCode( $language ) ) { |
| 510 | + // use whatever language is passed as a parameter |
510 | 511 | $langObject = Language::factory( $language ); |
511 | 512 | $result = $langObject->sprintfDate( $format, $ts ); |
512 | | - } else { // use wiki's content language |
| 513 | + } else { |
| 514 | + // use wiki's content language |
513 | 515 | $result = $parser->getFunctionLang()->sprintfDate( $format, $ts ); |
514 | 516 | } |
515 | 517 | } else { |
Property changes on: branches/REL1_18/extensions/ParserFunctions |
___________________________________________________________________ |
Added: svn:mergeinfo |
516 | 518 | Merged /trunk/extensions/ParserFunctions:r92571-92572 |