Title: Error in Hide Backend Function
Last modified: March 22, 2017

---

# Error in Hide Backend Function

 *  [Kyle](https://wordpress.org/support/users/kylewlawrence/)
 * (@kylewlawrence)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/error-in-hide-backend-function/)
 * Hi,
 * There is an error in the PHP for the Class to hide the backend. Here is the error:
   `
   Undefined index: path in /public_html/wp-content/plugins/better-wp-security/core/
   modules/hide-backend/class-itsec-hide-backend.php on line 185`
 * This doesn’t always occur, but clearly sometimes the $_SERVER[‘REQUEST_URI’] 
   value does not always return a ‘path’ in the array when parse_url is used. Could
   this be fixed to keep the log file clean so that we can be secure by monitoring
   our logs?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [pronl](https://wordpress.org/support/users/pronl/)
 * (@pronl)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/error-in-hide-backend-function/#post-8943238)
 * [@kylewlawrence](https://wordpress.org/support/users/kylewlawrence/)
 * > … but clearly sometimes the $_SERVER[‘REQUEST_URI’] value does not always return
   > a ‘path’ in the array when parse_url is used.
 * Hmm, the code should check whether the path array key exists before using it …
 * Is there any chance you can find out whether this is happening because:
 * a. the $_SERVER[‘REQUEST_URI’] url does not contain a path,
    b. the parse_url()
   command is failing to return an array with the path key c. the parse_url() command
   returns false due a malformed url ?
 * What web server, server platform and php versions are you using ?
 *  [pronl](https://wordpress.org/support/users/pronl/)
 * (@pronl)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/error-in-hide-backend-function/#post-8943375)
 * [@kylewlawrence](https://wordpress.org/support/users/kylewlawrence/)
 * Anyway changing line 181 and 185 in the better-wp-security/core/modules/hide-
   backend/class-itsec-hide-backend.php file:
 *     ```
       $url_info = parse_url( $_SERVER['REQUEST_URI'] );
       ...
       if ( $url_info['path'] === $login_path || $url_info['path'] === $login_path_trailing_slash ) {
       ```
   
 * into:
 *     ```
       $url_path = parse_url( $_SERVER['REQUEST_URI'], PHP_URL_PATH );
       ...
       if ( $url_path === $login_path || $url_path === $login_path_trailing_slash ) {
       ```
   
 * will prevent the error from reoccurring.
    -  This reply was modified 9 years, 1 month ago by [pronl](https://wordpress.org/support/users/pronl/).
      Reason: Code edit for improved readability
 *  Thread Starter [Kyle](https://wordpress.org/support/users/kylewlawrence/)
 * (@kylewlawrence)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/error-in-hide-backend-function/#post-8948903)
 * Thanks [@pronl](https://wordpress.org/support/users/pronl/). Is there some iThemes
   Security staff that will update this in the next release?

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Error in Hide Backend Function’ is closed to new replies.

 * ![](https://ps.w.org/better-wp-security/assets/icon.svg?rev=3529351)
 * [Kadence Security – Password, Two Factor Authentication, and Brute Force Protection](https://wordpress.org/plugins/better-wp-security/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/better-wp-security/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/better-wp-security/)
 * [Active Topics](https://wordpress.org/support/plugin/better-wp-security/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/better-wp-security/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/better-wp-security/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Kyle](https://wordpress.org/support/users/kylewlawrence/)
 * Last activity: [9 years, 1 month ago](https://wordpress.org/support/topic/error-in-hide-backend-function/#post-8948903)
 * Status: not resolved