Bug #16244
closed
Warning: preg_match_all(): Compilation failed: regular expression too large at offset 0 in tslib\class.tslib_content.php
Added by edwin over 18 years ago.
Updated over 9 years ago.
Description
Warning: preg_match_all() [function.preg-match-all]: Compilation failed: regular expression too large at offset 0 in typo3-3.8.1\tslib\class.tslib_content.php on line 2878
By filling in the pattern with a length of 33610 ( done by strlen() ). This is much too long. I've tried to make a workaround and a piece of code to solve the problem but i can't reach the result of preg_match_all().
(issue imported from #M3678)
Basically the same code is still present in TYPO3 4.5alpha3 and in current trunk.
How should this be reproduced?
"By filling in the pattern with a length of 33610 ( done by strlen() )."
Whatever that means...
The original reporter can't tell us as he is no longer registered.
Stefano, could you reproduce this?
- Category changed from Communication to Frontend
- Status changed from Needs Feedback to Accepted
- Target version changed from 0 to 4.5.3
By reading the code, I would expect that reaching the limit means that you have subparts and marks which as a big list would exceed the given limit for a regexp. So if you have subparts "###THIS_IS_A_BIG_SUBPART###" and a marker "###MY_MARKER###" this will generate the regexp '/THIS_IS_A_BIG_SUBPART|MY_MARKER/' which is 31 bytes long.
Acording to PCRE (http://www.pcre.org/pcre.txt):
The maximum length of a compiled pattern is 65539 (sic) bytes if PCRE is compiled with the default internal linkage size of 2.
This is a pretty huge limit to hit, and to overcome the situation the whole substituteMarkerArrayCached() method would have to be rewritten altogether.
So I would opt to just document the limitation in the methods header while it is so:
The list of marker and array names must not pass the limit of approximately 60.000 bytes in total length.
Maybe we should just throw an exception at that point in case the limit is "reached" instead of leaving the user with no working substitution and just a PHP notice.
- Target version changed from 4.5.3 to 4.5.4
- Target version changed from 4.5.4 to 4.5.6
- Target version changed from 4.5.6 to 4.5.8
Consider issue #32542 as well - which has some content on how to reproduce it.
- Target version changed from 4.5.8 to 4.5.12
- Status changed from Accepted to Needs Feedback
- Is Regression set to No
Hi,
does the problem still exists within newer versions of TYPO3 CMS (6.2.9)?
- Status changed from Needs Feedback to Closed
- Target version deleted (
4.5.12)
No feedback within the last 90 days => closing this issue.
If you think that this is the wrong decision or experience this issue again, then please write to the mailing list typo3.teams.bugs with issue number and an explanation or open a new ticket and add a relation to this ticket number.
Also available in: Atom
PDF