Opened 11 years ago
Closed 11 years ago
#28807 closed defect (bug) (duplicate)
json_encode result checking in plugin updater
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.9.1 |
Component: | Plugins | Keywords: | |
Focuses: | administration | Cc: |
Description
wp-includes/udpate.php has API request generating from line 266
$options = array( ... 'body' => array( 'plugins' => json_encode( $to_send ), 'translations' => json_encode( $translations ), 'locale' => json_encode( $locales ), ), ...
If plugins array $to_send contain non-UTF symbols
(you can check i.e. on this plugin http://wordpress.org/plugins/tinymce-and-tinymce-advanced-professsional-formats-and-styles, where author name is "David Stöckl") json_encode function return false (instead of throwing error in log) and WP sending empty line to API and got error response.
$options[body][plugins]
As debug I put json_last_error/json_last_error_msg functions and getting
"JSON_ERROR_UTF8 - Malformed UTF-8 characters, possibly incorrectly" error.
I think extra checks needed after json_encode functions and before sending request.
I got this issue on plugins update checking but sure its possible on themes also.
Related issue https://bugs.php.net/bug.php?id=47494 - not a bug
Change History (7)
#3
@
11 years ago
- Component changed from Upgrade/Install to Plugins
- Focuses administration added
- Milestone changed from Awaiting Review to 4.0
but better solution probably could be extra plugins array handling (symbols escaping etc)