You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Micha Lenk <mi...@lenk.info> on 2014/03/19 22:26:38 UTC

[PATCH ASF bugzilla #56288] mod_proxy_html could rewrite URLs in HTML style attributes too

Hi Apache developers,

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 (Thomas, Ewald, this is issue #22583 in our Mantis).

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. The attached 
patch is based on httpd trunk, rev. 1579365 plus the patch for issue 
#56284 applied.

Regards,
Micha

Re: [PATCH ASF bugzilla #56288] mod_proxy_html could rewrite URLs in HTML style attributes too

Posted by Micha Lenk <mi...@lenk.info>.
Hi,

the patch was missing in my previous mail. See attachment.

Regards,
Micha


On 19.03.2014 22:26, Micha Lenk wrote:
> Hi Apache developers,
>
> 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 (Thomas, Ewald, this is issue #22583 in our Mantis).
>
> 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. The attached
> patch is based on httpd trunk, rev. 1579365 plus the patch for issue
> #56284 applied.
>
> Regards,
> Micha