Project

General

Profile

Actions

Bug #41962

closed

Wrong escapted RegEx in core/Classes/Database/SoftReferenceIndex.php

Added by Tolleiv Nietsch over 11 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Must have
Category:
-
Target version:
Start date:
2012-10-13
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.0
PHP Version:
Tags:
Complexity:
medium
Is Regression:
No
Sprint Focus:

Description

Some preg_split() expressions in core/Classes/Database/SoftReferenceIndex.php are not escaped properly and cause issues when the related functionality is used.


Files


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #42454: Fix usage of fileadminDirClosed2012-10-28

Actions
Has duplicate TYPO3 Core - Bug #42762: preg_split wrong modifier in t3lib_softrefproClosed2012-11-07

Actions
Actions #1

Updated by Tolleiv Nietsch over 11 years ago

Sorry - actually I tried to fix this directly but couldn't come up with a quick solution. Once you trigger the "Check reference index" function you'll see a couple preg_split() PHP Warnings <- these are the ones that should not show up.

Actions #2

Updated by Sven Juergens over 11 years ago

could it be that this is the same problem, like in TYPO3 4.7.5 ?

PHP Warning
PHP Warning: preg_split() [function.preg-split]: Unknown modifier '\' in .../htdocs/t3475/t3lib/class.t3lib_softrefproc.php line 561
PHP Warning
PHP Warning: Invalid argument supplied for foreach() in .../htdocs/t3475/t3lib/class.t3lib_softrefproc.php line 564
PHP Warning
PHP Warning: implode() [function.implode]: Invalid arguments passed in .../htdocs/t3475/t3lib/class.t3lib_softrefproc.php line 588

Steps to reproduce, download typo3_src+dummy-4.7.5.zip, and create a Site Template or "save and close" an TypoScript Template.

EDIT:
Sorry, forgotten: Set $TYPO3_CONF_VARS['SYS']['displayErrors'] = '2'; to see the Warnings

Actions #3

Updated by Peter Morgner over 11 years ago

  • Target version set to 4.7.6

I had this problem like Sven in class.t3lib_softrefproc.php after editing and saving TypoScript in Templates.

PHP Warning: preg_split() [function.preg-split]: Unknown modifier '\' in .../t3lib/class.t3lib_softrefproc.php line 561

followed by other two warnings
PHP Warning: Invalid argument supplied for foreach() in .../t3lib/class.t3lib_softrefproc.php line 565@
PHP Warning: implode() [function.implode]: Invalid arguments passed in .../typo3_src 4.7.5/t3lib/class.t3lib_softrefproc.php line 589

Then I gripped the patterns with "%" instead of "/" in .../t3lib/class.t3lib_softrefproc.php line 561:
$parts = preg_split("%([^[:alnum:]]+)(" . $this->fileAdminDir . "\/[^[:space:]\"'<>]*)%", ' ' . $content . ' ', 10000, PREG_SPLIT_DELIM_CAPTURE);

This works for me: No further warnings.
Actions #4

Updated by Benni Mack over 11 years ago

  • Status changed from New to Accepted
  • Complexity set to medium
Actions #5

Updated by Marc Bastian Heinrichs over 11 years ago

Fixed with #42454

Actions #6

Updated by Ronald Wopereis over 11 years ago

fix using % instead of /
works for me too (in 4.7.5)

Actions #7

Updated by Riccardo De Contardi almost 9 years ago

  • Status changed from Accepted to Needs Feedback
  • Is Regression set to No

So, could this be closed?

Actions #8

Updated by Riccardo De Contardi almost 9 years ago

  • Assignee set to Tolleiv Nietsch
Actions #9

Updated by Riccardo De Contardi over 8 years ago

  • Status changed from Needs Feedback to Closed

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