We relaunched the TWiki.org project with an expanded TWiki charter, and we invite you to participate! The TWiki.org Code of Conduct agreement took effect on 27 Oct 2008. We ask existing twiki.org users to opt-in. You need to opt-in to participate in the Blog, Codev, Plugins and TWiki webs. -- PeterThoeny - 27 Oct 2008
You are here: TWiki> Codev Web>UploadFilterIncorrect (29 Jan 2005, CrawfordCurrie)
Tags:
create new tag
, view all tags
The $uploadFilter in TWiki.cfg is wrong. The following script illustrates the problem:
$uploadFilter       = "^(\.htaccess|.*\.(?:php[0-9s]?|phtm[l]?|pl|py|cgi))\$";
print "A\n" if ("fred.py" =~ /$uploadFilter/);
print "B\n" if ("make_me_happy" =~ /$uploadFilter/);
Both A and B get printed. Thus trying to upload a file named "oh_htaccess" it gets .txt appended. frown

Obviously it should either be

$uploadFilter       = "^(\\.htaccess|.*\\.(?:php[0-9s]?|phtm[l]?|pl|py|cgi))\$";
or (better, more readable)
$uploadFilter       = qr/^(\.htaccess|.*\.(?:php[0-9s]?|phtm[l]?|pl|py|cgi))$/;

$securityFilter is OK, by pure luck. It should really be a qr// as well.

-- CrawfordCurrie - 22 Jan 2005

Agree with making it a qr/.../ - this feature is already required by TWiki anyway.

-- RichardDonkin - 28 Jan 2005

See also the bug report on AttachAddsTxtToFilename for another example of this problem. One cannot even attach TWiki source files without them getting name mangled....

-- ThomasWeigert - 28 Jan 2005

This is fixed in DEVELOP since rev 3567. I fixed $securityFilter (now $cfg{NameFilter}) as well.

-- CrawfordCurrie - 29 Jan 2005

 
Topic revision: r5 - 29 Jan 2005 - 08:52:42 - CrawfordCurrie
 
TWIKI.NET
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback