Commit Graph

1 Commits

Author SHA1 Message Date
hellofromTonya
eff9f72714 HTTP API: Adds BC-layer /library/Requests.php file.
When the Requests 2.0.0 [7ef0774f0b/src/Autoload.php (L141-L143) autoloader detects the older (deprecated) `Requests` class], it attempts to load [https://github.com/WordPress/Requests/blob/v2.0.0/library/Requests.php its `/library/Requests.php` file]. Prior to this commit, this file did not exist in Core. Thus, a fatal error happened.

Why not change Requests Autoloader?
Requests is an external dependency that Core consumes. It is also used by other projects outside of Core. Thus, Core needs a fix to guard itself to prevent a fatal error.

The fix:
* Adds the missing `wp-includes/Requests/library/Requests.php` file, which then loads the `wp-includes/class-requests.php` (which will throw a deprecation notice to alert developers to upgrade).
* Adds a test.

Follow-up to [54997].

Props bjorsch, costdev, jrf, mukesh27, peterwilsoncc, ironprogrammer, hellofromTonya.
Fixes #57341.
Built from https://develop.svn.wordpress.org/trunk@55007


git-svn-id: http://core.svn.wordpress.org/trunk@54540 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2022-12-19 15:12:11 +00:00