• Resolved oruoss

    (@oruoss)


    site settings:
    Wordpress Version 5.4.2
    PHP-Version 7.4.8

    my debug.log:
    [03-Aug-2020 06:38:57 UTC] PHP Notice: Undefined index: path in xxxxxx/wp-content/plugins/restrict-user-access/level.php on line 471
    [03-Aug-2020 06:38:57 UTC] PHP Deprecated: stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in xxxxxx/wp-content/plugins/restrict-user-access/level.php on line 471

    level.php Line 470: $parts = parse_url(get_site_url());
    level.php Line 471 $pos = stripos($current_path, $parts[‘path’]);

    Usually there will never be a ‘path’ element in the array returning from parse_url() when calling it with get_site_url().

    I think this is a bug and should be changed to:
    level.php Line 470: $parts = parse_url($current_path);

Viewing 1 replies (of 1 total)
  • Plugin Author Joachim Jensen

    (@intoxstudio)

    Thank you for reporting this.

    That code is there to support WP installs in subdirectories, as well as network installations.

    
    > parse_url('https://wordpress.org/support/topic/little-bug-in-level-php/')
    > array(3) { ["scheme"]=> string(5) "https" ["host"]=> string(13) "wordpress.org" ["path"]=> string(39) "/support/topic/little-bug-in-level-php/" } 
    

    I can see the problem though when there is no subdirectory. Can you try to see if this fixes the issue:

    $pos = isset($parts['path']) ? stripos($current_path, $parts['path']) : 0;
    `

Viewing 1 replies (of 1 total)

The topic ‘little bug in level.php’ is closed to new replies.