From a696e508ad5d3566b447fc48f355e91953a17c4a Mon Sep 17 00:00:00 2001 From: Alain Schlesser Date: Fri, 26 Oct 2018 00:08:06 +0200 Subject: [PATCH] Fix usage of `preg_quote()` (#10998) The end tag pattern is currently generated like this: ``` $end_tag_pattern = '//'; ``` Instead of separately using a string replace to replace `/` with `\/`, it is preferable to use the second argument `$delimiter` that the `preg_quote()` function provides. See http://php.net/manual/en/function.preg-quote.php --- lib/blocks.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/blocks.php b/lib/blocks.php index a08ce4818465d..6ef34c4176eef 100644 --- a/lib/blocks.php +++ b/lib/blocks.php @@ -232,7 +232,7 @@ function do_blocks( $content ) { $inner_content = ''; if ( ! $is_self_closing ) { - $end_tag_pattern = '//'; + $end_tag_pattern = '//'; if ( ! preg_match( $end_tag_pattern, $content, $block_match_end, PREG_OFFSET_CAPTURE ) ) { // If no closing tag is found, abort all matching, and continue // to append remainder of content to rendered output.