Forums / General / Backslash quotes in a text

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

Backslash quotes in a text

Author Message

Christian BELLET

Tuesday 29 July 2008 8:47:39 am

Hello,
I have to return a string in a javascript function but I need to escape quotes with backslashes..

For instance :

document.write('blabla there's a quote here');

would return an error.

Can you tell me which function should I use ?

Thanks

Christian BELLET

Tuesday 29 July 2008 9:03:56 am

Ok, here is the workaround.
I just remember I did it in the past

In template.ini.append.php

<?php /* #?ini charset="utf-8"?

[PHP]
PHPOperatorList[]
PHPOperatorList[urlencode]=urlencode
PHPOperatorList[addslashes]=addslashes

*/ ?>