Page Index Toggle Pages: 1
Topic Tools
Hot Topic (More than 10 Replies) Attached files containing "+" in their names (Read 4,420 times)
Liviu Lalescu
YaBB Newcomer
*
Offline



Posts: 32
Attached files containing "+" in their names
Sep 9th, 2011 at 12:10pm
Post Tools
Hello!

I am using YaBB 2.4. A user tried to attach a file whose name contained "+", I could not download it. Had to rename it.

Is there a patch?

Thank you!
« Last Edit: Sep 9th, 2011 at 12:11pm by Liviu Lalescu »  
Back to top
 
IP Logged
 
Captain John
Ex Member


Re: Attached files containing "+" in their names
Reply #1 - Sep 9th, 2011 at 3:44pm
Post Tools
No ... and won't be
  
Back to top
 
IP Logged
 
Derek Barnstorm
Support Team
YaBB Next Team
Development Team
Beta Testers
****
Offline



Posts: 1,269
Location: United Kingdom

None
Re: Attached files containing "+" in their names
Reply #2 - Sep 9th, 2011 at 7:54pm
Post Tools
For what it's worth, I think this should be moved back to the bug section for the development team to decide whether it needs fixing or not.

In my opinion, if you can't view attachments with certain characters in them then there should be a check to disallow them in the first place.

Either that, or there needs to be a fix to the regex to display files with those characters.

I've tested it on my test board and can confirm the issue - so in my opinion there needs to be some way of dealing with it.

I'm assuming it would be an easy fix...
  
Back to top
 
IP Logged
 
Captain John
Ex Member


Re: Attached files containing "+" in their names
Reply #3 - Sep 10th, 2011 at 12:02am
Post Tools
Certain characters should not be allowed in file names and in URLs to prevent hacking websites.  Why allow a special character in a filename, when all that is needed is to rename the file to something that is accepted ?  Simple.

