From 2e0af4405e2029af5566bf9e293a844160693bad Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Mon, 11 Nov 2013 21:54:10 +0000 Subject: [PATCH] Make HTML tag searches for `` and `
`
 case-insensitive in `make_clickable()`.

Props bpetty.
Fixes #23756.


Built from https://develop.svn.wordpress.org/trunk@26094


git-svn-id: http://core.svn.wordpress.org/trunk@26010 1a063a9b-81f0-0310-95a4-ce76da25c4cd
---
 wp-includes/formatting.php | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php
index fc982cc410..eaa12de7f6 100644
--- a/wp-includes/formatting.php
+++ b/wp-includes/formatting.php
@@ -1170,7 +1170,7 @@ function convert_chars($content, $deprecated = '') {
  */
 function balanceTags( $text, $force = false ) {
 	if ( $force || get_option('use_balanceTags') == 1 ) {
-		$balance_tags_delimiters = apply_filters( 'balance_tags_delimiters', array( '', '' ) ); 
+		$balance_tags_delimiters = apply_filters( 'balance_tags_delimiters', array( '', '' ) );
 		// Capture lets PREG_SPLIT_DELIM_CAPTURE return the delimiters
 		$delimiters_regex = '/(' . implode( '|', $balance_tags_delimiters ) . ')/';
 		$parts = preg_split( $delimiters_regex, $text, -1, PREG_SPLIT_DELIM_CAPTURE );
@@ -1609,9 +1609,9 @@ function make_clickable( $text ) {
 	$nested_code_pre = 0; // Keep track of how many levels link is nested inside 
 or 
 	foreach ( $textarr as $piece ) {
 
-		if ( preg_match( '|^]|', $piece ) || preg_match( '|^]|', $piece ) )
+		if ( preg_match( '|^]|i', $piece ) || preg_match( '|^]|i', $piece ) )
 			$nested_code_pre++;
-		elseif ( ( '' === $piece || '
' === $piece ) && $nested_code_pre ) + elseif ( ( '
' === strtolower( $piece ) || '
' === strtolower( $piece ) ) && $nested_code_pre ) $nested_code_pre--; if ( $nested_code_pre || empty( $piece ) || ( $piece[0] === '<' && ! preg_match( '|^<\s*[\w]{1,20}+://|', $piece ) ) ) {