Menu

#138 Textareas messing response with file uploads

open-accepted
nobody
None
5
2010-06-09
2008-02-05
Anonymous
No

I've found a bug in Anthem.js at line 74.

The problem as I see is that you change all </textarea> for </anthemarea> when rendering if you're using IOFrame to avoid these markups messing with the response frame.

The problem is you missed to put the "g" (global) option in the replace RegEx when replacing back all the </anthemarea> to </textarea> again.

This behavior only occurs when you're sending a file and there is more than one <textarea></textarea> pair in the response.

To fix the bug just change the RegEx in the replace call with a "g" option to allow it to change all the occurrences...

Line 74 - Old code:

var response = { responseText: doc.getElementById("response").value.replace(/<\/anthemarea>/, "</textarea>") };

Line 74 - New code:

var response = { responseText: doc.getElementById("response").value.replace(/<\/anthemarea>/g, "</textarea>") };

---------------------------------------
Joan Vilariño
joan.vilarino@gmail.com

Discussion

  • Leniel Macaferi

    Leniel Macaferi - 2009-11-05

    Hi,

    Indeed, this is a problem.

    I've download the last version of Anthem's source code (1.5.2) and implemented the change described by Joan Vilariño. I then recompiled the source code to get a new Anthem.dll. I replaced the old Anthem.dll with this new one on my project Libs folder. It did the trick!

    Thanks Joan.

    Leniel Macaferi
    http://www.leniel.net/

     
  • Andy Miller

    Andy Miller - 2010-06-09
    • status: open --> open-accepted
     

Log in to post a comment.