Title: little bug in level.php
Last modified: August 3, 2020

---

# little bug in level.php

 *  Resolved [oruoss](https://wordpress.org/support/users/oruoss/)
 * (@oruoss)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/little-bug-in-level-php/)
 * 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](https://wordpress.org/support/users/intoxstudio/)
 * (@intoxstudio)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/little-bug-in-level-php/#post-13259310)
 * 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.

 * ![](https://ps.w.org/restrict-user-access/assets/icon-256x256.png?rev=1815922)
 * [Restrict User Access - Ultimate Membership & Content Protection](https://wordpress.org/plugins/restrict-user-access/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/restrict-user-access/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/restrict-user-access/)
 * [Active Topics](https://wordpress.org/support/plugin/restrict-user-access/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/restrict-user-access/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/restrict-user-access/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Joachim Jensen](https://wordpress.org/support/users/intoxstudio/)
 * Last activity: [5 years, 9 months ago](https://wordpress.org/support/topic/little-bug-in-level-php/#post-13259310)
 * Status: resolved