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 );

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 19 2025 07:04:17
Script start
Timing: Jan 19 2025 07:04:17
Module start 'layout'
Timing: Jan 19 2025 07:04:17
Module start 'content'
Timing: Jan 19 2025 07:04:18
Module end 'content'
Timing: Jan 19 2025 07:04:18
Script end

Main resources:

Total runtime0.9845 sec
Peak memory usage4,096.0000 KB
Database Queries46

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0051 589.4141152.6563
Module start 'layout' 0.00510.0032 742.070339.5078
Module start 'content' 0.00830.9745 781.5781400.6250
Module end 'content' 0.98290.0016 1,182.20318.0938
Script end 0.9845  1,190.2969 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.3284160.0002
Check MTime0.00130.1334160.0001
Mysql Total
Database connection0.00060.065210.0006
Mysqli_queries0.946196.1050460.0206
Looping result0.00060.0637440.0000
Template Total0.949096.420.4745
Template load0.00210.214120.0011
Template processing0.946996.178120.4734
Template load and register function0.00010.013410.0001
states
state_id_array0.00100.102010.0010
state_identifier_array0.00140.144720.0007
Override
Cache load0.00170.1706100.0002
Sytem overhead
Fetch class attribute can translate value0.00070.068410.0007
Fetch class attribute name0.00040.041110.0004
XML
Image XML parsing0.00010.013310.0001
class_abstraction
Instantiating content class attribute0.00000.000410.0000
General
dbfile0.00070.0711100.0001
String conversion0.00000.000940.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
1content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
2content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 6
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs