Skip to content

Commit 2e412ce

Browse files
committed
Use string type check before passing into in_default_dir()
1 parent 4edd331 commit 2e412ce

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/wp-includes/class-wp-scripts.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,8 @@ public function do_item( $handle, $group = false ) {
374374
$filtered_src = apply_filters( 'script_loader_src', $src, $handle );
375375

376376
if (
377-
$this->in_default_dir( $filtered_src )
377+
is_string( $filtered_src )
378+
&& $this->in_default_dir( $filtered_src )
378379
&& ( $before_script || $after_script || $translations_stop_concat || $this->is_delayed_strategy( $strategy ) )
379380
) {
380381
$this->do_concat = false;

src/wp-includes/class-wp-styles.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ public function do_item( $handle, $group = false ) {
183183
}
184184

185185
if ( $this->do_concat ) {
186-
if ( $src && $this->in_default_dir( $src ) && ! isset( $obj->extra['alt'] ) ) {
186+
if ( is_string( $src ) && $this->in_default_dir( $src ) && ! isset( $obj->extra['alt'] ) ) {
187187
$this->concat .= "$handle,";
188188
$this->concat_version .= "$handle$ver";
189189

0 commit comments

Comments
 (0)