From 3b3fb72ce376c0573f459af4341df8a7736e7d26 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Tue, 17 Jun 2014 18:07:14 +0000 Subject: [PATCH] Add unit tests to confirm that `---` is properly converted to `—` by `wptexturize()` where appropriate. Props miqrogroove. Fixes #28483. Built from https://develop.svn.wordpress.org/trunk@28763 git-svn-id: http://core.svn.wordpress.org/trunk@28576 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/formatting.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index ab3be7a76c..d71924fdd1 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -274,6 +274,8 @@ function _wptexturize_pushpop_element($text, &$stack, $disabled_elements, $openi array_push($stack, $matches[1]); } + } elseif ( 0 == count( $stack ) ) { + // Stack is empty. Just stop. } else { // Closing? Check $text+2 against disabled elements $c = preg_quote($closing, '/');