Error with HTTP_REFERER due to bad coding + solution
-
My log is full of errors like this:
[17-Oct-2016 22:17:51 UTC] PHP Notice: Undefined index: HTTP_REFERER in /home/c2cero/public_html/wp-content/plugins/w3-total-cache/DbCache_WpdbInjection_QueryCaching.php on line 366
This is because you don’t check if $_SERVER[‘HTTP_REFERER’] is set which is not always the case (its optional, depends on the client).
Therefore, line 366 must be:
if(isset($_SERVER[‘HTTP_REFERER’])) {
if ( strpos( $_SERVER[‘HTTP_REFERER’], ‘/wp-admin/’ ) === false ) {
$ajax_skip = true;
}
}The same bad coding is also presente in other parts of the code. So please fix that!
The topic ‘Error with HTTP_REFERER due to bad coding + solution’ is closed to new replies.