ASF Bugzilla – Attachment 21413 Details for
Bug 44279
Add "iterate" flag to apply rule in a loop while pattern matches
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch against 2.2.x
rewrite-iterate-2_2_x.patch (text/plain), 2.49 KB, created by
Rainer Jung
on 2008-01-22 10:26:37 UTC
(
hide
)
Description:
Patch against 2.2.x
Filename:
MIME Type:
Creator:
Rainer Jung
Created:
2008-01-22 10:26:37 UTC
Size:
2.49 KB
patch
obsolete
>Index: modules/mappers/mod_rewrite.c >=================================================================== >--- modules/mappers/mod_rewrite.c (revision 614276) >+++ modules/mappers/mod_rewrite.c (working copy) >@@ -147,6 +147,7 @@ > #define RULEFLAG_NOSUB 1<<12 > #define RULEFLAG_STATUS 1<<13 > #define RULEFLAG_ESCAPEBACKREF 1<<14 >+#define RULEFLAG_ITERATE 1<<15 > > /* return code of the rewrite rule > * the result may be escaped - or not >@@ -3261,6 +3262,16 @@ > } > break; > >+ case 'i': >+ case 'I': >+ if (!*key || !strcasecmp(key, "terate")) { /* iterate */ >+ cfg->flags |= RULEFLAG_ITERATE; >+ } >+ else { >+ ++error; >+ } >+ break; >+ > case 'l': > case 'L': > if (!*key || !strcasecmp(key, "ast")) { /* last */ >@@ -3936,10 +3947,20 @@ > rc = apply_rewrite_rule(p, ctx); > > if (rc) { >- /* Regardless of what we do next, we've found a match. Check to see >- * if any of the request header fields were involved, and add them >- * to the Vary field of the response. >+ /* Regardless of what we do next, we've found a match. >+ * Iterate over the rule as long as it matches, >+ * if the iteration flag has been set. >+ * Don't detroy return code from first match. > */ >+ if (p->flags & RULEFLAG_ITERATE) { >+ while(apply_rewrite_rule(p, ctx)) { >+ } >+ } >+ >+ /* >+ * Check to see if any of the request header fields were >+ * involved, and add them to the Vary field of the response. >+ */ > if (ctx->vary) { > apr_table_merge(r->headers_out, "Vary", ctx->vary); > } >Index: docs/manual/mod/mod_rewrite.xml >=================================================================== >--- docs/manual/mod/mod_rewrite.xml (revision 614277) >+++ docs/manual/mod/mod_rewrite.xml (working copy) >@@ -1318,6 +1318,12 @@ > inside the mapped directory to have a handler of > ``<code>cgi-script</code>''.</dd> > >+ <dt> >+ '<code>iterate|I</code>' >+ (iterate while match)</dt><dd> >+ Iterate the rewrite rule as long as the RewriteCond applies >+ and the <em>Pattern</em> matches.</dd> >+ > <dt>'<code>last|L</code>' > (last rule)</dt><dd> Stop the rewriting process > here and don't apply any more rewrite rules. This corresponds
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 44279
:
21412
| 21413