debug: show client ip of bad requests

This commit is contained in:
Tanguy Pruvot 2017-08-04 06:06:24 +02:00
parent 460574c555
commit 777f39314c

View file

@ -304,9 +304,11 @@ class CWebApplication extends CApplication
$controller->run($actionID); $controller->run($actionID);
$this->_controller=$oldController; $this->_controller=$oldController;
} }
else else {
throw new CHttpException(404,Yii::t('yii','CWebApp: Unable to resolve the request "{route}".', $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))); array('{route}'=>$route===''?$this->defaultController:$route)));
}
} }
/** /**