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

Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r5 - 2005-01-29 - CrawfordCurrie
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.