Bug #41962
closedWrong escapted RegEx in core/Classes/Database/SoftReferenceIndex.php
0%
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
Updated by Tolleiv Nietsch over 12 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.
Updated by Sven Juergens over 12 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
Updated by Peter Morgner over 12 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.
Updated by Benni Mack over 12 years ago
- Status changed from New to Accepted
- Complexity set to medium
Updated by Ronald Wopereis about 12 years ago
fix using % instead of /
works for me too (in 4.7.5)
Updated by Riccardo De Contardi over 9 years ago
- Status changed from Accepted to Needs Feedback
- Is Regression set to No
So, could this be closed?
Updated by Riccardo De Contardi over 9 years ago
- Assignee set to Tolleiv Nietsch
Updated by Riccardo De Contardi over 9 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.