Some idiot would end up naming a file !@$*)_+ or )(*&^%$#@!  WHY would anyone allow such ? or at what character should we stop at ?
« Last Edit: Sep 10th, 2011 at 12:35am by »  
Back to top
 
IP Logged
 
Derek Barnstorm
Support Team
YaBB Next Team
Development Team
Beta Testers
****
Offline



Posts: 1,269
Location: United Kingdom

None
Re: Attached files containing "+" in their names
Reply #4 - Sep 10th, 2011 at 12:49am
Post Tools
Hi CJ,

That's why certain characters are substituted (or, encoded/decoded), and that's why I think it needs fixing. I haven't checked every single character, but the ones I have checked are substituted with an underscore - the plus symbol isn't being substituted with an underscore - that's what is causing issues and is why I believe it needs a simple regex fix.

I guess I agree that it is not really a bug, but it is still something that deserves a little attention...
  
Back to top
 
IP Logged
 
Captain John
Ex Member


Re: Attached files containing "+" in their names
Reply #5 - Sep 10th, 2011 at 12:53am
Post Tools
Why should we regex any character that is not allowed in a filename ?  Shouldn't be there to start with.

Check out http://en.wikipedia.org/wiki/Filename#Reserved_characters_and_words

the "+" is not allowed within a Fat32 filename ...  as other characters
« Last Edit: Sep 10th, 2011 at 1:09am by »  
Back to top
 
IP Logged
 
JonB
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 4,006
Location: Land of the Blazing Sun!

YaBB 2.6.1
Re: Attached files containing "+" in their names
Reply #6 - Sep 10th, 2011 at 9:21am
Post Tools
I wasn't going to comment, but as a server-geek, I now feel I must.

Captain John is dead on about this.  I don't think we should build code that enables features that contravene generally accepted best practices - such as embedding reserved characters into filenames.

Quote:
the "+" is not allowed within a Fat32 filename

If anyone thinks FAT32, is dead, its first cousin - CIFS (Common Internet File System) is the default file system on almost any USB portable drive/stick.  This is because almost ANY other filesystem can read it.
http://technet.microsoft.com/en-us/library/cc939973.aspx

http://devcentral.f5.com/Tutorials/TechTips/tabid/63/articleType/ArticleView/art...

Its like designing your software to fail. I get this problem all the time with cross platform ports on the other forum I work on.

besides, anyone who wants it can wander over the the magician's mod board and shazaam, a cure will appear.

Just my 2˘ on the matter
Cool


heh - at the moment I don't think we have to worry about it getting fixed anyway  Wink
  

I find your lack of faith disturbing.
Back to top
IP Logged
 
Derek Barnstorm
Support Team
YaBB Next Team
Development Team
Beta Testers
****
Offline



Posts: 1,269
Location: United Kingdom

None
Re: Attached files containing "+" in their names
Reply #7 - Sep 10th, 2011 at 2:30pm
Post Tools
Well, here's the fix if Liviu wants it anyway:

http://www.carsten-dalgaard.dk/cgi-bin/yabb2/YaBB.pl?num=1315609980/2#2
  
Back to top
 
IP Logged
 
Liviu Lalescu
YaBB Newcomer
*
Offline



Posts: 32
Re: Attached files containing "+" in their names
Reply #8 - Sep 10th, 2011 at 2:52pm
Post Tools
Forgive me for this request, if it generates problems, but it is a real world problem, in which a user wanted to attach a file named like: "k + k.txt" (without quotes, just a smaller example). On GNU/Linux, "+" is allowed in file names (remember the "/lost+found" default directory?).

Thank you, Derek, for the fix, but it does not work in my case (I tried the above example). I think you treat images, but I was thinking of text or archive attachments.
« Last Edit: Sep 10th, 2011 at 2:53pm by Liviu Lalescu »  
Back to top
 
IP Logged
 
JonB
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 4,006
Location: Land of the Blazing Sun!

YaBB 2.6.1
Re: Attached files containing "+" in their names
Reply #9 - Sep 10th, 2011 at 3:05pm
Post Tools
@Liviu Lalescu

Quote:
On GNU/Linux, "+" is allowed in file names


And that would be fine, if YaBB only ran on Unix Filesystems, but that is not the case.

I suspect, that if you ask Carsten over on his forum, he may oblige you. Carsten is one of the most knowledgeable YaBB developers and extremely helpful.

If not, I will see if I can root out a solution, there's probably a regex that looks at the filename when CGI is called.   LOL, but I'm not Carstan either!  Tongue

Cool
  

I find your lack of faith disturbing.
Back to top
IP Logged
 
Derek Barnstorm
Support Team
YaBB Next Team
Development Team
Beta Testers
****
Offline



Posts: 1,269
Location: United Kingdom

None
Re: Attached files containing "+" in their names
Reply #10 - Sep 10th, 2011 at 3:34pm
Post Tools
Carsten's already sorted it - it works for images and files now:

http://www.carsten-dalgaard.dk/cgi-bin/yabb2/YaBB.pl?num=1315609980/4#4
  
Back to top
 
IP Logged
 
Liviu Lalescu
YaBB Newcomer
*
Offline



Posts: 32
Re: Attached files containing "+" in their names
Reply #11 - Sep 10th, 2011 at 4:50pm
Post Tools
Yes, it works, thank you YaBB team for the help! (helpful as always).
  
Back to top
 
IP Logged
 
Liviu Lalescu
YaBB Newcomer
*
Offline



Posts: 32
Re: Attached files containing "+" in their names
Reply #12 - Sep 10th, 2011 at 6:13pm
Post Tools
Yes, thank you, Carsten, and Derek, for bringing this up to Carsten! I think in the past I also used one or more of his patches. I am puzzled that this bug didn't show up until now.
« Last Edit: Sep 10th, 2011 at 6:15pm by Liviu Lalescu »  
Back to top
 
IP Logged
 
Derek Barnstorm
Support Team
YaBB Next Team
Development Team
Beta Testers
****
Offline



Posts: 1,269
Location: United Kingdom

None
Re: Attached files containing "+" in their names
Reply #13 - Sep 10th, 2011 at 8:08pm
Post Tools
So, why was my last post deleted?
  
Back to top
 
IP Logged
 
JonB
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline



Posts: 4,006
Location: Land of the Blazing Sun!

YaBB 2.6.1
Re: Attached files containing "+" in their names
Reply #14 - Sep 13th, 2011 at 1:17pm
Post Tools
Quote:
Carsten's already sorted it - it works for images and files now:


God bless Carsten  Wink
  

I find your lack of faith disturbing.
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Topic Tools
 
  « Board Index ‹ Board  ^Top