summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorSavetheinternet <savetheinternet@tinyboard.org>2011-10-10 21:06:39 +1100
committerSavetheinternet <savetheinternet@tinyboard.org>2011-10-10 21:06:39 +1100
commit85d37a55c31c7c69eef80f0395d5355b8b511042 (patch)
treeaa9bbbc5b31adc3686c14f37e900a332d645eac7 /inc
parentbf803e5d5883f36f7391b248e32cf5f568d99ce7 (diff)
remove the retard function html_entity_decode_utf8(). not sure why seisatsu added it in the first place.
Diffstat (limited to 'inc')
-rw-r--r--inc/display.php2
-rw-r--r--inc/functions.php20
2 files changed, 2 insertions, 20 deletions
diff --git a/inc/display.php b/inc/display.php
index 74720de4..05f9aeec 100644
--- a/inc/display.php
+++ b/inc/display.php
@@ -114,7 +114,7 @@
$body = strip_tags($body);
// Unescape HTML characters, to avoid splitting them in half
- $body = html_entity_decode_utf8($body);
+ $body = html_entity_decode($body, ENT_NOQUOTES, 'UTF-8');
// calculate strlen() so we can add "..." after if needed
$strlen = strlen($body);
diff --git a/inc/functions.php b/inc/functions.php
index 9d155978..70e5eadd 100644
--- a/inc/functions.php
+++ b/inc/functions.php
@@ -1300,24 +1300,6 @@
$body = preg_replace("/\n/", '<br/>', $body);
}
- function html_entity_decode_utf8($string) {
- static $trans_tbl;
-
- // replace numeric entities
- $string = preg_replace('~&#x([0-9a-f]+);~ei', 'code2utf(hexdec("\\1"))', $string);
- $string = preg_replace('~&#([0-9]+);~e', 'code2utf(\\1)', $string);
-
- // replace literal entities
- if (!isset($trans_tbl)) {
- $trans_tbl = array();
-
- foreach (get_html_translation_table(HTML_ENTITIES) as $val=>$key)
- $trans_tbl[$key] = utf8_encode($val);
- }
-
- return strtr($string, $trans_tbl);
- }
-
// Returns the utf string corresponding to the unicode value (from php.net, courtesy - romans@void.lv)
function code2utf($num) {
if ($num < 128)
@@ -1496,7 +1478,7 @@
$gcf = hcf($numerator, $denominator);
$numerator = $numerator / $gcf;
$denominator = $denominator / $gcf;
-
+
return "{$numerator}{$sep}{$denominator}";
}