Wrong escapted RegEx in core/Classes/Database/SoftReferenceIndex.php
Some preg_split() expressions in core/Classes/Database/SoftReferenceIndex.php are not escaped properly and cause issues when the related functionality is used.
#1 Updated by Tolleiv Nietsch almost 7 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.
#2 Updated by Sven Juergens almost 7 years ago
could it be that this is the same problem, like in TYPO3 4.7.5 ?
PHP Warning: preg_split() [function.preg-split]: Unknown modifier '\' in .../htdocs/t3475/t3lib/class.t3lib_softrefproc.php line 561
PHP Warning: Invalid argument supplied for foreach() in .../htdocs/t3475/t3lib/class.t3lib_softrefproc.php line 564
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.
Sorry, forgotten: Set $TYPO3_CONF_VARS['SYS']['displayErrors'] = '2'; to see the Warnings
#3 Updated by Peter Morgner almost 7 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.
#9 Updated by Riccardo De Contardi about 4 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.