Bug #41962

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

Added by Tolleiv Nietsch about 7 years ago. Updated over 4 years ago.

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

0%

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.

Bildschirmfoto_2012-10-13_um_23.54.27.png View (85.5 KB) Tolleiv Nietsch, 2012-10-13 23:56


Related issues

Related to TYPO3 Core - Bug #42454: Fix usage of fileadminDir Closed 2012-10-28
Duplicated by TYPO3 Core - Bug #42762: preg_split wrong modifier in t3lib_softrefpro Closed 2012-11-07

History

#1 Updated by Tolleiv Nietsch about 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 about 7 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

#3 Updated by Peter Morgner about 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.

#4 Updated by Benni Mack about 7 years ago

  • Status changed from New to Accepted
  • Complexity set to medium

#5 Updated by Marc Bastian Heinrichs about 7 years ago

Fixed with #42454

#6 Updated by Ronald Wopereis almost 7 years ago

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

#7 Updated by Riccardo De Contardi over 4 years ago

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

So, could this be closed?

#8 Updated by Riccardo De Contardi over 4 years ago

  • Assignee set to Tolleiv Nietsch

#9 Updated by Riccardo De Contardi over 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.

Also available in: Atom PDF