Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php |
— | — | @@ -862,14 +862,12 @@ |
863 | 863 | wfProfileOut( __METHOD__ ); |
864 | 864 | return true; |
865 | 865 | } |
866 | | - # Check if results are cached to avoid DB queries |
867 | | - $key = wfMemcKey( 'flaggedrevs', 'autopromote-skip', $user->getID() ); |
868 | | - $value = $wgMemc->get( $key ); |
869 | | - if( $value == 'true' ) { |
| 866 | + # Check user email |
| 867 | + if( $wgFlaggedRevsAutopromote['email'] && !$user->isEmailConfirmed() ) { |
870 | 868 | wfProfileOut( __METHOD__ ); |
871 | 869 | return true; |
872 | 870 | } |
873 | | - # Check basic, already available, promotion heuristics first... |
| 871 | + # Check account age |
874 | 872 | $now = time(); |
875 | 873 | $usercreation = wfTimestampOrNull( TS_UNIX, $user->getRegistration() ); |
876 | 874 | $userage = $usercreation ? floor(($now - $usercreation) / 86400) : NULL; |
— | — | @@ -877,11 +875,16 @@ |
878 | 876 | wfProfileOut( __METHOD__ ); |
879 | 877 | return true; |
880 | 878 | } |
| 879 | + # Check user edit count. Should be stored. |
881 | 880 | if( $user->getEditCount() < $wgFlaggedRevsAutopromote['edits'] ) { |
882 | 881 | wfProfileOut( __METHOD__ ); |
883 | 882 | return true; |
884 | 883 | } |
885 | | - if( $wgFlaggedRevsAutopromote['email'] && !$user->isEmailConfirmed() ) { |
| 884 | + # Check if results are cached to avoid DB queries. |
| 885 | + # Checked basic, already available, promotion heuristics first... |
| 886 | + $key = wfMemcKey( 'flaggedrevs', 'autopromote-skip', $user->getID() ); |
| 887 | + $value = $wgMemc->get( $key ); |
| 888 | + if( $value == 'true' ) { |
886 | 889 | wfProfileOut( __METHOD__ ); |
887 | 890 | return true; |
888 | 891 | } |