HOME | COMPANY INFO | PRODUCTS | CLIENTS | SUPPORT
DCScripts Bugtrac system | DCScripts support forum

Subject: "Some foreign characters do not show correctly"     Previous Topic | Next Topic
Printer-friendly copy     Email this topic to a friend    
Products DCF+ 1.2x Topic #25
Reading Topic #25
Author David
Date/Time Apr-11-03, 05:27 AM (EDT)
Description Some foreign characters do not show correctly
Fix LAST EDITED ON Apr-11-03 AT 05:51 AM (EDT)
 
This is due to function htmlspecialchars translating & to &. A work around is to use a new limited htmlspecialcharsltgt that translates only < and > sign. To do this, modify following modules:

1. include/dcfilterlib.php
--------------------------------

In function myhtmlspecialchars, look for:


elseif (SETUP_IMAGE_ALLOWED == 'yes') {
$str = htmlspecialchars($str);
$str = image_link($str);
}
else {
$str = htmlspecialchars($str);
}

replace with


elseif (SETUP_IMAGE_ALLOWED == 'yes') {
$str = htmlspecialcharsltgt($str);
$str = image_link($str);
}
else {
$str = htmlspecialcharsltgt($str);
}

Then add following function at the bottom of dcfilterlib.php (just before ?>):


function htmlspecialcharsltgt($str) {
$str = preg_replace('/</','&lt;',$str);
$str = preg_replace('/>/','&gt;',$str);
return $str;
}


2. lib/show_topics.php
---------------------------------
Look for


$caption = htmlspecialchars(
wordwrap(
substr($row['message'],0,SETUP_CAPTION_LENGTH), 20, " ",1));

replace with


$caption = htmlspecialcharsltgt(
wordwrap(
substr($row['message'],0,SETUP_CAPTION_LENGTH), 20, " ",1));


Similar changes must be made to other modules such as preview screen...these will follow.


Conferences | Topics | Previous Topic | Next Topic