Skip to content

Commit eebbe92

Browse files
authored
Prevent PHP fatal on malformed style source with style_loader_src hook (#45621)
1 parent 3e036f2 commit eebbe92

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: patch
2+
Type: other
3+
4+
Prevent PHP error when handling malformed style source.

projects/plugins/jetpack/class.jetpack.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5122,7 +5122,7 @@ public static function maybe_min_asset( $url, $path, $plugin ) {
51225122
* @return mixed
51235123
*/
51245124
public static function set_suffix_on_min( $src, $handle ) {
5125-
if ( ! str_contains( $src, '.min.css' ) ) {
5125+
if ( ! is_string( $src ) || ! str_contains( $src, '.min.css' ) ) {
51265126
return $src;
51275127
}
51285128

0 commit comments

Comments
 (0)