Make WordPress Core

Ticket #23855: 23855.2.patch

File 23855.2.patch, 997 bytes (added by TobiasBg, 11 years ago)

Refreshed patch

  • src/wp-includes/shortcodes.php

     
    155155 * @return boolean
    156156 */
    157157function has_shortcode( $content, $tag ) {
     158        if ( false === strpos( $content, '[' ) ) {
     159                return false;
     160        }
     161
    158162        if ( shortcode_exists( $tag ) ) {
    159163                preg_match_all( '/' . get_shortcode_regex() . '/s', $content, $matches, PREG_SET_ORDER );
    160164                if ( empty( $matches ) )
     
    186190function do_shortcode($content) {
    187191        global $shortcode_tags;
    188192
     193        if ( false === strpos( $content, '[' ) ) {
     194                return false;
     195        }
     196
    189197        if (empty($shortcode_tags) || !is_array($shortcode_tags))
    190198                return $content;
    191199
     
    375383function strip_shortcodes( $content ) {
    376384        global $shortcode_tags;
    377385
     386        if ( false === strpos( $content, '[' ) ) {
     387                return false;
     388        }
     389
    378390        if (empty($shortcode_tags) || !is_array($shortcode_tags))
    379391                return $content;
    380392