Support » Plugin: Relevanssi - A Better Search » PHP Notices with WP_DEBUG

  • Resolved justin_k

    (@justin_k)


    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 🙂

    http://wordpress.org/extend/plugins/relevanssi/

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

    (@msaari)

    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 ‘PHP Notices with WP_DEBUG’ is closed to new replies.