[8] ErrorException in News.php line 201

未定义数组索引: HTTP_USER_AGENT

  1. if (isset($_SERVER['HTTP_X_WAP_PROFILE'])) {
  2. return true;
  3. }
  4. // 如果via信息含有wap则一定是移动设备,部分服务商会屏蔽该信息
  5. // if (isset($_SERVER['HTTP_VIA'])) {
  6. // // 找不到为flase,否则为true
  7. // return stristr($_SERVER['HTTP_VIA'], "wap") ? true : false;
  8. // }
  9. // 脑残法,判断手机发送的客户端标志,兼容性有待提高。其中'MicroMessenger'是电脑微信
  10. $ua = isset($_SERVER['USER-AGENT']) ? $_SERVER['USER-AGENT'] : $_SERVER['HTTP_USER_AGENT'];
  11. if ($ua) {
  12. $clientkeywords = array('nokia', 'sony', 'ericsson', 'mot', 'samsung', 'htc', 'sgh', 'lg', 'sharp', 'sie-', 'philips', 'panasonic', 'alcatel', 'lenovo', 'iphone', 'ipod', 'blackberry', 'meizu', 'android', 'netfront', 'symbian', 'ucweb', 'windowsce', 'palm', 'operamini', 'operamobi', 'openwave', 'nexusone', 'cldc', 'midp', 'wap', 'mobile', 'MicroMessenger');
  13. // 从HTTP_USER_AGENT中查找手机浏览器的关键字
  14. if (preg_match("/(" . implode('|', $clientkeywords) . ")/i", strtolower($ua))) {
  15. return true;
  16. }
  17. }
  18. // 协议法,因为有可能不准确,放到最后判断
  19. if (isset ($_SERVER['HTTP_ACCEPT'])) {

Call Stack

  1. in News.php line 201
  2. at Error::appError(8, 'Undefined index: HTT...', '/data/www/oilcn.com/...', 201, []) in News.php line 201
  3. at News->isMobile() in News.php line 180
  4. at News->detail()
  5. at ReflectionMethod->invokeArgs(object(News), []) in Container.php line 395
  6. at Container->invokeReflectMethod(object(News), object(ReflectionMethod), ['year' => '2020', 'month' => '07', 'day' => '07_73469', ...]) in Module.php line 132
  7. at Module->think\route\dispatch\{closure}(object(Request), object(Closure), null)
  8. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 185
  9. at Middleware->think\{closure}(object(Request))
  10. at call_user_func(object(Closure), object(Request)) in Middleware.php line 130
  11. at Middleware->dispatch(object(Request), 'controller') in Module.php line 137
  12. at Module->exec() in Dispatch.php line 168
  13. at Dispatch->run() in App.php line 432
  14. at App->think\{closure}(object(Request), object(Closure), null)
  15. at call_user_func_array(object(Closure), [object(Request), object(Closure), null]) in Middleware.php line 185
  16. at Middleware->think\{closure}(object(Request))
  17. at call_user_func(object(Closure), object(Request)) in Middleware.php line 130
  18. at Middleware->dispatch(object(Request)) in App.php line 435
  19. at App->run() in index.php line 21

Environment Variables

GET Dataempty
POST Dataempty
Filesempty
Cookies
_vstime 1596089168
Sessionempty
Server/Request Data
USER www
HOME /home/www
HTTP_COOKIE _vstime=1596089168
HTTP_REFERER /
HTTP_ACCEPT */*
HTTP_HOST www.oilcn.com
PATH_INFO
SCRIPT_FILENAME /data/www/oilcn.com/public/index.php
REDIRECT_STATUS 200
SERVER_NAME www.edibleoil.com.cn
SERVER_PORT 443
SERVER_ADDR 10.23.99.25
REMOTE_PORT 61307
REMOTE_ADDR 43.251.106.186
SERVER_SOFTWARE nginx/1.13.6
GATEWAY_INTERFACE CGI/1.1
HTTPS on
REQUEST_SCHEME https
SERVER_PROTOCOL HTTP/1.1
DOCUMENT_ROOT /data/www/oilcn.com/public
DOCUMENT_URI /index.php
REQUEST_URI /article/2020/07/07_73469.html
SCRIPT_NAME /index.php
CONTENT_LENGTH
CONTENT_TYPE
REQUEST_METHOD GET
QUERY_STRING s=/article/2020/07/07_73469.html
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1596089165.0824
REQUEST_TIME 1596089165
Environment Variablesempty
ThinkPHP Constants
MODULE_NAME
ACTION_NAME
CONTROLLER_NAME
HOUCMS_VERSION 1.0
UC_APP_ID 1
UC_API_TYPE Model
UC_AUTH_KEY xN=9Du3(Q*W@[5hBe^AFw:vV&YH.S#kj4f)PtO%r
UC_DB_DSN mysql://houdian:daayii123@Liujunhoudian@116.255.235.74:3306/houdian
UC_TABLE_PREFIX hd_
ADDON_PATH /data/www/oilcn.com/addons/

您访问的地址不存在,等待跳转...