diff --git a/CGeoIP.php b/CGeoIP.php index b10d5fa..414f113 100644 --- a/CGeoIP.php +++ b/CGeoIP.php @@ -87,7 +87,7 @@ public function lookupRegion($ip=null) { protected function _getIP($ip=null) { if ($ip === null) { - $ip = CHttpRequest::getUserHostAddress(); + $ip = Yii::app()->getRequest()->getUserHostAddress(); } return $ip; }