Browse Source

fixed regex for multiline patterns

tags/2.0.0-beta
Carsten Brandt 11 years ago
parent
commit
150b9366fc
  1. 2
      framework/yii/i18n/MessageFormatter.php

2
framework/yii/i18n/MessageFormatter.php

@ -73,7 +73,7 @@ class MessageFormatter extends \MessageFormatter
$d = 0; $d = 0;
$stack = array(); $stack = array();
for($i = 1; $i < $c; $i++) { for($i = 1; $i < $c; $i++) {
if (preg_match('~^\A(\s*)([\d\w]+)(\s*)([},])(\s*)(.*)\z$~u', $parts[$i], $matches)) { if (preg_match('~^(\s*)([\d\w]+)(\s*)([},])(\s*)(.*)$~us', $parts[$i], $matches)) {
// if we are not inside a plural or select this is a message // if we are not inside a plural or select this is a message
if (!isset($stack[$d]) || $stack[$d] != 'plural' && $stack[$d] != 'select') { if (!isset($stack[$d]) || $stack[$d] != 'plural' && $stack[$d] != 'select') {
$d++; $d++;

Loading…
Cancel
Save