PhpDig.net

PhpDig.net (http://www.phpdig.net/forum/index.php)
-   Mod Requests (http://www.phpdig.net/forum/forumdisplay.php?f=23)
-   -   Hex htmlentities (http://www.phpdig.net/forum/showthread.php?t=239)

renehaentjens 11-24-2003 03:39 AM

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?

Charter 11-24-2003 05:13 PM

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



renehaentjens 11-27-2003 06:48 AM

Thanks. I'll make a test as soon as I can.

renehaentjens 12-08-2003 02:44 AM

Works OK for me now. Thanks.


All times are GMT -8. The time now is 07:02 AM.

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