Followup r78786: pass $fname in the raw SQL case too
[lhc/web/wiklou.git] / includes / Autopromote.php
index 560ba7a..b4d89b2 100644 (file)
@@ -17,8 +17,9 @@ class Autopromote {
                $promote = array();
 
                foreach ( $wgAutopromote as $group => $cond ) {
-                       if ( self::recCheckCondition( $cond, $user ) )
+                       if ( self::recCheckCondition( $cond, $user ) ) {
                                $promote[] = $group;
+                       }
                }
 
                wfRunHooks( 'GetAutoPromoteGroups', array( $user, &$promote ) );
@@ -74,7 +75,7 @@ class Autopromote {
                                }
 
                                return $res;
-                       } elseif ( $cond[0] = '!' ) {
+                       } elseif ( $cond[0] == '!' ) {
                                foreach ( array_slice( $cond, 1 ) as $subcond ) {
                                        if ( self::recCheckCondition( $subcond, $user ) ) {
                                                return false;
@@ -143,7 +144,7 @@ class Autopromote {
                                        throw new MWException( "Unrecognized condition {$cond[0]} for autopromotion!" );
                                }
 
-                               return $result ? true : false;
+                               return (bool)$result;
                }
        }
 }