changeset 4702:34f0fe3ff120

merged moin/1.7
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Mon, 20 Apr 2009 20:11:47 +0200
parents 78e501f956b1 (current diff) d8049de69c4f (diff)
children 621c708ecddb 4692e88cebb6
files MoinMoin/PageEditor.py MoinMoin/action/AttachFile.py
diffstat 2 files changed, 12 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/PageEditor.py	Sat Apr 18 00:44:40 2009 +0200
+++ b/MoinMoin/PageEditor.py	Mon Apr 20 20:11:47 2009 +0200
@@ -1085,6 +1085,7 @@
             raise self.EditConflict, msg
         elif newtext == self.get_raw_body():
             msg = _('You did not change the page content, not saved!')
+            self.lock.release()
             raise self.Unchanged, msg
         else:
             from MoinMoin.security import parseACL
--- a/MoinMoin/action/AttachFile.py	Sat Apr 18 00:44:40 2009 +0200
+++ b/MoinMoin/action/AttachFile.py	Mon Apr 20 20:11:47 2009 +0200
@@ -387,6 +387,7 @@
 
 
 def error_msg(pagename, request, msg):
+    msg = wikiutil.escape(msg)
     request.theme.add_msg(msg, "error")
     Page(request, pagename).send_page()
 
@@ -512,7 +513,7 @@
     if handler:
         msg = handler(pagename, request)
     else:
-        msg = _('Unsupported AttachFile sub-action: %s') % (wikiutil.escape(do[0]), )
+        msg = _('Unsupported AttachFile sub-action: %s') % do[0]
     if msg:
         error_msg(pagename, request, msg)
 
@@ -522,6 +523,8 @@
 
 
 def upload_form(pagename, request, msg=''):
+    if msg:
+        msg = wikiutil.escape(msg)
     _ = request.getText
 
     request.emit_http_headers()
@@ -746,9 +749,9 @@
          'baseurl': request.getScriptname(),
          'do': 'attachment_move',
          'ticket': wikiutil.createTicket(request),
-         'pagename': pagename,
+         'pagename': wikiutil.escape(pagename, 1),
          'pagename_quoted': wikiutil.quoteWikinameURL(pagename),
-         'attachment_name': filename,
+         'attachment_name': wikiutil.escape(filename, 1),
          'move': _('Move'),
          'cancel': _('Cancel'),
          'newname_label': _("New page name"),
@@ -838,13 +841,13 @@
 
     if package.isPackage():
         if package.installPackage():
-            msg = _("Attachment '%(filename)s' installed.") % {'filename': wikiutil.escape(target)}
+            msg = _("Attachment '%(filename)s' installed.") % {'filename': target}
         else:
-            msg = _("Installation of '%(filename)s' failed.") % {'filename': wikiutil.escape(target)}
+            msg = _("Installation of '%(filename)s' failed.") % {'filename': target}
         if package.msg:
-            msg += "<br><pre>%s</pre>" % wikiutil.escape(package.msg)
+            msg += " " + package.msg
     else:
-        msg = _('The file %s is not a MoinMoin package file.') % wikiutil.escape(target)
+        msg = _('The file %s is not a MoinMoin package file.') % target
 
     upload_form(pagename, request, msg=msg)
 
@@ -948,7 +951,7 @@
         logging.exception("An exception within zip file attachment handling occurred:")
         msg = _("A severe error occurred:") + ' ' + str(err)
 
-    upload_form(pagename, request, msg=wikiutil.escape(msg))
+    upload_form(pagename, request, msg=msg)
 
 
 def send_viewfile(pagename, request):