[TYPO3-core] RFC: Bugfix/Feature #5779

Oliver Hader oh at inpublica.de
Wed Sep 26 19:13:28 CEST 2007


Hi Bernhard,

Bernhard Kraft schrieb:
> Notes:
> The patch got a little bit more complicated as previously expected as
> Dmitry required the special feature that ".htaccess" files are visible
> even if you hide all "." files - where I do not see that this is really
> necessary - I prefer to edit .htaccess fils via shell/ftp - as when I
> make an error the whole site probably wont work anymore ...
> 
> As it is not possible to "negate" a regular expression (search for
> "negate regular expression" on google - or try it yourself) - i had to
> make the "fileIgnorePattern" store two patterns seperated by "||" ...
> whereas the first pattern defines which files get ignored and the second
> one which files are allowed.
> 
> Dmitry: I hope your wish is taken in aspect with this solution as wanted
> :) :)

Thanks for your work. But, I'm not very happy the preg_matches for each
file in a directory. If the allow-match fails, the deny-match is
executed - so in most cases you'll execute two preg_matches for one file.

If e.g. the allow-pattern would be /^\.htaccess$/ and all files starting
with a dot should be removed, use a negative look-ahead, like:

/^\.(?!htaccess$)/

Pattern match result:
".": true
"..": true
".svn": true
".htaccess": false
".htaccess~": true
".htaccessBackup": true

With that you can remove one of these two preg_matches.


olly
-- 
Oliver Hader
http://inpublica.de/


More information about the TYPO3-team-core mailing list