Skip to content

Commit

Permalink
Fix for PHP 8.1 Warning
Browse files Browse the repository at this point in the history
I am running Dokuwiki Release 2022-07-31a "Igor" and I noticed the following variety of PHP logs generated:
[01-Feb-2023 07:21:37 Asia/Kolkata] PHP Warning:  Undefined array key "host" in /home/ekvastra/wiki.ekvastra.in/inc/common.php on line 1362
  • Loading branch information
AmritasyaPutra committed Feb 2, 2023
1 parent d09a8e0 commit c787540
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions inc/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -1379,6 +1379,7 @@ function getGoogleQuery() {
$url = parse_url($INPUT->server->str('HTTP_REFERER'));

// only handle common SEs
if(!array_key_exists('host', $url)) return '';
if(!preg_match('/(google|bing|yahoo|ask|duckduckgo|babylon|aol|yandex)/',$url['host'])) return '';

$query = array();
Expand Down

0 comments on commit c787540

Please sign in to comment.