Asset CDN: support badly formatted data returned by W.org#45387
Asset CDN: support badly formatted data returned by W.org#45387
Conversation
Fixes #45386 This should avoid errors like this one: ``` An error of type E_ERROR was caused in line 298 of the file wp-content/plugins/jetpack/modules/photon-cdn.php. Error message: Uncaught TypeError: array_keys(): Argument #1 ($array) must be of type array, null given in wp-content/plugins/jetpack/modules/photon-cdn.php:298 ``` Co-authored-by: toothybrando@users.noreply.github.com
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! Jetpack plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
Code Coverage SummaryCoverage changed in 1 file.
|
|
Apologies @jeherve. For some reason I missed the review request. Changes look good though 😅 |
Fixes #45386 This should avoid errors like this one: ``` An error of type E_ERROR was caused in line 298 of the file wp-content/plugins/jetpack/modules/photon-cdn.php. Error message: Uncaught TypeError: array_keys(): Argument #1 ($array) must be of type array, null given in wp-content/plugins/jetpack/modules/photon-cdn.php:298 ``` Co-authored-by: toothybrando@users.noreply.github.com
Fixes #45386
Proposed changes:
This should avoid errors like this one:
Other information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions:
This is not easy to reproduce, but I think a code review may be enough since this is just adding an extra check around the type of data we're processing.