On large CSS files with complicated rules it may cause regexp limit when replacing by preg_replace:
exception 'yii\base\ErrorException' with message 'preg_replace(): Compilation failed: regular expression is too large at offset 70187' in .../vendor/kartik-v/mpdf/classes/cssmgr.php:164
... but (as far as I can see) there is no real need in preg_replace() in this place. We have exact text, matched by preg_match_all() and now we can use str_replace() (or mb_str_replace()) to clear it out.
P.S. I don't offer pull request because I can miss something
---
Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/26449451-preg_replace-compilation-failed-regular-expression-is-too-large-at-offset?utm_campaign=plugin&utm_content=tracker%2F7827090&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F7827090&utm_medium=issues&utm_source=github).
There is an error in cssmgr.php:164 :
On large CSS files with complicated rules it may cause regexp limit when replacing by preg_replace:
... but (as far as I can see) there is no real need in
preg_replace()
in this place. We have exact text, matched bypreg_match_all()
and now we can usestr_replace()
(ormb_str_replace()
) to clear it out.P.S. I don't offer pull request because I can miss something