httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s.@apache.org
Subject svn commit: r1187588 - in /httpd/mod_mbox/trunk: data/archives.js module-2.0/mod_mbox_mime.c module-2.0/mod_mbox_out.c
Date Fri, 21 Oct 2011 22:46:07 GMT
Author: sf
Date: Fri Oct 21 22:46:06 2011
New Revision: 1187588

URL: http://svn.apache.org/viewvc?rev=1187588&view=rev
Log:
Fix URI escaping issues with '%' in msg-ids

PR: 50267

Modified:
    httpd/mod_mbox/trunk/data/archives.js
    httpd/mod_mbox/trunk/module-2.0/mod_mbox_mime.c
    httpd/mod_mbox/trunk/module-2.0/mod_mbox_out.c

Modified: httpd/mod_mbox/trunk/data/archives.js
URL: http://svn.apache.org/viewvc/httpd/mod_mbox/trunk/data/archives.js?rev=1187588&r1=1187587&r2=1187588&view=diff
==============================================================================
--- httpd/mod_mbox/trunk/data/archives.js (original)
+++ httpd/mod_mbox/trunk/data/archives.js Fri Oct 21 22:46:06 2011
@@ -222,7 +222,7 @@ function buildMessageListEntry (msg, msg
   }
 
   if (linked) {
-    str += '<a href="ajax/' + msg.getAttribute('id') +
+    str += '<a href="ajax/' + encodeURIComponent(msg.getAttribute('id')) +
       '" onclick="javascript:toggleMessage(' + msg_num + '); return false;">';
   }
 
@@ -467,7 +467,7 @@ function getMessage (id, msg_num)
 function toggleMessage (msg_num)
 {
   var msgs = _msglist.getElementsByTagName('message');
-  var id = msgs[msg_num].getAttribute('id');
+  var id = encodeURIComponent(msgs[msg_num].getAttribute('id'));
   var i;
 
   var min = msg_num - _default_ctx;

Modified: httpd/mod_mbox/trunk/module-2.0/mod_mbox_mime.c
URL: http://svn.apache.org/viewvc/httpd/mod_mbox/trunk/module-2.0/mod_mbox_mime.c?rev=1187588&r1=1187587&r2=1187588&view=diff
==============================================================================
--- httpd/mod_mbox/trunk/module-2.0/mod_mbox_mime.c (original)
+++ httpd/mod_mbox/trunk/module-2.0/mod_mbox_mime.c Fri Oct 21 22:46:06 2011
@@ -373,7 +373,10 @@ char *mbox_mime_get_body(apr_pool_t *p, 
     return MBOX_FETCH_ERROR_STR;
 }
 
-/* Display an XHTML MIME structure */
+/*
+ * Display an XHTML MIME structure
+ * 'link' must already be properly URI-escaped
+ */
 void mbox_mime_display_static_structure(request_rec *r,
                                         mbox_mime_message_t *m, char *link)
 {

Modified: httpd/mod_mbox/trunk/module-2.0/mod_mbox_out.c
URL: http://svn.apache.org/viewvc/httpd/mod_mbox/trunk/module-2.0/mod_mbox_out.c?rev=1187588&r1=1187587&r2=1187588&view=diff
==============================================================================
--- httpd/mod_mbox/trunk/module-2.0/mod_mbox_out.c (original)
+++ httpd/mod_mbox/trunk/module-2.0/mod_mbox_out.c Fri Oct 21 22:46:06 2011
@@ -1121,7 +1121,7 @@ int mbox_static_message(request_rec *r, 
     mbox_dir_cfg_t *conf;
     Message *m;
 
-    char *baseURI, *from, **context, *msgID;
+    char *baseURI, *from, **context, *msgID, *escaped_msgID;
 
     conf = ap_get_module_config(r->per_dir_config, &mbox_module);
     baseURI = get_base_uri(r);
@@ -1229,15 +1229,16 @@ int mbox_static_message(request_rec *r, 
     ap_rputs("   <tr class=\"mime\">\n"
              "    <td class=\"left\">Mime</td>\n"
              "    <td class=\"right\">\n<ul>\n", r);
+    escaped_msgID = URI_ESCAPE_OR_BLANK(r->pool, m->msgID);
     mbox_mime_display_static_structure(r, m->mime_msg,
                                        apr_psprintf(r->pool, "%s/raw/%s/",
-                                                    baseURI, m->msgID));
+                                                    baseURI, escaped_msgID));
     ap_rputs("</ul>\n</td>\n</tr>\n", r);
 
     ap_rprintf(r, "   <tr class=\"raw\">\n"
                "    <td class=\"left\"></td>\n"
                "    <td class=\"right\"><a href=\"%s/raw/%s\" rel=\"nofollow\">View
raw message</a></td>\n"
-               "   </tr>\n", baseURI, URI_ESCAPE_OR_BLANK(r->pool, m->msgID));
+               "   </tr>\n", baseURI, escaped_msgID);
 
     ap_rputs("   </tbody>\n", r);
     ap_rputs("  </table>\n", r);



Mime
View raw message