Strict Standards: Only variables should be passed by reference in /home/h/hllabs/hl-labsural.ru/public_html/index.php on line 24 PHP error

PHP error

Non-static method CHttpRequest::getUserHostAddress() should not be called statically, assuming $this from incompatible context

/home/h/hllabs/hl-labsural.ru/public_html/protected/modules/entity/controllers/IndexController.php(1271)

1259 //Y::dump($model,0);
1260         $rendedHtml = $this->render( $view, array('model'=>$model,), true);
1261     $rendedHtml = $this->replaceVarCity($rendedHtml);
1262     exit($rendedHtml);
1263 
1264     }
1265 
1266 //---------------пробиваем город по ip------------------
1267     private function getCityByIp()
1268     {
1269 
1270         if (REGION) { // нужны регионы
1271             $ip = CHttpRequest::getUserHostAddress(); // берем ip
1272         } else {
1273             $ip = '0.0.0.0'; // c мобильника не определяем регион
1274         }
1275 
1276 
1277         //   $ip = '85.172.63.255'; //проверка определения ip краснодара
1278         //  $ip = '217.66.26.172'; // проверка определения ip казань
1279 
1280         if (isset($_GET['ip'])) {
1281             //setcookie('userselCity', '', time() - 10000, '/', '.' . DOMAIN);
1282             $ip = $_GET['ip'];
1283         }

Stack Trace

#0
+
 /home/h/hllabs/hl-labsural.ru/public_html/protected/modules/entity/controllers/IndexController.php(80): IndexController->getCityByIp()
75         $_SESSION['promoCities'] = Shopcity::listOfPromoCity();
76         //  $_SESSION['urls_with_region'] = $this->urls_with_region;
77         $_SESSION['url_prefix'] = '';
78 
79         if (!isset($_SESSION['geolocation']) || !isset($_SESSION['geolocationCity'])) { // по IP еще не определялись
80             $_SESSION['user_city'] = $this->getCityByIp();
81             $_SESSION['geolocationCity'] = Shopcity::loadRegionData($_SESSION['user_city'], $this->defaultCID);
82             $_SESSION['userselCity'] = $_SESSION['geolocationCity'];
83         }
84 
85         if ((isset($_COOKIE['userselCity'])) && (!isset($_SESSION['userselCity']))) {
#1
+
 /home/h/hllabs/hl-labsural.ru/public_html/protected/components/Controller.php(45): IndexController->init()
40     public $model;
41 
42 //----------------------------------------------------------------------------------------------------
43     function __construct()
44     {
45          $this->init();
46     }
47 
48 
49     public function init()
50         {
#7
+
 /home/h/hllabs/hl-labsural.ru/public_html/index.php(52): CApplication->run()
47 }
48 
49 require $yii;
50 require 'protected/components/SWebApplication.php';
51 
52 Yii::createApplication('SWebApplication', $config)->run();
2019-09-20 12:47:01 Apache/2.4.10 (Unix) Yii Framework/1.1.10