Skip to content

Commit ba14c36

Browse files
committed
Improve function description and further trim route
1 parent 4a8dc16 commit ba14c36

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

plugins/image-prioritizer/helper.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ static function ( $host ) {
264264
}
265265

266266
/**
267-
* Filters the response before executing any REST API callbacks.
267+
* Sanitizes the lcpElementExternalBackgroundImage property from the request URL Metric storage request.
268268
*
269269
* This removes the lcpElementExternalBackgroundImage from the URL Metric prior to it being stored if the background
270270
* image URL is not valid. Removal of the property is preferable to invalidating the entire URL Metric because then
@@ -288,8 +288,8 @@ function image_prioritizer_filter_rest_request_before_callbacks( $response, arra
288288
if (
289289
$request->get_method() !== 'POST'
290290
||
291-
// The strtolower() is due to \WP_REST_Server::match_request_to_handler() using case-insensitive pattern match.
292-
OD_REST_API_NAMESPACE . OD_URL_METRICS_ROUTE !== strtolower( trim( $request->get_route(), '/' ) )
291+
// The strtolower() is due to \WP_REST_Server::match_request_to_handler() using case-insensitive pattern match.
292+
OD_REST_API_NAMESPACE . OD_URL_METRICS_ROUTE !== trim( strtolower( trim( $request->get_route(), '/' ) ) )
293293
) {
294294
return $response;
295295
}

0 commit comments

Comments
 (0)