r22514 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r22513‎ | r22514 | r22515 >
Date:20:02, 28 May 2007
Author:aaron
Status:old
Tags:
Comment:
*Fix bug skrewing with $action
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php
@@ -822,25 +822,22 @@
823823 }
824824
825825 function setPermaLink( &$sktmp, &$nav_urls, &$oldid, &$revid ) {
826 - global $wgArticle, $wgTitle, $action;
827 - // Only trigger on article view, not for protect/delete/hist
 826+ global $wgTitle;
828827 // Non-content pages cannot be validated
829 - if( !$wgArticle || !$wgTitle->isContentPage() || !$this->pageOverride() )
830 - return;
 828+ if( !$wgTitle->isContentPage() || !$this->pageOverride() ) return;
831829 // Check for an overridabe revision
832830 $tfrev = $this->getOverridingRev();
833831 if( !$tfrev ) return;
834 - $revid = $tfrev->fr_rev_id;
835832 // Replace "permalink" with an actual permanent link
836833 $nav_urls['permalink'] = array(
837834 'text' => wfMsg( 'permalink' ),
838 - 'href' => $sktmp->makeSpecialUrl( 'Stableversions', "oldid=$revid" )
 835+ 'href' => $sktmp->makeSpecialUrl( 'Stableversions', "oldid={$tfrev->fr_rev_id}" )
839836 );
840837 // Are we using the popular cite extension?
841838 if( isset($nav_urls['cite']) ) {
842839 $nav_urls['cite'] = array(
843840 'text' => wfMsg( 'cite_article_link' ),
844 - 'href' => $sktmp->makeSpecialUrl( 'Cite', "page=" . wfUrlencode( "{$sktmp->thispage}" ) . "&id=$revid" )
 841+ 'href' => $sktmp->makeSpecialUrl( 'Cite', "page=" . wfUrlencode( "{$sktmp->thispage}" ) . "&id={$tfrev->fr_rev_id}" )
845842 );
846843 }
847844 }
@@ -865,7 +862,7 @@
866863 unset( $content_actions['viewsource']);
867864 # Straighten out order
868865 $new_actions = array(); $counter = 0;
869 - foreach( $content_actions as $action => $data ) {
 866+ foreach( $content_actions as $tab_action => $data ) {
870867 if( $counter==1 ) {
871868 # Set current rev tab AFTER the main tab is set
872869 $new_actions['current'] = array(
@@ -874,7 +871,7 @@
875872 'href' => $title->getLocalUrl( 'stable=0' )
876873 );
877874 }
878 - $new_actions[$action] = $data;
 875+ $new_actions[$tab_action] = $data;
879876 $counter++;
880877 }
881878 # Reset static array
@@ -882,7 +879,7 @@
883880 } else if( $action != 'view' || $wgRequest->getVal('oldid') || $sktmp->mTitle->isTalkPage() ) {
884881 # Straighten out order
885882 $new_actions = array(); $counter = 0;
886 - foreach( $content_actions as $action => $data ) {
 883+ foreach( $content_actions as $tab_action => $data ) {
887884 if( $counter==1 ) {
888885 # Set current rev tab AFTER the main tab is set
889886 $new_actions['current'] = array(
@@ -891,7 +888,7 @@
892889 'href' => $title->getLocalUrl( 'stable=0' )
893890 );
894891 }
895 - $new_actions[$action] = $data;
 892+ $new_actions[$tab_action] = $data;
896893 $counter++;
897894 }
898895 # Reset static array
@@ -899,7 +896,7 @@
900897 } else {
901898 # Straighten out order
902899 $new_actions = array(); $counter = 0;
903 - foreach( $content_actions as $action => $data ) {
 900+ foreach( $content_actions as $tab_action => $data ) {
904901 if( $counter==1 ) {
905902 # Set current rev tab AFTER the main tab is set
906903 $new_actions['current'] = array(
@@ -908,7 +905,7 @@
909906 'href' => $title->getLocalUrl( 'stable=0' )
910907 );
911908 }
912 - $new_actions[$action] = $data;
 909+ $new_actions[$tab_action] = $data;
913910 $counter++;
914911 }
915912 # Reset static array