• Resolved Ollie Treend

    (@ollietreend)


    Hi,

    I’m getting an undefined index error on line 45 of stop-user-enumeration.php, which is part of the ll_detect_enumeration() function.

    This is happening on requests to a page without the trailing slash, e.g. request to /about-us rather than /about-us/. In this instance, the first preg_match statement is returning false (because ‘author’ is not in the query string) so the second check is running: ($_POST['author']). This is emitting an undefined index notice, because the key ‘author’ does not exist in the $_POST array.

    This is in-turn breaking the redirect, because a PHP notice is being emitted before the redirect headers can be sent. Of course this only happens if PHP is configured to output notice messages?– typically this means that WP_DEBUG is enabled.

    Suggested fix

    Replace ($_POST['author']) with isset($_POST['author']) to check whether the author key has been set.

    Thanks

    https://www.ads-software.com/plugins/stop-user-enumeration/

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Undefined index notice’ is closed to new replies.