Revision 2009
Added by darkviper almost 12 years ago
| functions-utf8.php | ||
|---|---|---|
| 406 | 406 |
// convert to HTML-entities, and replace entites by hex-numbers |
| 407 | 407 |
$str = utf8_fast_umlauts_to_entities($str, false); |
| 408 | 408 |
$str = str_replace(''', ''', $str);
|
| 409 |
$str = preg_replace('/&#([0-9]+);/e', "dechex('$1')", $str);
|
|
| 409 |
if (version_compare(PHP_VERSION, '5.3', '<')) {
|
|
| 410 |
$str = preg_replace('/&#([0-9]+);/e', "dechex('$1')", $str);
|
|
| 411 |
} else {
|
|
| 412 |
$str = preg_replace_callback('/&#([0-9]+);/', create_function('$aMatches', 'return dechex($aMatches[1]);'), $str);
|
|
| 413 |
} |
|
| 410 | 414 |
// maybe there are some > < ' " & left, replace them too |
| 411 | 415 |
$str = str_replace(array('>', '<', ''', '\'', '"', '&'), '', $str);
|
| 412 | 416 |
$str = str_replace('&', '', $str);
|
Also available in: Unified diff
! framework/functions-utf8::entities_to_7bit() deprecated warning for modifier /e in preg_replace() corrected