Fixed yii\console\controllers\MessageController handles category name containing dot incorrectly

This commit is contained in:
Klimov Paul
2014-09-17 15:48:12 +03:00
parent ec19536047
commit db26e65c62
3 changed files with 6 additions and 9 deletions

View File

@@ -91,6 +91,7 @@ Yii Framework 2 Change Log
- Bug #4880: Return value of yii\web\Request::getPrefferedLanguage() was a normalized value instead of a valid language value from the input array (cebe)
- Bug #4905: ActiveForm::$validationDelay doesn't delay after keyrelease when $validateOnType=true (qiangxue)
- Bug #4920: `yii\filters\auth\CompositeAuth` should not trigger error as long as one of the methods succeeds (qiangxue)
- Bug #4926: Fixed `yii\console\controllers\MessageController` handles category name containing dot incorrectly (klimov-paul)
- Bug #4938: When `yii\db\ActiveQuery` is used to build sub-queries, its WHERE clause is not correctly generated (qiangxue)
- Bug #4954: MSSQL column comments are not retrieved correctly (SerjRamone)
- Bug #4970: `joinWith()` called by a relation was ignored by `yii\db\ActiveQuery` (stepanselyuk)

View File

@@ -260,13 +260,9 @@ class MessageController extends Controller
PREG_SET_ORDER
);
for ($i = 0; $i < $n; ++$i) {
if (($pos = strpos($matches[$i][1], '.')) !== false) {
$category = substr($matches[$i][1], $pos + 1, -1);
} else {
$category = substr($matches[$i][1], 1, -1);
}
$category = substr($matches[$i][1], 1, -1);
$message = $matches[$i][2];
$messages[$category][] = eval("return $message;"); // use eval to eliminate quote escape
$messages[$category][] = eval("return {$message};"); // use eval to eliminate quote escape
}
}