Changeset 28852
- Timestamp:
- 06/26/2014 05:14:47 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/formatting.php
r28831 r28852 199 199 . '.+?--\s*>' // Find end of comment 200 200 . '|' 201 . ' .+?>'// Find end of element201 . '[^>]+>' // Find end of element 202 202 . ')' 203 203 . '|' … … 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. … … 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 -
trunk/tests/phpunit/tests/formatting/WPTexturize.php
r28831 r28852 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 ), 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]', 1307 1323 ), 1308 1324 );
Note: See TracChangeset
for help on using the changeset viewer.