Skip to content

Commit

Permalink
add minor regex improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
dilipbheda committed Jan 10, 2025
1 parent ffa4958 commit 6bc9463
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/wp-includes/functions.wp-scripts.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ function wp_add_inline_script( $handle, $data, $position = 'after' ) {
),
'4.5.0'
);
$data = trim( preg_replace( '#<script[^>]*>(.*?)</script>|<script[^>]*>#is', '$1', $data ) );
$data = trim( preg_replace( '#<script[^>]*>(.*)</script>|<script[^>]*>#is', '$1', $data ) );
}

return wp_scripts()->add_inline_script( $handle, $data, $position );
Expand Down

0 comments on commit 6bc9463

Please sign in to comment.