#118 Cant use hyphen in file names

v0.9.4
closed
nobody
Browsing (93)
5
2006-03-31
2006-03-08
Anonymous
No

Indexing files or directories named first-second cannot
be viewed. Selecting the first-second link results in
"The file first cannot be found."

The cause is clean_path not allowing hyphen. It's in
the list, just not first, so it denotes a range between
the adjacent characters, not itself. Moving the hyphen
to the beginning of the list solves the problem.

--- Common.pm 2006-03-08 15:14:26.000000000 -0800
+++ Common.pm.old 2006-02-14 08:47:29.000000000 -0800
@@ -539,8 +539,7 @@

if(defined $path) {
# First suppress anything after a dodgy
character
- $path =~ s!(^[-\w_+,.%^/]+).*!$1!;
+ $path =~ s!(^[\w_+-,.%^/]+).*!$1!;
# Clean out /../
while ($path =~ m!/../!) {
$path = s!/\.\./!/!g;

As '+' and ',' are adjacent in the ascii character set,
"+-," is a valid but not very useful range.
Enjoy
Lee
lee.olsen@f5.com

Discussion

  • Malcolm Box
    Malcolm Box
    2006-03-31

    • status: open --> closed