Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php |
— | — | @@ -155,12 +155,13 @@ |
156 | 156 | public static function expandText( $text, $title ) { |
157 | 157 | global $wgParser, $wgTitle; |
158 | 158 | |
159 | | - if ( $text==false ) return; |
| 159 | + if ( !$text ) return ''; |
160 | 160 | |
161 | 161 | $options = new ParserOptions; |
162 | 162 | $options->setRemoveComments( true ); |
163 | 163 | $options->setMaxIncludeSize( self::MAX_INCLUDE_SIZE ); |
164 | 164 | $output = $wgParser->preprocess( $text, $title, $options ); |
| 165 | + |
165 | 166 | return $output; |
166 | 167 | } |
167 | 168 | |
— | — | @@ -275,52 +276,17 @@ |
276 | 277 | wfProfileIn( __METHOD__ ); |
277 | 278 | |
278 | 279 | $db = wfGetDB( DB_SLAVE ); |
279 | | - $result = $db->select( |
280 | | - array('revision'), |
281 | | - array('rev_id'), |
| 280 | + $count = $db->selectField('revision', |
| 281 | + 'COUNT(*)', |
282 | 282 | array('rev_page' => $page_id, "rev_id > $from_rev"), |
283 | 283 | __METHOD__ ); |
284 | | - // Return count of revisions |
285 | | - return $db->numRows($result); |
| 284 | + |
| 285 | + return $count; |
286 | 286 | } |
287 | | - |
288 | | - /** |
289 | | - * @param int $rev_id |
290 | | - * Return an array output of the flags for a given revision |
291 | | - */ |
292 | | - public function getFlagsForRevision( $rev_id ) { |
293 | | - global $wgFlaggedRevTags; |
294 | | - |
295 | | - wfProfileIn( __METHOD__ ); |
296 | | - // Cached results? |
297 | | - if ( isset($this->flags[$rev_id]) && $this->flags[$rev_id] ) |
298 | | - return $this->revflags[$rev_id]; |
299 | | - // Set all flags to zero |
300 | | - $flags = array(); |
301 | | - foreach( array_keys($wgFlaggedRevTags) as $tag ) { |
302 | | - $flags[$tag] = 0; |
303 | | - } |
304 | | - $db = wfGetDB( DB_SLAVE ); |
305 | | - // Grab all the tags for this revision |
306 | | - $result = $db->select( |
307 | | - array('flaggedrevtags'), |
308 | | - array('frt_dimension', 'frt_value'), |
309 | | - array('frt_rev_id' => $rev_id), |
310 | | - __METHOD__ ); |
311 | | - // Iterate through each tag result |
312 | | - while ( $row = $db->fetchObject($result) ) { |
313 | | - $flags[$row->frt_dimension] = $row->frt_value; |
314 | | - } |
315 | | - // Try to cache results |
316 | | - $this->flags[$rev_id] = true; |
317 | | - $this->revflags[$rev_id] = $flags; |
318 | | - |
319 | | - return $flags; |
320 | | - } |
321 | 287 | |
322 | 288 | /** |
323 | 289 | * static counterpart for getOverridingRev() |
324 | | - */ |
| 290 | + */ |
325 | 291 | public static function getOverridingPageRev( $article ) { |
326 | 292 | if ( !is_object($article) ) |
327 | 293 | return null; |
— | — | @@ -351,6 +317,33 @@ |
352 | 318 | return $row; |
353 | 319 | } |
354 | 320 | |
| 321 | + /** |
| 322 | + * static counterpart for getFlagsForRevision() |
| 323 | + */ |
| 324 | + public static function getFlagsForPageRev( $rev_id ) { |
| 325 | + global $wgFlaggedRevTags; |
| 326 | + |
| 327 | + wfProfileIn( __METHOD__ ); |
| 328 | + // Set all flags to zero |
| 329 | + $flags = array(); |
| 330 | + foreach( array_keys($wgFlaggedRevTags) as $tag ) { |
| 331 | + $flags[$tag] = 0; |
| 332 | + } |
| 333 | + $db = wfGetDB( DB_SLAVE ); |
| 334 | + // Grab all the tags for this revision |
| 335 | + $result = $db->select( |
| 336 | + array('flaggedrevtags'), |
| 337 | + array('frt_dimension', 'frt_value'), |
| 338 | + array('frt_rev_id' => $rev_id), |
| 339 | + __METHOD__ ); |
| 340 | + // Iterate through each tag result |
| 341 | + while ( $row = $db->fetchObject($result) ) { |
| 342 | + $flags[$row->frt_dimension] = $row->frt_value; |
| 343 | + } |
| 344 | + |
| 345 | + return $flags; |
| 346 | + } |
| 347 | + |
355 | 348 | public function addTagRatings( $flags ) { |
356 | 349 | global $wgFlaggedRevTags; |
357 | 350 | $tag = "<p>"; |
— | — | @@ -518,24 +511,24 @@ |
519 | 512 | __METHOD__ ); |
520 | 513 | } |
521 | 514 | |
522 | | - function extraLinksUpdate( &$article ) { |
| 515 | + public static function extraLinksUpdate( &$article ) { |
523 | 516 | $fname = 'FlaggedRevs::extraLinksUpdate'; |
524 | 517 | wfProfileIn( $fname ); |
525 | 518 | # Check if this page has a stable version |
526 | | - $sv = $this->getOverridingPageRev( $article ); |
| 519 | + $sv = self::getOverridingPageRev( $article ); |
527 | 520 | if ( !$sv ) return; |
528 | 521 | # Retrieve the text |
529 | | - $text = $this->getFlaggedRevText( $sv->fr_rev_id ); |
| 522 | + $text = self::getFlaggedRevText( $sv->fr_rev_id ); |
530 | 523 | # Parse the revision |
531 | 524 | $options = ParserOptions::newFromUser($wgUser); |
532 | | - $poutput = $this->parseStableText( $article->mTitle, $text, $sv->fr_rev_id, $options, $sv->fr_timestamp ); |
533 | | - |
| 525 | + $poutput = self::parseStableText( $article->mTitle, $text, $sv->fr_rev_id, $options, $sv->fr_timestamp ); |
| 526 | + |
534 | 527 | # Update the links tables to include these |
535 | 528 | # We want the UNION of links between the current |
536 | 529 | # and stable version. Therefore, we only care about |
537 | 530 | # links that are in the stable version and not the regular one. |
538 | 531 | $u = new LinksUpdate( $article->mTitle, $poutput ); |
539 | | - |
| 532 | + |
540 | 533 | # Page links |
541 | 534 | $existing = $u->getExistingLinks(); |
542 | 535 | $u->incrTableUpdate( 'pagelinks', 'pl', array(), |
— | — | @@ -579,9 +572,8 @@ |
580 | 573 | if ( $u->mRecursive ) { |
581 | 574 | $u->queueRecursiveJobs(); |
582 | 575 | } |
583 | | - |
| 576 | + |
584 | 577 | wfProfileOut( $fname ); |
585 | | - |
586 | 578 | } |
587 | 579 | |
588 | 580 | /** |
— | — | @@ -643,7 +635,7 @@ |
644 | 636 | return; |
645 | 637 | // Grab page and rev ids |
646 | 638 | $pageid = $article->getId(); |
647 | | - $revid = ( $article->mRevision ) ? $article->mRevision->mId : $article->getLatest(); |
| 639 | + $revid = $article->mRevision ? $article->mRevision->mId : $article->getLatest(); |
648 | 640 | // There must be a valid rev ID |
649 | 641 | if( !$revid ) return; |
650 | 642 | |
— | — | @@ -661,7 +653,7 @@ |
662 | 654 | } else if( !is_null($tfrev) ) { |
663 | 655 | global $wgParser, $wgLang; |
664 | 656 | // Get flags and date |
665 | | - $flags = parent::getFlagsForRevision( $tfrev->fr_rev_id ); |
| 657 | + $flags = $this->getFlagsForRevision( $tfrev->fr_rev_id ); |
666 | 658 | $time = $wgLang->timeanddate( wfTimestamp(TS_MW, $tfrev->fr_timestamp), true ); |
667 | 659 | // Looking at some specific old rev or if flagged revs override only for anons |
668 | 660 | if( !$this->pageOverride() ) { |
— | — | @@ -673,7 +665,7 @@ |
674 | 666 | $oldid = ($revid > $tfrev->fr_rev_id) ? $tfrev->fr_rev_id : $revid; |
675 | 667 | $diff = ($revid > $tfrev->fr_rev_id) ? $revid : $tfrev->fr_rev_id; |
676 | 668 | # Is this revision flagged? |
677 | | - $flags2 = parent::getFlagsForRevision( $revid ); |
| 669 | + $flags2 = $this->getFlagsForRevision( $revid ); |
678 | 670 | $app = false; |
679 | 671 | foreach ( $flags2 as $f => $v ) { |
680 | 672 | if ( $v > 0 ) $app=true; |
— | — | @@ -756,7 +748,7 @@ |
757 | 749 | if( is_object($tfrev) ) { |
758 | 750 | global $wgParser, $wgLang; |
759 | 751 | $time = $wgLang->timeanddate( wfTimestamp(TS_MW, $tfrev->fr_timestamp), true ); |
760 | | - $flags = parent::getFlagsForRevision( $tfrev->fr_rev_id ); |
| 752 | + $flags = $this->getFlagsForRevision( $tfrev->fr_rev_id ); |
761 | 753 | # Looking at some specific old rev |
762 | 754 | if( $wgRequest->getVal('oldid') ) { |
763 | 755 | if( $revid==$tfrev->fr_rev_id ) { |
— | — | @@ -766,7 +758,7 @@ |
767 | 759 | $oldid = ($revid > $tfrev->fr_rev_id) ? $tfrev->fr_rev_id : $revid; |
768 | 760 | $diff = ($revid > $tfrev->fr_rev_id) ? $revid : $tfrev->fr_rev_id; |
769 | 761 | # Is this revision flagged? |
770 | | - $flags2 = parent::getFlagsForRevision( $revid ); |
| 762 | + $flags2 = $this->getFlagsForRevision( $revid ); |
771 | 763 | $app = false; |
772 | 764 | foreach ( $flags2 as $f => $v ) { |
773 | 765 | if ( $v > 0 ) $app=true; |
— | — | @@ -789,7 +781,7 @@ |
790 | 782 | $wgOut->addHTML( '<div class="flaggedrevs_tag1 plainlinks">' . $tag . '</div><br/>' ); |
791 | 783 | } |
792 | 784 | } |
793 | | - |
| 785 | + |
794 | 786 | function addReviewForm( &$out ) { |
795 | 787 | global $wgArticle, $action; |
796 | 788 | |
— | — | @@ -805,101 +797,7 @@ |
806 | 798 | // Note: overrides are never done when viewing with "oldid=" |
807 | 799 | $this->addQuickReview( $revId, false ); |
808 | 800 | } |
809 | | - |
810 | | - /** |
811 | | - * Get latest quality rev, if not, the latest reviewed one |
812 | | - */ |
813 | | - function getOverridingRev( $article=NULL ) { |
814 | | - if( !$row = $this->getLatestQualityRev( $article ) ) { |
815 | | - if( !$row = $this->getLatestStableRev( $article ) ) { |
816 | | - return null; |
817 | | - } |
818 | | - } |
819 | | - return $row; |
820 | | - } |
821 | 801 | |
822 | | - /** |
823 | | - * Get latest flagged revision that meets requirments |
824 | | - * per the $wgFlaggedRevTags variable |
825 | | - * This passes rev_deleted revisions |
826 | | - * This is based on the current article and caches results |
827 | | - * Accepts an argument because of the fact that the article |
828 | | - * object for edit mode is part of the editform; insert only |
829 | | - * the article object for the current page! |
830 | | - * @output array ( rev, flags ) |
831 | | - */ |
832 | | - function getLatestQualityRev( $article=NULL ) { |
833 | | - global $wgArticle; |
834 | | - |
835 | | - wfProfileIn( __METHOD__ ); |
836 | | - |
837 | | - $article = $article ? $article : $wgArticle; |
838 | | - $title = $article->getTitle(); |
839 | | - // Cached results available? |
840 | | - if ( isset($this->stablefound) ) { |
841 | | - return ( $this->stablefound ) ? $this->stablerev : null; |
842 | | - } |
843 | | - $dbr = wfGetDB( DB_SLAVE ); |
844 | | - // Skip deleted revisions |
845 | | - $result = $dbr->select( |
846 | | - array('flaggedrevs', 'revision'), |
847 | | - array('fr_rev_id', 'fr_user', 'fr_timestamp', 'fr_comment', 'rev_timestamp'), |
848 | | - array('fr_namespace' => $title->getNamespace(), 'fr_title' => $title->getDBkey(), 'fr_quality >= 1', |
849 | | - 'fr_rev_id = rev_id', 'rev_page' => $article->getId(), 'rev_deleted=0'), |
850 | | - __METHOD__, |
851 | | - array('ORDER BY' => 'fr_rev_id DESC', 'LIMIT' => 1 ) ); |
852 | | - // Do we have one? |
853 | | - if ( $row = $dbr->fetchObject($result) ) { |
854 | | - $this->stablefound = true; |
855 | | - $this->stablerev = $row; |
856 | | - return $row; |
857 | | - } else { |
858 | | - $this->stablefound = false; |
859 | | - return null; |
860 | | - } |
861 | | - } |
862 | | - |
863 | | - /** |
864 | | - * Get latest flagged revision |
865 | | - * This passes rev_deleted revisions |
866 | | - * This is based on the current article and caches results |
867 | | - * Accepts an argument because of the fact that the article |
868 | | - * object for edit mode is part of the editform; insert only |
869 | | - * the article object for the current page! |
870 | | - * The cache here doesn't make sense for arbitrary articles |
871 | | - * @output array ( rev, flags ) |
872 | | - */ |
873 | | - function getLatestStableRev( $article=NULL ) { |
874 | | - global $wgArticle; |
875 | | - |
876 | | - wfProfileIn( __METHOD__ ); |
877 | | - |
878 | | - $article = $article ? $article : $wgArticle; |
879 | | - $title = $article->getTitle(); |
880 | | - // Cached results available? |
881 | | - if ( isset($this->latestfound) ) { |
882 | | - return ( $this->latestfound ) ? $this->latestrev : NULL; |
883 | | - } |
884 | | - $dbr = wfGetDB( DB_SLAVE ); |
885 | | - // Skip deleted revisions |
886 | | - $result = $dbr->select( |
887 | | - array('flaggedrevs', 'revision'), |
888 | | - array('fr_rev_id', 'fr_user', 'fr_timestamp', 'fr_comment', 'rev_timestamp'), |
889 | | - array('fr_namespace' => $title->getNamespace(), 'fr_title' => $title->getDBkey(), |
890 | | - 'fr_rev_id = rev_id', 'rev_page' => $article->getId(), 'rev_deleted=0'), |
891 | | - __METHOD__, |
892 | | - array('ORDER BY' => 'fr_rev_id DESC', 'LIMIT' => 1 ) ); |
893 | | - // Do we have one? |
894 | | - if ( $row = $dbr->fetchObject($result) ) { |
895 | | - $this->latestfound = true; |
896 | | - $this->latestrev = $row; |
897 | | - return $row; |
898 | | - } else { |
899 | | - $this->latestfound = false; |
900 | | - return null; |
901 | | - } |
902 | | - } |
903 | | - |
904 | 802 | function setPermaLink( &$sktmp, &$nav_urls, &$oldid, &$revid ) { |
905 | 803 | global $wgArticle, $wgTitle, $action; |
906 | 804 | // Only trigger on article view, not for protect/delete/hist |
— | — | @@ -963,14 +861,14 @@ |
964 | 862 | } |
965 | 863 | |
966 | 864 | function addQuickReview( $id, $ontop=false ) { |
967 | | - global $wgOut, $wgTitle, $wgUser, $wgScript, $wgFlaggedRevComments, $wgArticle, $wgRequest; |
| 865 | + global $wgOut, $wgTitle, $wgUser, $wgFlaggedRevComments, $wgArticle, $wgRequest; |
968 | 866 | // Hack, we don't want two forms! |
969 | 867 | if( isset($this->formCount) && $this->formCount > 0 ) return; |
970 | 868 | $this->formCount = 1; |
971 | 869 | |
972 | 870 | if( !$wgUser->isAllowed( 'review' ) ) return; |
973 | 871 | // Already flagged? |
974 | | - $flags = parent::getFlagsForRevision( $id ); |
| 872 | + $flags = $this->getFlagsForRevision( $id ); |
975 | 873 | |
976 | 874 | $reviewtitle = SpecialPage::getTitleFor( 'Revisionreview' ); |
977 | 875 | $action = $reviewtitle->escapeLocalUrl( 'action=submit' ); |
— | — | @@ -1050,8 +948,136 @@ |
1051 | 949 | '</strong></small></tt>'; |
1052 | 950 | } |
1053 | 951 | } |
1054 | | - } |
| 952 | + } |
1055 | 953 | |
| 954 | + /** |
| 955 | + * Get latest quality rev, if not, the latest reviewed one |
| 956 | + */ |
| 957 | + function getOverridingRev( $article=NULL ) { |
| 958 | + if( !$row = $this->getLatestQualityRev( $article ) ) { |
| 959 | + if( !$row = $this->getLatestStableRev( $article ) ) { |
| 960 | + return null; |
| 961 | + } |
| 962 | + } |
| 963 | + return $row; |
| 964 | + } |
| 965 | + |
| 966 | + /** |
| 967 | + * Get latest flagged revision that meets requirments |
| 968 | + * per the $wgFlaggedRevTags variable |
| 969 | + * This passes rev_deleted revisions |
| 970 | + * This is based on the current article and caches results |
| 971 | + * Accepts an argument because of the fact that the article |
| 972 | + * object for edit mode is part of the editform; insert only |
| 973 | + * the article object for the current page! |
| 974 | + * @output array ( rev, flags ) |
| 975 | + */ |
| 976 | + function getLatestQualityRev( $article=NULL ) { |
| 977 | + global $wgArticle; |
| 978 | + |
| 979 | + wfProfileIn( __METHOD__ ); |
| 980 | + |
| 981 | + $article = $article ? $article : $wgArticle; |
| 982 | + $title = $article->getTitle(); |
| 983 | + // Cached results available? |
| 984 | + if ( isset($this->stablefound) ) { |
| 985 | + return ( $this->stablefound ) ? $this->stablerev : null; |
| 986 | + } |
| 987 | + $dbr = wfGetDB( DB_SLAVE ); |
| 988 | + // Skip deleted revisions |
| 989 | + $result = $dbr->select( |
| 990 | + array('flaggedrevs', 'revision'), |
| 991 | + array('fr_rev_id', 'fr_user', 'fr_timestamp', 'fr_comment', 'rev_timestamp'), |
| 992 | + array('fr_namespace' => $title->getNamespace(), 'fr_title' => $title->getDBkey(), 'fr_quality >= 1', |
| 993 | + 'fr_rev_id = rev_id', 'rev_page' => $article->getId(), 'rev_deleted=0'), |
| 994 | + __METHOD__, |
| 995 | + array('ORDER BY' => 'fr_rev_id DESC', 'LIMIT' => 1 ) ); |
| 996 | + // Do we have one? |
| 997 | + if ( $row = $dbr->fetchObject($result) ) { |
| 998 | + $this->stablefound = true; |
| 999 | + $this->stablerev = $row; |
| 1000 | + return $row; |
| 1001 | + } else { |
| 1002 | + $this->stablefound = false; |
| 1003 | + return null; |
| 1004 | + } |
| 1005 | + } |
| 1006 | + |
| 1007 | + /** |
| 1008 | + * Get latest flagged revision |
| 1009 | + * This passes rev_deleted revisions |
| 1010 | + * This is based on the current article and caches results |
| 1011 | + * Accepts an argument because of the fact that the article |
| 1012 | + * object for edit mode is part of the editform; insert only |
| 1013 | + * the article object for the current page! |
| 1014 | + * The cache here doesn't make sense for arbitrary articles |
| 1015 | + * @output array ( rev, flags ) |
| 1016 | + */ |
| 1017 | + function getLatestStableRev( $article=NULL ) { |
| 1018 | + global $wgArticle; |
| 1019 | + |
| 1020 | + wfProfileIn( __METHOD__ ); |
| 1021 | + |
| 1022 | + $article = $article ? $article : $wgArticle; |
| 1023 | + $title = $article->getTitle(); |
| 1024 | + // Cached results available? |
| 1025 | + if ( isset($this->latestfound) ) { |
| 1026 | + return ( $this->latestfound ) ? $this->latestrev : NULL; |
| 1027 | + } |
| 1028 | + $dbr = wfGetDB( DB_SLAVE ); |
| 1029 | + // Skip deleted revisions |
| 1030 | + $result = $dbr->select( |
| 1031 | + array('flaggedrevs', 'revision'), |
| 1032 | + array('fr_rev_id', 'fr_user', 'fr_timestamp', 'fr_comment', 'rev_timestamp'), |
| 1033 | + array('fr_namespace' => $title->getNamespace(), 'fr_title' => $title->getDBkey(), |
| 1034 | + 'fr_rev_id = rev_id', 'rev_page' => $article->getId(), 'rev_deleted=0'), |
| 1035 | + __METHOD__, |
| 1036 | + array('ORDER BY' => 'fr_rev_id DESC', 'LIMIT' => 1 ) ); |
| 1037 | + // Do we have one? |
| 1038 | + if ( $row = $dbr->fetchObject($result) ) { |
| 1039 | + $this->latestfound = true; |
| 1040 | + $this->latestrev = $row; |
| 1041 | + return $row; |
| 1042 | + } else { |
| 1043 | + $this->latestfound = false; |
| 1044 | + return null; |
| 1045 | + } |
| 1046 | + } |
| 1047 | + |
| 1048 | + /** |
| 1049 | + * @param int $rev_id |
| 1050 | + * Return an array output of the flags for a given revision |
| 1051 | + */ |
| 1052 | + public function getFlagsForRevision( $rev_id ) { |
| 1053 | + global $wgFlaggedRevTags; |
| 1054 | + |
| 1055 | + wfProfileIn( __METHOD__ ); |
| 1056 | + // Cached results? |
| 1057 | + if ( isset($this->flags[$rev_id]) && $this->flags[$rev_id] ) |
| 1058 | + return $this->revflags[$rev_id]; |
| 1059 | + // Set all flags to zero |
| 1060 | + $flags = array(); |
| 1061 | + foreach( array_keys($wgFlaggedRevTags) as $tag ) { |
| 1062 | + $flags[$tag] = 0; |
| 1063 | + } |
| 1064 | + $db = wfGetDB( DB_SLAVE ); |
| 1065 | + // Grab all the tags for this revision |
| 1066 | + $result = $db->select( |
| 1067 | + array('flaggedrevtags'), |
| 1068 | + array('frt_dimension', 'frt_value'), |
| 1069 | + array('frt_rev_id' => $rev_id), |
| 1070 | + __METHOD__ ); |
| 1071 | + // Iterate through each tag result |
| 1072 | + while ( $row = $db->fetchObject($result) ) { |
| 1073 | + $flags[$row->frt_dimension] = $row->frt_value; |
| 1074 | + } |
| 1075 | + // Try to cache results |
| 1076 | + $this->flags[$rev_id] = true; |
| 1077 | + $this->revflags[$rev_id] = $flags; |
| 1078 | + |
| 1079 | + return $flags; |
| 1080 | + } |
| 1081 | + |
1056 | 1082 | } |
1057 | 1083 | |
1058 | 1084 | $flaggedrevs = new FlaggedRevs(); |
Index: trunk/extensions/FlaggedRevs/FlaggedRevsPage.body.php |
— | — | @@ -43,7 +43,7 @@ |
44 | 44 | // Additional notes |
45 | 45 | $this->notes = ($wgFlaggedRevComments) ? $wgRequest->getText('wpNotes') : ''; |
46 | 46 | // Get the revision's current flags, if any |
47 | | - $this->oflags = FlaggedRevs::getFlagsForRevision( $this->oldid ); |
| 47 | + $this->oflags = FlaggedRevs::getFlagsForPageRev( $this->oldid ); |
48 | 48 | // Get our accuracy/quality dimensions |
49 | 49 | $this->dims = array(); |
50 | 50 | $this->upprovedTags = 0; |
— | — | @@ -289,6 +289,10 @@ |
290 | 290 | // Update the article review log |
291 | 291 | $this->updateLog( $this->page, $this->dims, $this->comment, $this->oldid, true ); |
292 | 292 | |
| 293 | + # Update our links if needed |
| 294 | + $article = new Article( $this->page ); |
| 295 | + FlaggedRevs::extraLinksUpdate( $article ); |
| 296 | + |
293 | 297 | # Clear the cache... |
294 | 298 | $this->page->invalidateCache(); |
295 | 299 | # Purge squid for this page only |
— | — | @@ -320,6 +324,10 @@ |
321 | 325 | // Update the article review log |
322 | 326 | $this->updateLog( $this->page, $this->dims, $this->comment, $this->oldid, false ); |
323 | 327 | |
| 328 | + # Update our links if needed |
| 329 | + $article = new Article( $this->page ); |
| 330 | + FlaggedRevs::extraLinksUpdate( $article ); |
| 331 | + |
324 | 332 | # Clear the cache... |
325 | 333 | $this->page->invalidateCache(); |
326 | 334 | # Purge squid for this page only |
— | — | @@ -435,7 +443,7 @@ |
436 | 444 | // Modifier instance |
437 | 445 | $RevFlagging = new FlaggedRevs(); |
438 | 446 | // Get flags and date |
439 | | - $flags = $RevFlagging->getFlagsForRevision( $frev->fr_rev_id ); |
| 447 | + $flags = FlaggedRevs::getFlagsForPageRev( $frev->fr_rev_id ); |
440 | 448 | $time = $wgLang->timeanddate( wfTimestamp(TS_MW, $frev->fr_timestamp), true ); |
441 | 449 | // We will be looking at the reviewed revision... |
442 | 450 | $tag = wfMsgExt('revreview-static', array('parse'), urlencode($page->getPrefixedText()), $time, $page->getPrefixedText()); |