Changeset 2097

Show
Ignore:
Timestamp:
03/12/07 01:11:15 (2 years ago)
Author:
coderanger
Message:

AddCommentMacro:

  • Put it back to POST (it does work, I just outsmarted myself).
  • Try to handle non-ASCII better.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • addcommentmacro/0.10/addcomment/macro.py

    r2096 r2097  
    1010from trac.util import TracError 
    1111from trac.web.chrome import add_link 
     12from trac.util.text import to_unicode 
    1213 
    1314import re, time 
     
    5051    disabled = '' 
    5152 
    52     comment = Markup(hdf.getValue("args.addcomment", "")).unescape() 
     53    comment = Markup(to_unicode(hdf.getValue("args.addcomment", ""))).unescape() 
    5354    preview = hdf.getValue("args.previewaddcomment", "") 
    5455    cancel = hdf.getValue("args.canceladdcomment", "") 
     
    9495            out.write("<div class='system-message'><strong>ERROR: [[AddComment]] macro call must be the only content on its line. Could not add comment.</strong></div>\n") 
    9596 
    96     out.write("<form action='%s#commentpreview' method='get'>\n" % env.href.wiki(pagename)) 
     97    out.write("<form action='%s#commentpreview' method='post'>\n" % env.href.wiki(pagename)) 
    9798    out.write("<fieldset>\n<legend>Add comment</legend>\n") 
    9899    out.write("<div class='field'>\n<textarea class='wikitext' id='addcomment' name='addcomment' cols='80' rows='5'%s>" % disabled)