[TYPO3-core] RFC #11152: Warning in Import/Export Module

Rupert Germann rupi at gmx.li
Thu May 21 22:35:53 CEST 2009


hi,

Martin Kutschker wrote:
>> there are exceptions when it's at the beginning or the end,
> 
> No, the dot within a character class, ie between square brackets doesn't
> need to be escaped

interesting. there is indeed an error but it depends on the position of the
dot inside the [].
/[^[:alnum:]\/_-.]*/
gives a: Warning: preg_replace(): Compilation failed: range out of order in
character class at offset 15 in Command line code on line 1

whereas: /[^[:alnum:].\/_-]*/
works as expected.

if I write something like this to the filename field: 
".test/123Ä?ß.sdf/../\/test.xml.test.t3d"

it becomes: ".test/123.sdf/../test.xml.test"

looks dangerous but is no problem because saving the file failes at
t3lib_div::isAllowedAbsPath(). The exporter says: "Problems saving file
Bad path:...."

So I suggest to remove dots and slashes:
/[^[:alnum:]_-]*/

greets
rupert


PS: I never used this field until today ;-)




More information about the TYPO3-team-core mailing list