Diff for Metafox/lib/Platon.php between version 1.5 and 1.6
| version 1.5, 2006/07/08 20:05:34 |
version 1.6, 2007/04/29 13:20:07 |
|
|
| * @access public |
* @access public |
| */ |
*/ |
| |
|
| /* $Platon: phpPlatonLib/Platon/Platon.php,v 1.33 2005/11/07 23:21:17 nepto Exp $ */ |
/* $Platon: phpPlatonLib/Platon/Platon.php,v 1.38 2007-04-29 13:19:15 nepto Exp $ */ |
| |
|
| class Platon |
class Platon |
| { |
{ |
|
|
| $str = preg_replace('/</i', '<', $str); |
$str = preg_replace('/</i', '<', $str); |
| $str = preg_replace('/"/i', '\'', $str); |
$str = preg_replace('/"/i', '\'', $str); |
| $str = preg_replace('/&/i', '&', $str); |
$str = preg_replace('/&/i', '&', $str); |
| |
// do also reverse of Platon::htmlspecialchars2() |
| |
$str = preg_replace('/ /i', ' ', $str); |
| return $str; |
return $str; |
| } /* }}} */ |
} /* }}} */ |
| |
|
|
|
| case 'url': |
case 'url': |
| // escape every character into hex |
// escape every character into hex |
| for ($x = 0; $x < strlen($email); $x++) { |
for ($x = 0; $x < strlen($email); $x++) { |
| $ret .= '%' . bin2hex($email[$x]); |
if ($email[$x] == '@') { |
| |
$ret .= '@'; // Opera browser hack |
| |
} else { |
| |
$ret .= '%' . bin2hex($email[$x]); |
| |
} |
| } |
} |
| if ($mode == 'url') { |
if ($mode == 'url') { |
| break; |
break; |
Platon Group <platon@platon.org> http://platon.org/
|
|