Forums / Developer / Special characters - how to preserve html encoded entities.

Special characters - how to preserve html encoded entities.

Author Message

Kjell Rune Skaaraas

Monday 08 August 2005 3:54:10 am

I had a problem with special characters, and didn't see any fix by neither the developers or the community. Here's the fix:

In kernel\classes\datatypes\ezxmltext\handlers\output\ezxhtmlxmloutput.php:

After:
$text = htmlspecialchars( $tag->content() );
Add the following:
// Restore all existing HTML entities transformed by htmlspecialchars()
$text = preg_replace("/&(#[0-9]+|[a-z]+);/i", "&$1;", $text );

eZ debug

Timing: Jan 19 2025 04:26:50
Script start
Timing: Jan 19 2025 04:26:50
Module start 'content'
Timing: Jan 19 2025 04:26:50
Module end 'content'
Timing: Jan 19 2025 04:26:50
Script end

Main resources:

Total runtime0.0142 sec
Peak memory usage2,048.0000 KB
Database Queries4

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0068 589.2109180.7969
Module start 'content' 0.00680.0038 770.007889.8672
Module end 'content' 0.01060.0036 859.875066.7031
Script end 0.0141  926.5781 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002215.3916120.0002
Check MTime0.00117.5931120.0001
Mysql Total
Database connection0.00085.882610.0008
Mysqli_queries0.002920.331340.0007
Looping result0.00000.163320.0000
Template Total0.003323.110.0033
Template load0.00085.960010.0008
Template processing0.002417.103810.0024
Override
Cache load0.00064.251110.0006
General
dbfile0.00031.9833100.0000
String conversion0.00000.055630.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs