Created attachment 31412 [details] Rewrite URLs in HTML style attributes too In HTML you can have <div> tags that have a background image by providing a style attribute. E.g. this can be done by something fancy like this: <div style="background:url(http://www.example.com/fancy-background.png) right 0px no-repeat; height:325px;"> Currently mod_proxy_html doesn't rewrite the URL in such style attributes. The attached patch tries to fix that by applying the configured string replacements also on style attributes. Additionally it tries to make the code a bit more readable by renaming the function dump_content() to apply_urlmap(). This is what it actually does, especially after the call to AP_fwrite() has been moved outside of this function. Please note that this patch requires the patch from issue #56284 to be applied first. Otherwise the last chunk will not apply.
What are you trying to do that isn't supported by adding style to ProxyHTMLEvents and applying a suitable regexp?
*** Bug 56992 has been marked as a duplicate of this bug. ***
Can you write in the documentation in this case an example of such a regex. As you can see in my bug report I tried it with ProxyHTMLLinks which didn't work. And from reading the documentation it seems to me that it should work as well. As a side note. I did add "style" to the list of ProxyHTMLEvents. And somehow it still didn't work. Could it be that only one attribute is parsed per element?
One other thing. I did test this on an older machine with apache httpd 2.2.16 with the mod_proxy_html version 3.0.1. And there the style attribute gets parsed. So I would consider this as a bug.
(In reply to Raffael Luthiger from comment #3) > Can you write in the documentation in this case an example of such a regex. I'm adding ProxyHTMLLinks and ProxyHTMLEvents usage examples in the docs - thanks for the suggestion. > As a side note. I did add "style" to the list of ProxyHTMLEvents. And > somehow it still didn't work. Could it be that only one attribute is parsed > per element? "didn't work"? Have you sorted it yet? If not, I suggest asking on the users list: the issue is probably a problem with your matching regexp, or with your options/flags.
Nick, closing a bug with a patch with a clear example of what I expect to get rewritten, but doesn't get rewritten, pretty much looks like you didn't even try. Come on, please give it a try.
I tested it when I closed the bug. I just retested today with a cut-and-paste of your <div style="background:url(http://www.example.com/fancy-background.png) right 0px no-repeat; height:325px;"> Both times, the link got rewritten exactly as I'd expect. I don't see what else I'm supposed to do here. So I'll leave this and suggest anyone having similar problems seek help on the mailinglist.
Hi Nick, you wrote: > I just retested today with a cut-and-paste of your > <div style="background:url(http://www.example.com/fancy-background.png) right 0px no-repeat; height:325px;"> > > Both times, the link got rewritten exactly as I'd expect. Would you mind to provide the exact configuration you used to achieve this rewriting?
(In reply to Micha Lenk from comment #8) > Hi Nick, > > you wrote: > > I just retested today with a cut-and-paste of your > > <div style="background:url(http://www.example.com/fancy-background.png) right 0px no-repeat; height:325px;"> > > > > Both times, the link got rewritten exactly as I'd expect. > > Would you mind to provide the exact configuration you used to achieve this > rewriting? Hi, The following setup worked for me: ProxyHTMLLinks div style ProxyHTMLURLMap url\(http: url(https: R