Index: trunk/extensions/ParserFunctions/ParserFunctions_body.php |
— | — | @@ -149,7 +149,7 @@ |
150 | 150 | $args = func_get_args(); |
151 | 151 | array_shift( $args ); |
152 | 152 | $primary = trim(array_shift($args)); |
153 | | - $found = false; |
| 153 | + $found = $defaultFound = false; |
154 | 154 | $parts = null; |
155 | 155 | $default = null; |
156 | 156 | $mwDefault =& MagicWord::get( 'default' ); |
— | — | @@ -160,7 +160,7 @@ |
161 | 161 | if ( $found || $parts[0] == $primary ) { |
162 | 162 | # Found a match, return now |
163 | 163 | return $parts[1]; |
164 | | - } elseif ( $mwDefault->matchStartAndRemove( $parts[0] ) ) { |
| 164 | + } elseif ( $defaultFound || $mwDefault->matchStartAndRemove( $parts[0] ) ) { |
165 | 165 | $default = $parts[1]; |
166 | 166 | } # else wrong case, continue |
167 | 167 | } elseif ( count( $parts ) == 1 ) { |
— | — | @@ -168,6 +168,8 @@ |
169 | 169 | # If the value matches, set a flag and continue |
170 | 170 | if ( $parts[0] == $primary ) { |
171 | 171 | $found = true; |
| 172 | + } elseif ( $mwDefault->matchStartAndRemove( $parts[0] ) ) { |
| 173 | + $defaultFound = true; |
172 | 174 | } |
173 | 175 | } # else RAM corruption due to cosmic ray? |
174 | 176 | } |