Ticket #28564: miqro-28564-part2.2.patch
File miqro-28564-part2.2.patch, 2.6 KB (added by , 10 years ago) |
---|
-
src/wp-includes/formatting.php
198 198 . '(?(?=!--)' // Is this a comment? 199 199 . '.+?--\s*>' // Find end of comment 200 200 . '|' 201 . ' .+?>'// Find end of element201 . '[^>]+>' // Find end of element 202 202 . ')' 203 203 . '|' 204 204 . '\[' // Find start of shortcode. … … 206 206 . '(?:' 207 207 . '[^\[\]<>]' // Shortcodes do not contain other shortcodes. 208 208 . '|' 209 . '< .+?>' // HTML elements permitted. Prevents matching ] before >.209 . '<[^>]+>' // HTML elements permitted. Prevents matching ] before >. 210 210 . ')+' 211 211 . '\]' // Find end of shortcode. 212 212 . '\]?' // Shortcodes may end with ]] … … 224 224 _wptexturize_pushpop_element( $curl, $no_texturize_tags_stack, $no_texturize_tags ); 225 225 } 226 226 227 } elseif ( '[' === $first && 1 === preg_match( '/^\[(?:[^\[\]<>]|< .+?>)+\]$/', $curl ) ) {227 } elseif ( '[' === $first && 1 === preg_match( '/^\[(?:[^\[\]<>]|<[^>]+>)+\]$/', $curl ) ) { 228 228 // This is a shortcode delimeter. 229 229 230 230 _wptexturize_pushpop_element( $curl, $no_texturize_shortcodes_stack, $no_texturize_shortcodes ); 231 231 232 } elseif ( '[' === $first && 1 === preg_match( '/^\[\[?(?:[^\[\]<>]|< .+?>)+\]\]?$/', $curl ) ) {232 } elseif ( '[' === $first && 1 === preg_match( '/^\[\[?(?:[^\[\]<>]|<[^>]+>)+\]\]?$/', $curl ) ) { 233 233 // This is an escaped shortcode delimeter. 234 234 235 235 // Do not texturize. -
tests/phpunit/tests/formatting/WPTexturize.php
1305 1305 'word <img src="http://example.com/wp-content/uploads/2014/06/image-300x216.gif" /> word', // Ensure we are not corrupting image URLs. 1306 1306 'word <img src="http://example.com/wp-content/uploads/2014/06/image-300x216.gif" /> word', 1307 1307 ), 1308 array( 1309 '[ do texturize "[quote]" here ]', 1310 '[ do texturize “[quote]” here ]', 1311 ), 1312 array( 1313 '[ regex catches this <a href="[quote]">here</a> ]', 1314 '[ regex catches this <a href="[quote]">here</a> ]', 1315 ), 1316 array( 1317 '[ but also catches the <b>styled "[quote]" here</b> ]', 1318 '[ but also catches the <b>styled “[quote]” here</b> ]', 1319 ), 1320 array( 1321 '[Let\'s get crazy<input>[plugin code="<a href=\'?a[]=100\'>hello</a>"]</input>world]', 1322 '[Let’s get crazy<input>[plugin code="<a href=\'?a[]=100\'>hello</a>"]</input>world]', 1323 ), 1308 1324 ); 1309 1325 } 1310 1326