出于某种原因,我无法再访问我的HostPapa cpanel,它说:
The www.hostpapa.ca page isn’t working
www.hostpapa.ca is currently unable to handle this request.
HTTP ERROR 500
我检查了我的错误日志,我发现在不同的日期/时间重复了同样的错误:
[07-Jun-2016 14:30:26 America/Toronto] PHP Notice: Undefined index: HTTP_USER_AGENT in /home/saltn168/public_html/tripepic.com/tripepic-theme/List/tripepic-theme.php on line 1160
[07-Jun-2016 19:26:50 America/Toronto] PHP Notice: Undefined index: HTTP_USER_AGENT in /home/saltn168/public_html/tripepic.com/tripepic-theme/List/tripepic-theme.php on line 1160
[08-Jun-2016 08:45:14 America/Toronto] PHP Notice: Undefined index: HTTP_USER_AGENT in /home/saltn168/public_html/tripepic.com/tripepic-theme/List/tripepic-theme.php on line 1160
[08-Jun-2016 20:35:00 America/Toronto] PHP Notice: Undefined index: HTTP_USER_AGENT in /home/saltn168/public_html/tripepic.com/tripepic-theme/List/tripepic-theme.php on line 1160
[08-Jun-2016 23:14:13 America/Toronto] PHP Notice: Undefined index: HTTP_USER_AGENT in /home/saltn168/public_html/tripepic.com/tripepic-theme/List/tripepic-theme.php on line 1160
我检查了该文件,第1160行是:
if(isset($r[2]) && @$r[2] == 'img' && preg_match('/MSIE [5-7]/',$_SERVER['HTTP_USER_AGENT']) == 0) {
对我来说这看起来很乱,所以我不知道该怎么做。昨天我的合作伙伴让我成为该网站的“超级管理员” - 不确定它是否与此相关?或者为什么它会是均匀的。
如果有人能指出正确的话,我会非常感激。
由于
答案 0 :(得分:1)
用户代理标头是可选标头。有些东西可能会过滤它(比如防火墙),或者人们可以配置他们的客户端来省略标题。
您可能想要检查标头是否与isset()
一起存在。