#58563 closed defect (bug) (fixed)
Undefined variable $checkout in class-wp-automatic-updater.php line 175
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 6.3 | Priority: | normal |
| Severity: | normal | Version: | 6.2 |
| Component: | Upgrade/Install | Keywords: | has-patch has-unit-tests |
| Focuses: | Cc: |
Description
Fresh install on Windows with open_basedir in effect to limit filesystem access beyond the site itself.
See βhttps://wordpress.org/support/topic/undefined-variable-checkout
If is_allowed_dir() doesn't get any true responses, $checkout never gets initialized, and this error occurs.
Change History (10)
This ticket was mentioned in βPR #4630 on βWordPress/wordpress-develop by β@costdev.
3 years ago
#1
- Keywords has-patch has-unit-tests added
#2
follow-up:
βΒ 5
@
3 years ago
- Focuses coding-standards removed
- Keywords reporter-feedback needs-testing-info needs-testing added
- Milestone changed from Awaiting Review to 6.3
- Version changed from 6.2.2 to 6.2
#3
@
3 years ago
Let's keep it in milestone 6.3 until it's committed. Then we can milestone it to 6.2.3 with fixed-major workflow keyword and eventually β if 6.2.3 is confirmed β we can plan to backport it :)
This ticket was mentioned in βSlack in #core-upgrade-install by costdev. βView the logs.
3 years ago
#5
in reply to:
βΒ 2
;
follow-up:
βΒ 6
@
3 years ago
- Keywords reporter-feedback removed
Replying to costdev:
@jqz Can you provide your
open_basedirdirective (anonymized if necessary), and the value of theABSPATHconstant? Thanks!
This are the relevant settings:
- ABSPATH:
D:\webs\localhost\example.co.uk\sites\ofs3\wordpress/ - WP_CONTENT_DIR:
D:\webs\localhost\example.co.uk\sites\ofs3/content - DOCUMENT_ROOT:
D:/webs/localhost/example.co.uk - open_basedir:
D:/webs/localhost/example.co.uk/sites/ofs3/;C:\WINDOWS\TEMP/;d:/webs/localhost/
- That
WP_Automatic_Updater::is_allowed_dir()can returnfalsefor all directories on Windows, includingABSPATH.
Looks like WP_Automatic_Updater::is_allowed_dir() is not accounting for case insensitivity of Windows filenames, nor that the path separator can be either \ or /.
#6
in reply to:
βΒ 5
@
3 years ago
Replying to jqz:
This are the relevant settings:
- ABSPATH:
D:\webs\localhost\example.co.uk\sites\ofs3\wordpress/- WP_CONTENT_DIR:
D:\webs\localhost\example.co.uk\sites\ofs3/content- open_basedir:
D:/webs/localhost/example.co.uk/sites/ofs3/;C:\WINDOWS\TEMP/;d:/webs/localhost/
$check_dirs contains the following (which have different directory separators and casedness of drive letter):
D:\webs\localhost\example.co.uk\sites\ofs3/content/pluginsD:\webs\localhost\example.co.uk\sites\ofs3/contentD:\webs\localhost\example.co.uk\sites\ofs3D:\webs\localhost\example.co.uk\sitesD:\webs\localhost\example.co.ukD:\webs\localhostD:\websD:\D:\webs\localhost\example.co.uk\sites\ofs3\wordpress
#7
follow-up:
βΒ 10
@
3 years ago
- Keywords dev-feedback added; needs-testing-info needs-testing removed
Thanks a lot @jqz!
@audrasjb I'm thinking that βPR 4630 could be committed in 6.3. Since this ticket is specifically about the $checkout variable's definition being dependent on a foreach loop, the PR targets this issue and includes PHPUnit tests, and so this ticket could be closed after the PR is committed.
We could then take the information from @jqz into a separate ticket to focus on investigating and resolving the Windows-specific issue that exposed the undefined $checkout. What do you think?
For now, I'm removing needs-testing and needs-testing-info, as this pertains to the Windows-specific issue, which may be separated into a different ticket.
Hi @jqz, thanks for opening this ticket!
Looks like there's two issues to resolve here:
$checkoutvariable isn't initialized and, as the loop's early exit can prevent assignment to$checkout, this can be undefined by the time it reaches thereturnstatement.WP_Automatic_Updater::is_allowed_dir()can returnfalsefor all directories on Windows, includingABSPATH.@jqz Can you provide your
open_basedirdirective (anonymized if necessary), and the value of theABSPATHconstant? Thanks!Versionto6.2.6.3for visibility.@audrasjb @SergeyBiryukov Should this be milestoned for 6.2.3, or are we unlikely to land that before 6.3 is released?