Support » Plugins and Hacks » [Resolved] PHP Notices with WP_DEBUG

[Resolved] PHP Notices with WP_DEBUG

  • With WP_DEBUG defined, numerous PHP notices occur:

    “PHP Notice: Undefined index: HTTP_REFERER in /<path>/wordpress/wp-content/plugins/relevanssi/lib/excerpts-highlights.php on line 225”

    Should check isset() first, since HTTP_REFERER is set by the useragent and is thus not necessarily reliable.

    Thanks 🙂


Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Mikko Saari


    Thanks, I’ll fix this in the next version.

    Fix suggestion:

    $referrer = ( isset( $_SERVER['HTTP_REFERER'] ) ) ? preg_replace('@(http|https)://@', '', stripslashes(urldecode($_SERVER['HTTP_REFERER']))) : '';

    (been using this already for a few versions)

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] PHP Notices with WP_DEBUG’ is closed to new replies.