Make WordPress Core

Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#8962 closed defect (bug) (duplicate)

get_shortcode_regex probrem

Reported by: smilkobuta's profile smilkobuta Owned by:
Milestone: Priority: high
Severity: normal Version: 2.7
Component: General Keywords:
Focuses: Cc:


Long articles is not displayed because of get_shortcode_regex function.
this function is invoked by wpautop function, and maybe preg_replace can't perform a regular expression which generated in get_shortcode_regex.

This is wpauto code(there is no probrem).

    $pee = preg_replace('/<p>\s*?(' . get_shortcode_regex() . ')\s*<\/p>/s', '$1', $pee); // don't auto-p wrap shortcodes that stand alone

Here is modified code.

function get_shortcode_regex() {
	global $shortcode_tags;
	$tagnames = array_keys($shortcode_tags);
	$tagregexp = join( '|', array_map('preg_quote', $tagnames) );

//	return '\[('.$tagregexp.')\b(.*?)(?:(\/)?\](?:(.+?)\[\/\1\])?';
    return '\[('.$tagregexp.')\b([^\]]*?)(\/)?\](?:(.+?)\[\/\1\])?';

This modification was written by following blog.

Change History (3)

#1 @mrmist
14 years ago

  • Version set to 2.7

See #8553 and related.

#2 @Denis-de-Bernardy
14 years ago

  • Resolution set to duplicate
  • Status changed from new to closed

#3 @mrmist
14 years ago

  • Milestone 2.7.1 deleted
Note: See TracTickets for help on using tickets.