From 777f39314c168dc43b0ff19e0e5ed985cf1b53fc Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Fri, 4 Aug 2017 06:06:24 +0200 Subject: [PATCH] debug: show client ip of bad requests --- web/framework/web/CWebApplication.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/web/framework/web/CWebApplication.php b/web/framework/web/CWebApplication.php index e343c0f..fed5f0d 100644 --- a/web/framework/web/CWebApplication.php +++ b/web/framework/web/CWebApplication.php @@ -304,9 +304,11 @@ class CWebApplication extends CApplication $controller->run($actionID); $this->_controller=$oldController; } - else - throw new CHttpException(404,Yii::t('yii','CWebApp: Unable to resolve the request "{route}".', + else { + $client_ip = arraySafeVal($_SERVER,'REMOTE_ADDR'); + throw new CHttpException(404, $client_ip.': '.Yii::t('yii','CWebApp: Unable to resolve the request "{route}".', array('{route}'=>$route===''?$this->defaultController:$route))); + } } /**