Index: trunk/extensions/Translate/MessageChecks.php |
— | — | @@ -310,10 +310,12 @@ |
311 | 311 | * @return True if namespace has been tampered with. |
312 | 312 | */ |
313 | 313 | protected function checkFreeColMissingVars( TMessage $message, $code, &$desc = null ) { |
314 | | - if ( !preg_match_all( '/%[^% ]+%/U', $message->definition, $defVars ) ) { |
| 314 | + $varPattern = '%[a-zA-Z_]+%'; |
| 315 | + |
| 316 | + if ( !preg_match_all( "/$varPattern/U", $message->definition, $defVars ) ) { |
315 | 317 | return false; |
316 | 318 | } |
317 | | - preg_match_all( '/%[^% ]+%/U', $message->translation, $transVars ); |
| 319 | + preg_match_all( "/$varPattern/U", $message->translation, $transVars ); |
318 | 320 | |
319 | 321 | $missing = self::compareArrays( $defVars[0], $transVars[0] ); |
320 | 322 | |
— | — | @@ -336,9 +338,11 @@ |
337 | 339 | * @return True if namespace has been tampered with. |
338 | 340 | */ |
339 | 341 | protected function checkFreeColExtraVars( TMessage $message, $code, &$desc = null ) { |
340 | | - preg_match_all( '/%[^% ]+%/U', $message->definition, $defVars ); |
341 | | - preg_match_all( '/%[^% ]+%/U', $message->translation, $transVars ); |
| 342 | + $varPattern = '%[a-zA-Z_]+%'; |
342 | 343 | |
| 344 | + preg_match_all( "/$varPattern/U", $message->definition, $defVars ); |
| 345 | + preg_match_all( "/$varPattern/U", $message->translation, $transVars ); |
| 346 | + |
343 | 347 | $missing = self::compareArrays( $transVars[0], $defVars[0] ); |
344 | 348 | |
345 | 349 | if ( $count = count( $missing ) ) { |