Commit 045d13e1 authored by Ruediger Pluem's avatar Ruediger Pluem
Browse files

* Allow empty substitute patterns (to remove data from the stream), but

  disallow empty search patterns.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@693727 13f79535-47bb-0310-9956-ffa450edef68
parent 5ce7a6ca
Loading
Loading
Loading
Loading
+5 −1
Changes for modules/filters/mod_substitute.c: 5 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -507,21 +507,25 @@ static const char *set_pattern(cmd_parms *cmd, void *cfg, const char *line)
    if (delim)
        from = ++ourline;
    if (from) {
        if (*ourline != delim) {
            while (*++ourline && *ourline != delim);
        }
        if (*ourline) {
            *ourline = '\0';
            to = ++ourline;
        }
    }
    if (to) {
        if (*ourline != delim) {
            while (*++ourline && *ourline != delim);
        }
        if (*ourline) {
            *ourline = '\0';
            flags = ++ourline;
        }
    }

    if (!delim || !from || !to) {
    if (!delim || !from || !*from || !to) {
        return "Bad Substitute format, must be a complete s/// pattern";
    }