XFileSharing Pro - Space don't work when editing filename

Message
Author
qq_bbq
Posts: 122
Joined: Jul 05, 2009 11:33 pm

Space don't work when editing filename

#1 Postby qq_bbq » Aug 23, 2009 7:40 pm

When you edit filename with a space, it replace with _
Like you try to change: "Test_File.zip" to "Test File.zip" it will still show as "Test_File.zip"

And if you edit a file that is in a folder, it should redirect back to that folder after editing not to the my files.

User avatar
PilgrimX182
Posts: 2186
Joined: Mar 22, 2006 1:39 pm

#2 Postby PilgrimX182 » Aug 24, 2009 12:32 pm

Thanks! Will be fixed in next version.

Eskick
Posts: 86
Joined: Mar 10, 2009 11:47 am

#3 Postby Eskick » Aug 26, 2009 12:31 am

PilgrimX182 wrote:Thanks! Will be fixed in next version.
Please also tell us an add and remove fix for those who do not with to update to the next version or those who cannot

User avatar
PilgrimX182
Posts: 2186
Joined: Mar 22, 2006 1:39 pm

#4 Postby PilgrimX182 » Aug 26, 2009 6:18 am

In index.cgi replace

Code: Select all

      $f->{file_name}=~s/%\d\d/_/gs;
      $f->{file_name}=~s/%/_/gs;
      $f->{file_name}=~s/[\s\#\"]+/_/gs;
      $f->{file_name}=~s/[^\w\d\.-]/_/g if $c->{sanitize_filename};
with

Code: Select all

      $f->{file_name}=~s/%(\d\d)/chr(hex($1))/egs;
      $f->{file_name}=~s/%/_/gs;
      $f->{file_name}=~s/\s{2,}/ /gs;
      $f->{file_name}=~s/[\#\"]+/_/gs;
      $f->{file_name}=~s/[^\w\d\.-]/_/g if $c->{sanitize_filename};