1 |
1546
|
Luisehahne
|
<?php
|
2 |
|
|
/**
|
3 |
|
|
* QuickSkin Extension entity_decode
|
4 |
|
|
* Convert all HTML entities to their applicable characters
|
5 |
|
|
*
|
6 |
|
|
* Usage Example:
|
7 |
|
|
* Content: $template->assign('MESSAGE', 'Nicht möglich!');
|
8 |
|
|
* Template: <a href="alert('{entity_decode:MESSAGE}');">Alert</a>
|
9 |
|
|
* Result: <a href="alert('Nicht m?lich!');">Alert</a>
|
10 |
|
|
*
|
11 |
|
|
* @author Andy Prevost andy@codeworxtech.com - original by Philipp v. Criegern philipp@criegern.de
|
12 |
|
|
*/
|
13 |
|
|
function qx_entity_decode ( $param ) {
|
14 |
|
|
$param = strtr($param, array_flip(get_html_translation_table(HTML_ENTITIES)));
|
15 |
|
|
$param = preg_replace("/&#([0-9]+);/me", "chr('\\1')", $param);
|
16 |
|
|
return $param;
|
17 |
|
|
}
|