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(1276)

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

Stack Trace

#0
+
 /home/h/hllabs/hl-labsural.ru/public_html/protected/modules/entity/controllers/IndexController.php(85): IndexController->getCityByIp()
80         $_SESSION['promoCities'] = Shopcity::listOfPromoCity();
81         //  $_SESSION['urls_with_region'] = $this->urls_with_region;
82         $_SESSION['url_prefix'] = '';
83 
84         if (!isset($_SESSION['geolocation']) || !isset($_SESSION['geolocationCity'])) { // по IP еще не определялись
85             $_SESSION['user_city'] = $this->getCityByIp();
86             $_SESSION['geolocationCity'] = Shopcity::loadRegionData($_SESSION['user_city'], $this->defaultCID);
87             $_SESSION['userselCity'] = $_SESSION['geolocationCity'];
88         }
89 
90         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:41 Apache/2.4.10 (Unix) Yii Framework/1.1.10