rejetto forum

Software => HFS ~ HTTP File Server => Bug reports => Topic started by: raybob on October 24, 2012, 02:38:46 AM

Title: selectedFilesAsStr()
Post by: raybob on October 24, 2012, 02:38:46 AM
It appears to me that this fails to correctly load file names that have apostrophes ( ' ) in them...
Title: Re: selectedFilesAsStr()
Post by: raybob on November 22, 2012, 02:49:40 PM
Can anybody fix this?  I really can't figure it out and this is a pretty major bug...
Title: Re: selectedFilesAsStr()
Post by: raybob on December 01, 2012, 07:04:39 PM
I fixed it and it has nothing to do with the javascript :)

In the selector checkbox, the value='' field will generate invalid html if the filename contains an apostrophe.  Sometimes it would turn out something like this which is invalid html:

Code: [Select]
        <input type='checkbox' class='selector' name='selection' value='file with an apostrophe'.txt' {.if not|{.or|{.get|can delete.}|{.get|can access.}|{.get|can archive item.}.}|disabled='disabled'.} />
Title: Re: selectedFilesAsStr()
Post by: rejetto on December 29, 2012, 07:39:28 PM
i will change the single quote in double quote, for that and for this other line

<li> <a href="%item-url%">%item-name%</a>

thanks for reporting
Title: Re: selectedFilesAsStr()
Post by: raybob on December 30, 2012, 06:13:14 PM
That'll cause the same problem though, if the filename contains a "

This is what I did.

Code: [Select]
value="{.replace|"|%22|%item-name%.}"
Title: Re: selectedFilesAsStr()
Post by: rejetto on January 01, 2013, 02:17:30 PM
wait a minute, you are cheating me!
the default template doesn't use %item-name% in that place, but %item-url% (that's already encoded).
The bug is in your custom template.
Title: Re: selectedFilesAsStr()
Post by: raybob on January 01, 2013, 09:12:57 PM
Haha ok then :D

I didn't realize %item-url% was encoded but the name wasn't, I just assumed they both weren't.