Index: trunk/phase3/includes/Autopromote.php |
— | — | @@ -104,18 +104,11 @@ |
105 | 105 | |
106 | 106 | return false; |
107 | 107 | } elseif ( $cond[0] == '^' ) { // XOR (exactly one cond passes) |
108 | | - $res = false; |
109 | | - foreach ( array_slice( $cond, 1 ) as $subcond ) { |
110 | | - if ( self::recCheckCondition( $subcond, $user ) ) { |
111 | | - if ( $res ) { |
112 | | - return false; |
113 | | - } else { |
114 | | - $res = true; |
115 | | - } |
116 | | - } |
| 108 | + if ( count( $cond ) > 3 ) { |
| 109 | + wfWarn( 'recCheckCondition() given XOR ("^") condition on three or more conditions. Check your $wgAutopromote and $wgAutopromoteOnce settings.' ); |
117 | 110 | } |
118 | | - |
119 | | - return $res; |
| 111 | + return self::recCheckCondition( $cond[1], $user ) |
| 112 | + xor self::recCheckCondition( $cond[2], $user ); |
120 | 113 | } elseif ( $cond[0] == '!' ) { // NOT (no conds pass) |
121 | 114 | foreach ( array_slice( $cond, 1 ) as $subcond ) { |
122 | 115 | if ( self::recCheckCondition( $subcond, $user ) ) { |