Ticket #28564: miqro-28564.patch
File miqro-28564.patch, 2.5 KB (added by , 10 years ago) |
---|
-
src/wp-includes/formatting.php
203 203 . '|' 204 204 . '\[' // Find start of shortcode. 205 205 . '\[?' // Shortcodes may begin with [[ 206 . '[^\[\] <>]+' // Shortcodes do not contain other shortcodes or HTML elements.206 . '[^\[\]]+' // Shortcodes do not contain other shortcodes. HTML recursion is permitted, but not texturized. 207 207 . '\]' // Find end of shortcode. 208 208 . '\]?' // Shortcodes may end with ]] 209 209 . ')/s'; … … 220 220 _wptexturize_pushpop_element( $curl, $no_texturize_tags_stack, $no_texturize_tags, '<', '>' ); 221 221 } 222 222 223 } elseif ( '[' === $first && 1 === preg_match( '/^\[[^\[\] <>]+\]$/', $curl ) ) {223 } elseif ( '[' === $first && 1 === preg_match( '/^\[[^\[\]]+\]$/', $curl ) ) { 224 224 // This is a shortcode delimeter. 225 225 226 226 _wptexturize_pushpop_element( $curl, $no_texturize_shortcodes_stack, $no_texturize_shortcodes, '[', ']' ); 227 227 228 } elseif ( '[' === $first && 1 === preg_match( '/^\[\[?[^\[\] <>]+\]\]?$/', $curl ) ) {228 } elseif ( '[' === $first && 1 === preg_match( '/^\[\[?[^\[\]]+\]\]?$/', $curl ) ) { 229 229 // This is an escaped shortcode delimeter. 230 230 231 231 // Do not texturize. -
tests/phpunit/tests/formatting/WPTexturize.php
1186 1186 '[code]...[/code]]...', // This test would not pass in 3.9 because the extra brace was always ignored by texturize. 1187 1187 ), 1188 1188 array( 1189 '[gal>ery ...]', // This is a potentially usable shortcode. 1189 1190 '[gal>ery ...]', 1190 '[gal>ery …]',1191 1191 ), 1192 1192 array( 1193 1193 '[gallery ...', … … 1194 1194 '[gallery …', 1195 1195 ), 1196 1196 array( 1197 '[gallery <br ... /> ...]', // This tag is still valid. Shortcode 'attributes' are not considered in the initial parsing of shortcodes, and HTML is allowed. 1197 1198 '[gallery <br ... /> ...]', 1198 '[gallery <br ... /> …]',1199 1199 ), 1200 1200 array( 1201 1201 '<br [gallery ...] ... />', … … 1234 1234 '[/gallery ...]]', 1235 1235 ), 1236 1236 array( 1237 '[[gallery <br ... /> ...]]', // This gets parsed as an escaped shortcode with embedded HTML. Brains may explode. 1237 1238 '[[gallery <br ... /> ...]]', 1238 '[[gallery <br ... /> …]]',1239 1239 ), 1240 1240 array( 1241 1241 '<br [[gallery ...]] ... />',