Opened 14 years ago
Closed 13 years ago
#18051 closed defect (bug) (fixed)
Automatic updates fail if PHP/Mysql versions contain spaces
Reported by: | vtd | Owned by: | dd32 |
---|---|---|---|
Milestone: | 3.3 | Priority: | normal |
Severity: | normal | Version: | 3.2 |
Component: | Upgrade/Install | Keywords: | has-patch |
Focuses: | Cc: |
Description
If the URL for checking for updates includes spaces (it does if PHP version is "5.2.5 (x64)", for example), then the check for updates fails (
wp_remote_get($url, $options)
in update.php returns HTTP 400 Bad Request error, making automatic updates impossible (Wordpreess always says it's up to date). This can be fixed by processing PHP and MySQL versions with urlencode(), so the url-formation line in updater.php should look like his
$url = "http://api.wordpress.org/core/version-check/1.6/?version=". urlencode($wp_version). "&php=".urlencode($php_version). "&locale=$locale&mysql=".urlencode($mysql_version). "&local_package=$local_package&blogs=$num_blogs&users={$user_count['total_users']}&multisite_enabled=$multisite_enabled";
Attachments (1)
Change History (10)
#3
in reply to:
↑ 2
@
14 years ago
Example:
Before: string(171) "http://api.wordpress.org/core/version-check/1.6/?version=3.3-aortic-dissection&php=5.2.5 (x64)&locale=en_US&mysql=5.1.51&local_package=&blogs=1&users=1&multisite_enabled=0" After: string(175) "http://api.wordpress.org/core/version-check/1.6/?version=3.3-aortic-dissection&php=5.2.5+%28x64%29&locale=en_US&mysql=5.1.51&local_package=&blogs=1&users=1&multisite_enabled=0"
#4
follow-up:
↓ 6
@
14 years ago
Indeed the HTTP API isn't behaving like browsers, it's making the request directly with the url passed to it, whilst browsers do a bit of urlencoding over the contents if it sees anything unencoded.
the urlencode() addition here to the update check seems like the most appropriate response.
#6
in reply to:
↑ 4
@
13 years ago
- Cc kpayne@… added
Replying to dd32:
the urlencode() addition here to the update check seems like the most appropriate response.
Are you looking for something like 18051.diff?
#7
@
13 years ago
- Keywords has-patch added; needs-patch removed
- Milestone changed from Awaiting Review to 3.3
Not a WP.org issue - looks like the HTTP API is choking.