PHP notice

Undefined index: HTTP_ACCEPT_LANGUAGE

/srv/http/btrworlds.com/htdocs/protected/controllers/RegisterController.php(45)

33      * 条件:
34      * 1.根据浏览器显示语言,只取前2位,;
35      * 2.非点击页面中“英文链接”的执行跳转动作
36      * 3.只对register.html页面执行动作
37      */
38 
39     private function readerIndexLang() {
40         //只检查register这个页面的语言
41         if (stripos(Yii::app()->request->url, 'register-en') === false) {
42             //非点页面中“英文链接”的执行跳转动作
43             if (false === stripos(Yii::app()->request->urlReferrer, 'register')) {
44                 //非中文浏览器语言跳转
45                 if (!preg_match("/zh/i", substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2))) {
46                     $this->redirect(array('/register/indexEn'));
47                 }
48             }
49         }
50     }
51 
52     public function actionIndex($type = 'seller', $renderPage = 'index') {
53         Yii::app()->clientScript->registerCssFile(Yii::app()->theme->baseUrl . '/css/register.css');
54         $this->readerIndexLang();
55         if ($renderPage == 'index')
56             Yii::app()->language = 'zh_cn';
57         else

Stack Trace

#0
+
 /srv/http/btrworlds.com/htdocs/protected/controllers/RegisterController.php(54): RegisterController->readerIndexLang()
49         }
50     }
51 
52     public function actionIndex($type = 'seller', $renderPage = 'index') {
53         Yii::app()->clientScript->registerCssFile(Yii::app()->theme->baseUrl . '/css/register.css');
54         $this->readerIndexLang();
55         if ($renderPage == 'index')
56             Yii::app()->language = 'zh_cn';
57         else
58             Yii::app()->language = 'en';
59         if (!in_array($type, array('seller', 'buyer'))) {
#10
+
 /srv/http/btrworlds.com/htdocs/index.php(17): CApplication->run()
12 // specify how many levels of call stack should be shown in each log message
13 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL', 0); 
14 
15 require_once($yii);
16 
17 Yii::createWebApplication($config)->run();
2024-03-19 08:24:35 nginx/1.4.7 Yii Framework/1.1.12