Code Modernization: Use `str_starts_with()` in `WP_REST_Server::serve_request()`.

Follow-up to [55703], [56834].

See #59650.
Built from https://develop.svn.wordpress.org/trunk@57126


git-svn-id: http://core.svn.wordpress.org/trunk@56637 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2023-11-18 20:46:28 +00:00
parent 79794005b1
commit c3d10ec052
2 changed files with 2 additions and 2 deletions

View File

@ -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 );

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.5-alpha-57125';
$wp_version = '6.5-alpha-57126';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.