src/StringLib.php
/**
     * Function to remove the e modifier from regular expressions.
     * http://stackoverflow.com/questions/7243073/how-can-i-disable-the-e-preg-replace-eval-modifier-in-php
     * @param string $regExp 
     * @return string - the sanitized regexp without the modifier.
     */
Function to remove the e modifier from regular expressions.
Function to remove the e modifier from regular expressions .
public static function sanitizeRegExp($regExp)
    {
        $pattern_parts = explode($regExp[0], trim($regExp));
        $pattern_last = sizeof($pattern_parts) - 1;
        $pattern_parts[$pattern_last] = str_replace('e', '', $pattern_parts[$pattern_last]);
        return implode($regExp[0], $pattern_parts);
    }
public static function sanitizeRegExp ( $ regExp ) { $ pattern_parts = explode ( $ regExp [ 0 ] , trim ( $ regExp ) ) ; $ pattern_last = sizeof ( $ pattern_parts ) - 1 ; $ pattern_parts [ $ pattern_last ] = str_replace ( 'e' , '' , $ pattern_parts [ $ pattern_last ] ) ; return implode ( $ regExp [ 0 ] , $ pattern_parts ) ; }
Function to remove the e modifier from regular expressions.
Function to remove the e modifier from regular expressions .