httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 48520] mod_substitute only process the first match
Date Fri, 22 Jan 2010 12:49:39 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=48520

Ruediger Pluem <rpluem@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID

--- Comment #6 from Ruediger Pluem <rpluem@apache.org> 2010-01-22 05:49:39 CET ---
(In reply to comment #4)
> Adding the supplied test HTML to the docroot directory and this configuration
> to the default httpd.conf in httpd-2.2.14 you should expect to see all the
> links pointing to /scores/ but only the first one gets substituted.
> 
> <Location /test_sub/>
>   AddOutputFilterByType SUBSTITUTE text/html
>   Substitute "s|http://.*/merge/tsnform.aspx\?c=client-.*?&(.*)|/scores/?$1|i"
>   Substitute "s|/merge/tsnform.aspx\?c=client-.*?&(.*)|/scores/?$1|i"
>   Substitute "s|/merge/tsnform.aspx\?c=sportsnetwork&(.*)|/scores/?$1|i"
>   Substitute
> "s|http://images.sportsnetwork.com/(.*)|/scores/resources/images/$1|i"
>   Substitute "s|http://.*/fury/(.*)|/scores/resources/fury/$1|i"
>   #Substitute "s|/xml/(.*)|/scores/resources/xml/$1|i"
>   Substitute "s|/images/(.*)|/scores/resources/images/$1|i"
>   RequestHeader   unset   Accept-Encoding
> 
> </Location>
> 
> Applying the suggested patch or using httpd-2.2.11 shows the expected
> behaviour: all the links are substituted.

As everything in your testfile is in one line the result is as expected as your
regular expressions are just plain wrong. They should be

   Substitute
"s|http://.*/merge/tsnform.aspx\?c=client-.*?&(.*)\"|/scores/?$1|i"
   Substitute "s|/merge/tsnform.aspx\?c=client-.*?&(.*)\"|/scores/?$1|i"
   Substitute "s|/merge/tsnform.aspx\?c=sportsnetwork&(.*)\"|/scores/?$1|i"
   Substitute
 "s|http://images.sportsnetwork.com/(.*)\"|/scores/resources/images/$1|i"
   Substitute "s|http://.*/fury/(.*)\"|/scores/resources/fury/$1|i"
   #Substitute "s|/xml/(.*)\"|/scores/resources/xml/$1|i"
   Substitute "s|/images/(.*)\"|/scores/resources/images/$1|i"

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


Mime
View raw message