PhpDig.net

Go Back   PhpDig.net > PhpDig Forums > Mod Requests

Reply
 
Thread Tools
Old 11-24-2003, 03:39 AM   #1
renehaentjens
Orange Mole
 
Join Date: Nov 2003
Posts: 69
Hex htmlentities

I'm checking a couple of things in phpDig 1.6.4.

In robot_functions.php, the function phpdigCleanHtml has a line:
Quote:
$text = ereg_replace('&#([0-9]+);',chr('\1').' ',$text);
I guess that this line recognises entities such as ' & # 233; ' as being lowercase e with acute accent.

I see no code to recognise equivalent entities such as ' & # x e9; '. If these hex entities aren't currently recognised, could the code be added to recognise them?
__________________
René Haentjens, Ghent University
renehaentjens is offline   Reply With Quote
Old 11-24-2003, 05:13 PM   #2
Charter
Head Mole
 
Charter's Avatar
 
Join Date: May 2003
Posts: 2,539
Hi. In robot_functions find:
PHP Code:
$text ereg_replace('&#([0-9]+);',chr('\\1').' ',$text); 
and replace with:
PHP Code:
while (eregi('&#([0-9]{3});',$text,$reg)) {
    
$text str_replace($reg[0],chr($reg[1]),$text);
}
while (
eregi('&#x([a-f0-9]{2});',$text,$reg)) {
    
$text str_replace($reg[0],chr(base_convert($reg[1],16,10)),$text);

__________________
Responses are offered on a voluntary if/as time is available basis, no guarantees. Double posting or bumping threads will not get your question answered any faster. No support via PM or email, responses not guaranteed. Thank you for your comprehension.
Charter is offline   Reply With Quote
Old 11-27-2003, 06:48 AM   #3
renehaentjens
Orange Mole
 
Join Date: Nov 2003
Posts: 69
Thanks. I'll make a test as soon as I can.
__________________
René Haentjens, Ghent University
renehaentjens is offline   Reply With Quote
Old 12-08-2003, 02:44 AM   #4
renehaentjens
Orange Mole
 
Join Date: Nov 2003
Posts: 69
Works OK for me now. Thanks.
__________________
René Haentjens, Ghent University
renehaentjens is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 08:22 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.