Forums / Developer / Problem with quotes and double quotes in a string

Problem with quotes and double quotes in a string

Author Message

Romain Bremaud

Tuesday 02 November 2010 4:09:29 am

Hello everybody.

I have a problem with strings which possess quotes or doubles quotes.

Exemple I have the following code:

<a href="http://www.addthis.com/bookmark.php" 

    class="addthis_button"

    addthis:url={$node.url|ezurl('no','full'))}

    addthis:title={$title}>

</a>

</div>

In my variable $title if I have ' or " my string is broken.

Anyone have an idea to by-pass the problem?

Thanks in advance

Romain Bremaud
Les clefs du net

Christian Rößler

Tuesday 02 November 2010 5:59:12 am

This should do the trick:

http://doc.ez.no/eZ-Publish/Technical-manual/4.x/Reference/Template-operators/Strings/wash

... {$title|wash()} ...

Hannover, Germany
eZ-Certified http://auth.ez.no/certification/verify/395613

Romain Bremaud

Tuesday 02 November 2010 8:34:28 am

Thanks a lot Christian it works.

Romain Bremaud
Les clefs du net