rejetto forum

selectedFilesAsStr()

raybob · 7 · 3583

0 Members and 1 Guest are viewing this topic.

Offline raybob

  • Tireless poster
  • ****
    • Posts: 454
    • View Profile
    • FileSplat.com
It appears to me that this fails to correctly load file names that have apostrophes ( ' ) in them...


Offline raybob

  • Tireless poster
  • ****
    • Posts: 454
    • View Profile
    • FileSplat.com
Can anybody fix this?  I really can't figure it out and this is a pretty major bug...
« Last Edit: November 28, 2012, 01:56:16 AM by raybob »


Offline raybob

  • Tireless poster
  • ****
    • Posts: 454
    • View Profile
    • FileSplat.com
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'.} />


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
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


Offline raybob

  • Tireless poster
  • ****
    • Posts: 454
    • View Profile
    • FileSplat.com
That'll cause the same problem though, if the filename contains a "

This is what I did.

Code: [Select]
value="{.replace|"|%22|%item-name%.}"


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
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.


Offline raybob

  • Tireless poster
  • ****
    • Posts: 454
    • View Profile
    • FileSplat.com
Haha ok then :D

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