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

*/ ?>

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 31 2025 01:13:58
Script start
Timing: Jan 31 2025 01:13:58
Module start 'layout'
Timing: Jan 31 2025 01:13:58
Module start 'content'
Timing: Jan 31 2025 01:13:59
Module end 'content'
Timing: Jan 31 2025 01:13:59
Script end

Main resources:

Total runtime0.9251 sec
Peak memory usage8,192.0000 KB
Database Queries52

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0046 588.1250151.2109
Module start 'layout' 0.00460.0033 739.3359220.6875
Module start 'content' 0.00780.9165 960.02344,163.6328
Module end 'content' 0.92430.0008 5,123.65637.8516
Script end 0.9251  5,131.5078 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.3464160.0002
Check MTime0.00120.1319160.0001
Mysql Total
Database connection0.00060.064510.0006
Mysqli_queries0.858192.7551520.0165
Looping result0.00040.0381500.0000
Template Total0.876794.820.4383
Template load0.00190.209720.0010
Template processing0.874794.549720.4374
Template load and register function0.00120.128210.0012
states
state_id_array0.00210.225610.0021
state_identifier_array0.00180.191720.0009
Override
Cache load0.00160.1693200.0001
Sytem overhead
Fetch class attribute can translate value0.00140.151510.0014
Fetch class attribute name0.00160.172920.0008
XML
Image XML parsing0.00010.009610.0001
class_abstraction
Instantiating content class attribute0.00000.000720.0000
General
dbfile0.00210.2292100.0002
String conversion0.00000.001140.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 10
 Number of unique templates used: 5

Time used to render debug report: 0.0002 secs