Bug #16244
closedWarning: preg_match_all(): Compilation failed: regular expression too large at offset 0 in tslib\class.tslib_content.php
0%
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)
Updated by Chris topher about 14 years ago
Basically the same code is still present in TYPO3 4.5alpha3 and in current trunk.
Updated by Chris topher about 14 years ago
"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?
Updated by Ernesto Baschny over 13 years ago
- 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.
Updated by Oliver Hader over 13 years ago
- Target version changed from 4.5.3 to 4.5.4
Updated by Oliver Hader about 13 years ago
- Target version changed from 4.5.4 to 4.5.6
Updated by Chris topher about 13 years ago
- Target version changed from 4.5.6 to 4.5.8
Updated by Oliver Hader almost 13 years ago
Consider issue #32542 as well - which has some content on how to reproduce it.
Updated by Ernesto Baschny almost 13 years ago
- Target version changed from 4.5.8 to 4.5.12
Updated by Alexander Opitz almost 10 years ago
- 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)?
Updated by Alexander Opitz over 9 years ago
- 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.