1.1 --- a/MoinMessage.py Sat Jun 08 01:26:43 2013 +0200
1.2 +++ b/MoinMessage.py Thu Jun 13 18:51:07 2013 +0200
1.3 @@ -433,6 +433,10 @@
1.4 req = cls(host, port)
1.5 req.request("PUT", path, text)
1.6 resp = req.getresponse()
1.7 +
1.8 + if resp.status >= 400:
1.9 + raise MoinMessageError, "Message sending failed: %s" % resp.status
1.10 +
1.11 return resp.read()
1.12
1.13 def parseURL(url):
2.1 --- a/MoinMessageSupport.py Sat Jun 08 01:26:43 2013 +0200
2.2 +++ b/MoinMessageSupport.py Thu Jun 13 18:51:07 2013 +0200
2.3 @@ -138,7 +138,8 @@
2.4
2.5 else:
2.6 writeHeaders(request, "text/plain", getMetadata(self.page), "403 Forbidden")
2.7 - request.write("The message could not be verified.")
2.8 + request.write("The message could not be verified. "
2.9 + "Maybe this site is not performing authentication using PGP signatures.")
2.10
2.11 def handle_message_content(self, content):
2.12
3.1 --- a/actions/SendMessage.py Sat Jun 08 01:26:43 2013 +0200
3.2 +++ b/actions/SendMessage.py Thu Jun 13 18:51:07 2013 +0200
3.3 @@ -230,7 +230,7 @@
3.4 sendMessage(message, parameters["url"])
3.5
3.6 except MoinMessageError, exc:
3.7 - return 0, "%s: %s" % (_("The message could not be prepared and sent:"), exc)
3.8 + return 0, "%s: %s" % (_("The message could not be prepared and sent"), exc)
3.9
3.10 # Or queue the message on the specified page.
3.11
3.12 @@ -307,6 +307,14 @@
3.13 """
3.14
3.15 script = request.getScriptname()
3.16 +
3.17 + # Normalise the URL.
3.18 +
3.19 + if not script.endswith("/"):
3.20 + script += "/"
3.21 +
3.22 + # Reject URLs outside the wiki.
3.23 +
3.24 if not url.startswith(script):
3.25 return None
3.26