Page 1 of 1

Freetags: Cannot save keywords

Posted: Sat Jan 07, 2012 1:19 pm
by ascger
I have a small bugfix suggestion: I could'nt save keywords in the backend of the freetag plugin. When I submitted the form nothing happend - the page simply reloaded without saving anything.

Problem was: Names of the input fields (serendipity[tag] and serendipity[keywordsubmit]) are escaped ("%5Btag%5D" instead of "[tag]") which seems not to be working (at least with Chrome). Changing these names in serendipity_event_freetags.php in lines 1867 and 1868 solved the problem.

Serendipity: 1.6
Freetag: 3.35
PHP: 5.3.6

Re: Freetags: Cannot save keywords

Posted: Sat Jan 07, 2012 11:55 pm
by garvinhicking
Hi!

Very good catch, thanks a lot. I just committed the fix!

Regards,
Garvin

Re: Freetags: Cannot save keywords

Posted: Tue Jan 10, 2012 12:24 am
by blog.brockha.us
Hmm.. If you look at this is this a good fix? Shouldn't brackets be escaped in links?
Perhaps Chrome is wrong here?

Or do I misunderstand something?

Re: Freetags: Cannot save keywords

Posted: Tue Jan 10, 2012 3:42 pm
by garvinhicking
Hi!

[] only must be encoded within <a href>, not within input name's; this was improperly changed in the plugin by me, so I reverted it.

Everytime we use "[" or "]" in a <a href=""> or <img src=""> or <script src=""> we would need to use %5D/%5B instead, however all browsers properly translate this already.

The other way around, having %5D in input names however screwp the logic up, so a browser does not atually transport [ and ] to the server.

Regards,
Garvin

Re: Freetags: Cannot save keywords

Posted: Tue Jan 10, 2012 8:51 pm
by blog.brockha.us
Ah, thanks for clearing that for me. :)