Opened 6 years ago
Closed 6 years ago
#45696 closed defect (bug) (duplicate)
Undefined index: pagenow notice from php
Reported by: | drtonyb | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | minor | Version: | 5.0.1 |
Component: | Login and Registration | Keywords: | |
Focuses: | Cc: |
Description
I am running my development WordPress environment in debug mode and have noticed that since the release of WordPress 5.0, I have been seeing this when my login expires and I'm requested to login again:
Notice: undefined index: pagenow in ...\wordpress\wp-includes\l10n.php on line 141
This doesn't occur when I login normally at wp-login.php, only if my login expires and I'm asked to login again.
I can see that this is new code for version 5 and line 141 is
<?php if ( ! empty( $_GET['wp_lang'] ) && 'wp-login.php' === $GLOBALS['pagenow'] ) {
Testing a value in an array without checking that the indexed value is actually defined is poor programming practice unless you can be guaranteed that it will be defined.
Obviously this is not the case here, so $GLOBALS['pagenow']
shouldn't be accessed unless it is known to be not empty.
Duplicate of #45668.
Thank you for the bug report, @drtonyb!
We've fixed this notice in WordPress 5.0.2, which will be released tomorrow. 🙂