#58563 closed defect (bug) (fixed)
Undefined variable $checkout in class-wp-automatic-updater.php line 175
Reported by: | jqz | Owned by: | SergeyBiryukov |
---|---|---|---|
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.
16 months ago
#1
- Keywords has-patch has-unit-tests added
#2
follow-up:
↓ 5
@
16 months 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
@
16 months 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.
16 months ago
#5
in reply to:
↑ 2
;
follow-up:
↓ 6
@
16 months ago
- Keywords reporter-feedback removed
Replying to costdev:
@jqz Can you provide your
open_basedir
directive (anonymized if necessary), and the value of theABSPATH
constant? 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 returnfalse
for 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
@
16 months 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/plugins
D:\webs\localhost\example.co.uk\sites\ofs3/content
D:\webs\localhost\example.co.uk\sites\ofs3
D:\webs\localhost\example.co.uk\sites
D:\webs\localhost\example.co.uk
D:\webs\localhost
D:\webs
D:\
D:\webs\localhost\example.co.uk\sites\ofs3\wordpress
#7
follow-up:
↓ 10
@
16 months 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.
#8
@
16 months ago
- Owner set to SergeyBiryukov
- Resolution set to fixed
- Status changed from new to closed
In 56124:
@SergeyBiryukov commented on PR #4630:
16 months ago
#9
Thanks for the PR! Merged in r56124.
#10
in reply to:
↑ 7
@
16 months ago
- Keywords dev-feedback removed
Replying to costdev:
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?
Yes, please, let's create a new ticket for that :) Thanks!
Hi @jqz, thanks for opening this ticket!
Looks like there's two issues to resolve here:
$checkout
variable isn't initialized and, as the loop's early exit can prevent assignment to$checkout
, this can be undefined by the time it reaches thereturn
statement.WP_Automatic_Updater::is_allowed_dir()
can returnfalse
for all directories on Windows, includingABSPATH
.@jqz Can you provide your
open_basedir
directive (anonymized if necessary), and the value of theABSPATH
constant? Thanks!Version
to6.2
.6.3
for visibility.@audrasjb @SergeyBiryukov Should this be milestoned for 6.2.3, or are we unlikely to land that before 6.3 is released?