From 2239dd733426146ff313bb03fb79539097cb8a83 Mon Sep 17 00:00:00 2001 From: Revin Roman Date: Thu, 6 Jun 2013 23:13:54 +0400 Subject: [PATCH 1/2] Fix new method name "getIsAjax" and fix web application class name in logger --- framework/yii/logging/ProfileTarget.php | 2 +- framework/yii/web/Response.php | 2 +- framework/yii/web/User.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/framework/yii/logging/ProfileTarget.php b/framework/yii/logging/ProfileTarget.php index f4522ac..be1d73d 100644 --- a/framework/yii/logging/ProfileTarget.php +++ b/framework/yii/logging/ProfileTarget.php @@ -70,7 +70,7 @@ class CProfileLogRoute extends CWebLogRoute public function processLogs($logs) { $app = \Yii::$app; - if (!($app instanceof CWebApplication) || $app->getRequest()->getIsAjaxRequest()) + if (!($app instanceof \yii\web\Application) || $app->getRequest()->getIsAjax()) return; if ($this->getReport() === 'summary') diff --git a/framework/yii/web/Response.php b/framework/yii/web/Response.php index 6801191..a8cdee7 100644 --- a/framework/yii/web/Response.php +++ b/framework/yii/web/Response.php @@ -258,7 +258,7 @@ class Response extends \yii\base\Response if (strpos($url, '/') === 0 && strpos($url, '//') !== 0) { $url = Yii::$app->getRequest()->getHostInfo() . $url; } - if (Yii::$app->getRequest()->getIsAjaxRequest()) { + if (Yii::$app->getRequest()->getIsAjax()) { $statusCode = $this->ajaxRedirectCode; } header('Location: ' . $url, true, $statusCode); diff --git a/framework/yii/web/User.php b/framework/yii/web/User.php index 79665ae..5522bbb 100644 --- a/framework/yii/web/User.php +++ b/framework/yii/web/User.php @@ -280,7 +280,7 @@ class User extends Component public function loginRequired() { $request = Yii::$app->getRequest(); - if (!$request->getIsAjaxRequest()) { + if (!$request->getIsAjax()) { $this->setReturnUrl($request->getUrl()); } if ($this->loginUrl !== null) { From 4ed28a9aee0d26a499d22722e8ddedea8a1fe725 Mon Sep 17 00:00:00 2001 From: gsd Date: Fri, 7 Jun 2013 01:54:20 +0600 Subject: [PATCH 2/2] Update CompareValidator.php --- framework/yii/validators/CompareValidator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/yii/validators/CompareValidator.php b/framework/yii/validators/CompareValidator.php index b8e8a50..c94577c 100644 --- a/framework/yii/validators/CompareValidator.php +++ b/framework/yii/validators/CompareValidator.php @@ -58,7 +58,7 @@ class CompareValidator extends Validator * - `<`: validates to see if the value being validated is less than the value being compared with. * - `<=`: validates to see if the value being validated is less than or equal to the value being compared with. */ - public $operator = '='; + public $operator = '=='; /** * @var string the user-defined error message. It may contain the following placeholders which * will be replaced accordingly by the validator: