#53334 closed task (blessed) (fixed)
Update Requests library to version 1.8.1
Reported by: | jrf | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 5.8 | Priority: | normal |
Severity: | normal | Version: | 5.8 |
Component: | External Libraries | Keywords: | has-patch |
Focuses: | Cc: |
Description
The Requests library has released a new version: 1.8.1.
This is only a very minor update, with the most important change being that the version constant in the Requests
class is now correct 🙄
Full changelog: https://github.com/WordPress/Requests/releases/tag/v1.8.1
Website (updated): https://requests.ryanmccue.info/
It is recommended for WordPress to update the bundled version of Requests.
Attachments (1)
Change History (10)
#3
@
3 years ago
Thanks for the patch!
Just noting that Requests/Transport/cacert.pem
should not be included here, as WordPress has its own bundle of CA root certificates in wp-includes/certificates/ca-bundle.crt, loaded early in wp-includes/class-http.php.
#4
follow-up:
↓ 6
@
3 years ago
@SergeyBiryukov
Thanks for the information. I will update the patch.
#5
@
3 years ago
It also looks like this line should not be removed from Requests/Utility/FilteredIterator.php
:
@phpcs:disable PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.MethodDoubleUnderscore
Removing that causes the PHP compatibility task to fail:
Run phpcs --standard=phpcompat.xml.dist -q --report=checkstyle | cs2pr Warning: Method name "Requests_Utility_FilteredIterator::__unserialize" is discouraged; PHP has reserved all method names with a double underscore prefix for future use. Error: Process completed with exit code 1.
This should probably be reported upstream. cc @jrf
#6
in reply to:
↑ 4
@
3 years ago
So it looks like updating the VERSION
constant would be the only change here, other fixes from 1.8.1 are all in the files not included in WordPress core.
Replying to kapilpaul:
Thanks for the information. I will update the patch.
Thanks! I think that would not be necessary though, I'll make the adjustments on commit :)
#7
@
3 years ago
- Owner set to SergeyBiryukov
- Resolution set to fixed
- Status changed from new to closed
In 51078:
#8
follow-up:
↓ 9
@
3 years ago
So it looks like updating the VERSION constant would be the only change here, other fixes from 1.8.1 are all in the files not included in WordPress core.
Sounds about right 😁
It also looks like this line should not be removed from Requests/Utility/FilteredIterator.php:
@phpcs:disable PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.MethodDoubleUnderscoreRemoving that causes the PHP compatibility task to fail:
Run phpcs --standard=phpcompat.xml.dist -q --report=checkstyle | cs2pr Warning: Method name "Requests_Utility_FilteredIterator::__unserialize" is discouraged; PHP has > reserved all method names with a double underscore prefix for future use. Error: Process completed with exit code 1.This should probably be reported upstream. cc @jrf
@SergeyBiryukov I've looked into this. Both ignore annotations are correct based on the individual project environments.
Requests is already using PHPCS 3.6.0, while WP is still on PHPCS 3.5.5.
The PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames
sniff uses a list maintained in PHPCS itself to determine which method names are "magic" and to exclude those from being reported by the sniff.
The method name __unserialize
became a magic method in PHP 7.4.
The list with magic method names in PHPCS was updated for the PHP 7.4 change in PHPCS 3.5.6.
https://github.com/squizlabs/PHP_CodeSniffer/releases/tag/3.5.6
Conclusion: once WP updates the locked PHPCS version, that particular annotation can be removed from the file in WP as well.
Moving to 5.8 as a follow-up to [50842] / #53101.