Skip to content

Commit 8cc52a2

Browse files
westonrutersirreal
andcommitted
Use is_readable() instead of error suppression
Co-authored-by: Jon Surrell <[email protected]>
1 parent ce80e7a commit 8cc52a2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/wp-includes/script-loader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3130,8 +3130,7 @@ static function ( $a, $b ) {
31303130
}
31313131

31323132
// Get the styles if we don't already have them.
3133-
$style['css'] = @file_get_contents( $style['path'] );
3134-
if ( false === $style['css'] ) {
3133+
if ( ! is_readable( $style['path'] ) ) {
31353134
_doing_it_wrong(
31363135
__FUNCTION__,
31373136
sprintf(
@@ -3145,6 +3144,7 @@ static function ( $a, $b ) {
31453144
);
31463145
continue;
31473146
}
3147+
$style['css'] = file_get_contents( $style['path'] );
31483148

31493149
/*
31503150
* Check if the style contains relative URLs that need to be modified.

0 commit comments

Comments
 (0)