[TYPO3-core] RFC #8040: Bug: Wrong check on creating folders in filelist makes them unaccessible
Moreno Feltscher
moreno.feltscher at gmail.com
Tue Apr 22 12:54:04 CEST 2008
I had to research this but it's true, POSIX is supported.
So I only added the spaces to my new patch which is attached.
Cheers
Moreno
--- t3lib/class.t3lib_basicfilefunc.php 2008-04-13 23:45:44.000000000 +0200
+++ t3lib/class.t3lib_basicfilefunc.php 2008-04-13 23:55:21.000000000 +0200
@@ -474,7 +474,8 @@
$fileName = $this->csConvObj->specCharsToASCII($charset,$fileName);
}
- return preg_replace('/[^.[:alnum:]_-]/','_',trim($fileName));
+ $fileName = preg_replace('/[^.[:alnum:]_-]/', '_', trim($fileName));
+ return preg_replace('/\.*$/', '', $fileName);
}
/**
On Tue, Apr 22, 2008 at 12:46 PM, Martin Kutschker
<Martin.Kutschker at n0spam-blackbox.net> wrote:
> Dmitry Dulepov [typo3] schrieb:
>
> > Hi!
> >
> > Moreno Feltscher wrote:
> >> OK, new patch attached. Now directories and files with ending dots are
> >> going to created in a Windows friendly way.
> >
> > <skip>
> >
> >> - return preg_replace('/[^.[:alnum:]_-]/','_',trim($fileName));
> >> + $fileName = preg_replace('/[^.[:alnum:]_-]/','_',trim($fileName));
> >
> > I am not sure that old a new code is correct. I checked PHP manual and
> > it declares support for "alnum: only for "ereg" family of functions.
>
> PREG supports, as does Perl, POSIX character classes.
>
> Masi
>
>
> _______________________________________________
> Before posting to this list, please have a look to the posting rules
> on the following websites:
>
> http://typo3.org/teams/core/core-mailinglist-rules/
> http://typo3.org/development/bug-fixing/diff-and-patch/
> _______________________________________________
> TYPO3-team-core mailing list
> TYPO3-team-core at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-team-core
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bug_8040_v4.diff
Type: text/x-diff
Size: 448 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20080422/891822d8/attachment.diff
More information about the TYPO3-team-core
mailing list