diff --git a/modules/shortcodes/youtube.php b/modules/shortcodes/youtube.php index 79af6f94b7e8f..f0aa1e1b35121 100644 --- a/modules/shortcodes/youtube.php +++ b/modules/shortcodes/youtube.php @@ -32,7 +32,7 @@ function youtube_embed_to_short_code( $content ) { } // older codes - $regexp = '!(?:)*!i'; + $regexp = '!]+?)>.*?]*?>.*?!is'; $regexp_ent = htmlspecialchars( $regexp, ENT_NOQUOTES ); $old_regexp = '!|>\s*)!'; $old_regexp_ent = str_replace( '&#0*58;', '&#0*58;|�*58;', htmlspecialchars( $old_regexp, ENT_NOQUOTES ) ); @@ -55,10 +55,10 @@ function youtube_embed_to_short_code( $content ) { // // As shown at the start of function, previous YouTube didn't '?' // the 1st field-value pair. - if ( in_array( $reg, array( 'ifr_regexp', 'ifr_regexp_ent' ) ) ) { + if ( in_array( $reg, array( 'ifr_regexp', 'ifr_regexp_ent', 'regexp', 'regexp_ent' ) ) ) { $params = $match[1]; - if ( 'ifr_regexp_ent' == $reg ) { + if ( in_array( $reg, array( 'ifr_regexp_ent', 'regexp_ent' ) ) ) { $params = html_entity_decode( $params ); }