Skip to content

Instantly share code, notes, and snippets.

@dhaval-parekh
Created October 4, 2022 07:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dhaval-parekh/d52bfcf66202ff2d8ae1784364350814 to your computer and use it in GitHub Desktop.
Save dhaval-parekh/d52bfcf66202ff2d8ae1784364350814 to your computer and use it in GitHub Desktop.
FIx: Undefined array key “path” in class-change-wp-admin-login.php
Index: includes/class-change-wp-admin-login.php
===================================================================
--- includes/class-change-wp-admin-login.php (revision 2793845)
+++ includes/class-change-wp-admin-login.php (working copy)
@@ -283,7 +283,8 @@
wp_die( __( 'This feature is not enabled.', 'change-wp-admin-login' ) );
}
- $request = parse_url( $_SERVER['REQUEST_URI'] );
+ $request = parse_url( $_SERVER['REQUEST_URI'] );
+ $request['path'] = ( ! empty( $request['path'] ) ) ? $request['path'] : '';
if ( (
strpos( $_SERVER['REQUEST_URI'], 'wp-login.php' ) !== false ||
@nfsarmento
Copy link

Patch is wrong and untested. The latest version of the plugin has the fix for all php8 warnings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment