Hi Nick, the q does not guarantee that the second one is ignored. It only can happen that it is ignored. So if you have two Substitute lines use the q flag to ensure that it is not ignored.
Regards Rüdiger > -----Ursprüngliche Nachricht----- > Von: Nick Gearls [mailto:[email protected]] > Gesendet: Dienstag, 31. März 2009 14:00 > An: Development Apache > Betreff: Substitute bug > > In a page containing only "abcdef" (inside the <body>), and the > following directives, > Substitute s~(abc.*)$~$1~q > Substitute s~def~XXX~ > the second directive should be ignored, because of the q flag on the > first one. > The result should be "abcdef". > However, the result is "abcXXX". > > Did I miss something ? > > PS: I applied Rüdiger Plüm's patch: > > Index: modules/filters/mod_substitute.c > > =================================================================== > > --- modules/filters/mod_substitute.c (revision 753197) > > +++ modules/filters/mod_substitute.c (working copy) > > @@ -199,7 +199,6 @@ > > tmp_b = apr_bucket_transient_create(s1, > strlen(s1), > > > f->r->connection->bucket_alloc); > > APR_BUCKET_INSERT_BEFORE(b, tmp_b); > > - tmp_b = APR_BUCKET_NEXT(b); > > apr_bucket_delete(b); > > b = tmp_b; > > } > > @@ -249,7 +248,6 @@ > > tmp_b = apr_bucket_transient_create(s1, > strlen(s1), > > > f->r->connection->bucket_alloc); > > APR_BUCKET_INSERT_BEFORE(b, tmp_b); > > - tmp_b = APR_BUCKET_NEXT(b); > > apr_bucket_delete(b); > > b = tmp_b; > > } > > Regards, > > Nick > >
