Index: trunk/phase3/includes/Autopromote.php |
— | — | @@ -41,7 +41,7 @@ |
42 | 42 | * @return bool Whether the condition is true |
43 | 43 | */ |
44 | 44 | private static function recCheckCondition( $cond, User $user ) { |
45 | | - $validOps = array( '&', '|', '^' ); |
| 45 | + $validOps = array( '&', '|', '^', '!' ); |
46 | 46 | if( is_array( $cond ) && count( $cond ) >= 2 && in_array( $cond[0], $validOps ) ) { |
47 | 47 | # Recursive condition |
48 | 48 | if( $cond[0] == '&' ) { |
— | — | @@ -63,6 +63,11 @@ |
64 | 64 | $res = ($res xor self::recCheckCondition( $subcond, $user )); |
65 | 65 | } |
66 | 66 | return $res; |
| 67 | + } elseif ( $cond[0] = '!' ) { |
| 68 | + foreach( array_slice( $cond, 1 ) as $subcond ) |
| 69 | + if( self::recCheckCondition( $subcond, $user ) ) |
| 70 | + return false; |
| 71 | + return true; |
67 | 72 | } |
68 | 73 | } |
69 | 74 | # If we got here, the array presumably does not contain other condi- |