Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#32775 closed defect (bug) (invalid)

wptexturize breaks if too many shortcode

Reported by: odoremieux's profile odoremieux Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.2.2
Component: General Keywords:
Focuses: Cc:

Description

wptexturize breaks depending on the number of the shortcode and the length of the shortcode name.

The error I'm getting is :
PHP Warning: preg_split(): Compilation failed: regular expression is too large at offset 33012

Here is some code that can reproduce it

<?php

/*
 * Plugin Name:   Test ShortCodes
 * Version:       1.01.01
 * Plugin URI:    
 * Description:   Test ShortCodes
 * Author:        
 * Author URI: 
 *  
 */

if (!class_exists("Test_ShortCodes")) {

    class Test_ShortCodes {

        function Test_ShortCodes() {
            global $shortcode_tags;
            error_log('Before ShortCode -> ' . count($shortcode_tags));

            for ($x = 0; $x <= 200; $x++) {
                add_shortcode('mysimpleshortcodewidthsomelongtextintthenametodosometestingandseeifitbreaksmaybeweneedmoretexttotestevenalittlebitmorejustincaseorisitmaybetoolongmaybemaybenot_' . $x, array(&$this, 'testfunction_ShortCode'));
            }
            error_log('After ShortCode -> ' . count($shortcode_tags));
        }

        function testfunction_ShortCode($atts, $content = null) {
            
        }

    }

}

$myTest_ShortCodes = new Test_ShortCodes();
?>

Change History (1)

#1 @miqrogroove
10 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

Abusive plugin is not a core bug.

Note: See TracTickets for help on using tickets.