Skip to content

Commit

Permalink
PHP8에서 나오는 Undefined array key "HTTP_USER_AGENT" 오류 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
kagla committed Sep 16, 2021
1 parent 469e1ff commit b204175
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/common.lib.php
Expand Up @@ -2219,7 +2219,10 @@ function get_checked($field, $value)

function is_mobile()
{
return preg_match('/'.G5_MOBILE_AGENT.'/i', $_SERVER['HTTP_USER_AGENT']);
if (isset($_SERVER['HTTP_USER_AGENT']))
return preg_match('/'.G5_MOBILE_AGENT.'/i', $_SERVER['HTTP_USER_AGENT']);
else
return '';
}


Expand Down

0 comments on commit b204175

Please sign in to comment.