svn commit: r1934982 - in httpd/httpd/branches/2.4.x: . modules/proxy

[email protected] Thu, 04 Jun 2026 15:48:59 -0000
Newsgroups gmane.comp.apache.cvs
Message-ID <178058813955.2785032.16444992421369406825@svn03-he-fi>
Author: jorton
Date: Thu Jun  4 15:48:59 2026
New Revision: 1934982

Log:
Merge r1934981 from trunk:

* modules/proxy/mod_proxy_ftp.c (proxy_ftp_dir_filter): Use
  ap_os_escape_path() with ap_escape_html() instead of
  ap_escape_uri() for href attributes in generated directory
  listing links.

Reviewed by: jorton, covener, jfclere

Modified:
   httpd/httpd/branches/2.4.x/   (props changed)
   httpd/httpd/branches/2.4.x/modules/proxy/mod_proxy_ftp.c

Modified: httpd/httpd/branches/2.4.x/modules/proxy/mod_proxy_ftp.c
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/proxy/mod_proxy_ftp.c	Thu Jun  4 15:48:00 2026	(r1934981)
+++ httpd/httpd/branches/2.4.x/modules/proxy/mod_proxy_ftp.c	Thu Jun  4 15:48:59 2026	(r1934982)
@@ -675,7 +675,7 @@ static apr_status_t proxy_send_dir_filte
             *(link_ptr++) = '\0';
             str = apr_psprintf(p, "%s <a href=\"%s\">%s %s</a>\n",
                                ap_escape_html(p, ctx->buffer),
-                               ap_escape_uri(p, filename),
+                               ap_escape_html(p, ap_os_escape_path(p, filename, 0)),
                                ap_escape_html(p, filename),
                                ap_escape_html(p, link_ptr));
         }
@@ -721,13 +721,13 @@ static apr_status_t proxy_send_dir_filte
             if (!strcmp(filename, ".") || !strcmp(filename, "..") || ctx->buffer[0] == 'd') {
                 str = apr_psprintf(p, "%s <a href=\"%s/\">%s</a>\n",
                                    ap_escape_html(p, ctx->buffer),
-                                   ap_escape_uri(p, filename),
+                                   ap_escape_html(p, ap_os_escape_path(p, filename, 0)),
                                    ap_escape_html(p, filename));
             }
             else {
                 str = apr_psprintf(p, "%s <a href=\"%s\">%s</a>\n",
                                    ap_escape_html(p, ctx->buffer),
-                                   ap_escape_uri(p, filename),
+                                   ap_escape_html(p, ap_os_escape_path(p, filename, 0)),
                                    ap_escape_html(p, filename));
             }
         }
@@ -740,7 +740,9 @@ static apr_status_t proxy_send_dir_filte
             filename = apr_pstrndup(p, &ctx->buffer[re_result[2].rm_so], re_result[2].rm_eo - re_result[2].rm_so);
 
             str = apr_pstrcat(p, ap_escape_html(p, apr_pstrndup(p, ctx->buffer, re_result[2].rm_so)),
-                              "<a href=\"", ap_escape_uri(p, filename), "\">",
+                              "<a href=\"",
+                              ap_escape_html(p, ap_os_escape_path(p, filename, 0)),
+                              "\">",
                               ap_escape_html(p, filename), "</a>\n", NULL);
         }
         else {