No code output for long code snippets
-
Code over a certain length (seems around 2300 characters) causes no code output (just a ).
I found this in the plugin code:
Snippet search&replace is based on PHP’s
preg_replace_callback()
.
“The pcre.backtrack_limit option (added in PHP 5.2) can trigger a NULL
return, with no errors.”
https://www.php.net/manual/de/function.preg-replace-callback.php#98721
https://www.php.net/manual/de/function.preg-replace-callback.php#100303
That is, for very long code snippets, it might happen that this function
does not find/replace anything. These snippets will not get highlighted.
I have never observed this, but please let me know when you run into it.Increasing pcre.backtrack_limit to ten million has no effect.
I recently upgraded to PHP 7.1.0-dev (not sure if the issue was occurring before then.
- The topic ‘No code output for long code snippets’ is closed to new replies.