Welcome! » Log In » Create A New Profile

Quotes added to property background: url()

Posted by D4P 
D4P
Quotes added to property background: url()
August 05, 2010 03:36AM

Hello Ambush,

I'm having a problem where style="background-image: url(http://www.blah.com/image.gif);" is begin converted to style="background-image: url("http://www.blah.com/image.gif");" which is creating the problem of double-quotes within double-quotes. Is this a problem with HTML Purifier or am I doing something wrong?

Best, D4P

Re: Quotes added to property background: url()
August 05, 2010 03:45AM

The inner quotes should be escaped appropriately. Are you doing any post-processing?

Yes actually I was performing an htmlspecialchars_decode() on the output, which was causing the problem. Thank you. ;)

Author:
Your Email:

Subject:

HTML input is enabled. Make sure you escape all HTML and angled brackets with < and >.

Auto-paragraphing is enabled. Double newlines will be converted to paragraphs; for single newlines, use the pre tag.

Allowed tags: a, abbr, acronym, b, blockquote, caption, cite, code, dd, del, dfn, div, dl, dt, em, i, ins, kbd, li, ol, p, pre, s, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, var.

For inputting literal code such as HTML and PHP for display, use CDATA tags to auto-escape your angled brackets, and pre to preserve newlines:

<pre><![CDATA[
Place code here
]]></pre>

Power users, you can hide this notice with:

.htmlpurifier-help {display:none;}

Message: