Security.php 641 - Compilation failed: regular expression is too large at offset 36332

edited April 2015 in Bug Reports
Severity: Warning --> preg_replace() [function.preg-replace]: Compilation failed: regular expression is too large at offset 36332
fuel\codeigniter\core\Security.php 641

Seems the issue come from CI, but are there any method to solve this error?
This error occurred when i save in the admin panel.

Thanks.

Comments

  • edited 10:50PM
    This looks to be something the xss_clean function is doing. What module are you saving from? If it is your own module, the xss_clean function is used by default for modules but can be overwritten in your MY_fuel_modules.php by adding the following to your for the particular module you are having trouble with:
    ... 'sanitize_input' => array('template','php'), ...
  • edited April 2015
    It is a simple module for a model named.

    below is my setting in MY_fuel_modules.php.
    $config['modules']['paper'] = array( 'sanitize_input' => array('template','php'), 'default_order' => 'desc', 'icon_class' => 'ico_research', );

    It is added after your suggsstion, but still not work
    'sanitize_input' => array('template','php'),

    When i save the model in admin, i lost the "text" in the textarea.
    And then i found the error message in the log file
    Compilation failed: regular expression is too large at offset 36332 Line 641
    Security.php Line 641 $str = preg_replace('/(<?)(\/?[^><]+?)([^A-Za-z<>\-])(.*?)('.implode('|', $attribs).')(.*?)([\s><]?)([><]*)/i', '$1$2 $4$6$7$8', $str, -1, $count);

    The error occurred only if the field have too many text.
  • edited 10:50PM
    Perhaps adjusting this setting may help in your php.ini:
    http://stackoverflow.com/questions/8268624/php-preg-match-all-limit
Sign In or Register to comment.