From 150b9366fcf385fb279fb59bf4293d95fd407c9d Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Wed, 16 Oct 2013 05:24:02 +0200 Subject: [PATCH] fixed regex for multiline patterns --- framework/yii/i18n/MessageFormatter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/yii/i18n/MessageFormatter.php b/framework/yii/i18n/MessageFormatter.php index d83541c..8ae6c1e 100644 --- a/framework/yii/i18n/MessageFormatter.php +++ b/framework/yii/i18n/MessageFormatter.php @@ -73,7 +73,7 @@ class MessageFormatter extends \MessageFormatter $d = 0; $stack = array(); 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 (!isset($stack[$d]) || $stack[$d] != 'plural' && $stack[$d] != 'select') { $d++;