Commit 5cf478ff authored by dgaudet's avatar dgaudet
Browse files

Update mod_rewrite from 3.0.5 to 3.0.6.

Reviewed by:	Dean, Alexei
Submitted by:	Ralf
Obtained from:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3@78388 13f79535-47bb-0310-9956-ffa450edef68
parent 000a4639
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
Changes with Apache 1.2.1

  *) Update mod_rewrite from 3.0.5 to 3.0.6.  New ruleflag
     QSA=query_string_append.  Also fixed a nasty bug in per-dir context:
     when a URL http://... was used in concunction with a special
     redirect flag, e.g. R=permanent, the permanent status was lost.
     [Ronald Tschalaer <Ronald.Tschalaer@psi.ch>, Ralf S. Engelschall]

  *) If an object has multiple variants that are otherwise equal Apache
     would prefer the last listed variant rather than the first.
     [Paul Sutton] PR#94
+12 −4
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@
**  |_| |_| |_|\___/ \__,_|___|_|  \___| \_/\_/ |_|  |_|\__\___|
**                       |_____|
**
**  URL Rewriting Module, Version 3.0.5 (16-Apr-1997)
**  URL Rewriting Module, Version 3.0.6 (15-Jun-1997)
**
**  This module uses a rule-based rewriting engine (based on a
**  regular-expression parser) to rewrite requested URLs on the fly. 
@@ -779,6 +779,10 @@ static const char *cmd_rewriterule_setflag(pool *p, rewriterule_entry *cfg, char
             || strcasecmp(key, "G") == 0   ) {
        cfg->flags |= RULEFLAG_GONE;
    }
    else if (   strcasecmp(key, "qsappend") == 0
             || strcasecmp(key, "QSA") == 0   ) {
        cfg->flags |= RULEFLAG_QSAPPEND;
    }
    else {
        return pstrcat(p, "RewriteRule: unknown flag '", key, "'\n", NULL);
    }
@@ -1559,6 +1563,7 @@ static int apply_rewrite_rule(request_rec *r, rewriterule_entry *p, char *perdir
            }
            rewritelog(r, 2, "[per-dir %s] redirect %s -> %s", perdir, r->filename, newuri);
            r->filename = pstrdup(r->pool, newuri);
            r->status = p->forced_responsecode;
            return 1;
        }

@@ -1602,7 +1607,7 @@ static int apply_rewrite_rule(request_rec *r, rewriterule_entry *p, char *perdir
        reduce_uri(r);

        /* split out on-the-fly generated QUERY_STRING '....?xxxxx&xxxx...' */
        splitout_queryargs(r);
        splitout_queryargs(r, p->flags & RULEFLAG_QSAPPEND);

        /* if a MIME-type should be later forced for this URL, then remember this */
        if (p->forced_mimetype != NULL) {
@@ -1788,7 +1793,7 @@ static int apply_rewrite_cond(request_rec *r, rewritecond_entry *p, char *perdir
**
*/

static void splitout_queryargs(request_rec *r)
static void splitout_queryargs(request_rec *r, int qsappend)
{
    char *q;
    char *olduri;
@@ -1797,7 +1802,10 @@ static void splitout_queryargs(request_rec *r)
    if (q != NULL) {
        olduri = pstrdup(r->pool, r->filename);
        *q++ = '\0';
        if (qsappend)
            r->args = pstrcat(r->pool, q, "&", r->args, NULL);
        else
            r->args = pstrdup(r->pool, q);
        if (r->args[strlen(r->args)-1] == '&')
            r->args[strlen(r->args)-1] = '\0';
        rewritelog(r, 3, "split uri=%s -> uri=%s, args=%s", olduri, r->filename, r->args);
+3 −2
Original line number Diff line number Diff line
@@ -64,7 +64,7 @@
**  |_| |_| |_|\___/ \__,_|___|_|  \___| \_/\_/ |_|  |_|\__\___|
**                       |_____|
**
**  URL Rewriting Module, Version 3.0.5 (16-Apr-1997)
**  URL Rewriting Module, Version 3.0.6 (15-Jun-1997)
**
**  This module uses a rule-based rewriting engine (based on a
**  regular-expression parser) to rewrite requested URLs on the fly. 
@@ -171,6 +171,7 @@
#define RULEFLAG_PASSTHROUGH        1<<8
#define RULEFLAG_FORBIDDEN          1<<9
#define RULEFLAG_GONE               1<<10
#define RULEFLAG_QSAPPEND           1<<11

#define MAPTYPE_TXT                 1<<0
#define MAPTYPE_DBM                 1<<1
@@ -334,7 +335,7 @@ static int apply_rewrite_rule(request_rec *r, rewriterule_entry *p, char *perdir
static int apply_rewrite_cond(request_rec *r, rewritecond_entry *p, char *perdir); 

    /* URI transformation function */
static void  splitout_queryargs(request_rec *r);
static void  splitout_queryargs(request_rec *r, int qsappend);
static void  reduce_uri(request_rec *r);
static char *expand_tildepaths(request_rec *r, char *uri);
static void  expand_map_lookups(request_rec *r, char *uri, int uri_len);