Project

General

Profile

Actions

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.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Frontend
Target version:
-
Start date:
2006-06-15
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
3.8
PHP Version:
5.0
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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)


Related issues 1 (0 open1 closed)

Has duplicate TYPO3 Core - Bug #32542: preg_match_all too large in substituteMarkerArrayCachedClosed2011-12-14

Actions
Actions #1

Updated by Chris topher about 14 years ago

Basically the same code is still present in TYPO3 4.5alpha3 and in current trunk.

Actions #2

Updated by Xavier Perseguers about 14 years ago

How should this be reproduced?

Actions #3

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?

Actions #4

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.

Actions #5

Updated by Oliver Hader over 13 years ago

  • Target version changed from 4.5.3 to 4.5.4
Actions #6

Updated by Oliver Hader over 13 years ago

  • Target version changed from 4.5.4 to 4.5.6
Actions #7

Updated by Chris topher about 13 years ago

  • Target version changed from 4.5.6 to 4.5.8
Actions #8

Updated by Oliver Hader almost 13 years ago

Consider issue #32542 as well - which has some content on how to reproduce it.

Actions #9

Updated by Ernesto Baschny almost 13 years ago

  • Target version changed from 4.5.8 to 4.5.12
Actions #10

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)?

Actions #11

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.

Actions

Also available in: Atom PDF