mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-14 09:34:41 +00:00
Code Modernization: Use str_starts_with() in WP_REST_Server::serve_request().
Follow-up to [55703], [56834]. See #59650. git-svn-id: https://develop.svn.wordpress.org/trunk@57126 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -480,7 +480,7 @@ class WP_REST_Server {
|
||||
* Send no-cache headers if $send_no_cache_headers is true,
|
||||
* OR if the HTTP_X_HTTP_METHOD_OVERRIDE is used but resulted a 4xx response code.
|
||||
*/
|
||||
if ( $send_no_cache_headers || ( true === $method_overridden && strpos( $code, '4' ) === 0 ) ) {
|
||||
if ( $send_no_cache_headers || ( true === $method_overridden && str_starts_with( $code, '4' ) ) ) {
|
||||
foreach ( wp_get_nocache_headers() as $header => $header_value ) {
|
||||
if ( empty( $header_value ) ) {
|
||||
$this->remove_header( $header );
|
||||
|
||||
Reference in New Issue
Block a user