summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorMichael Foster <savetheinternet@tinyboard.org>2013-08-19 05:19:54 +1000
committerMichael Foster <savetheinternet@tinyboard.org>2013-08-19 05:19:54 +1000
commitd2fdeead6408743b7d69bd098ea3c23358bfd395 (patch)
tree4899e697d2dfea859293c1badfc87b81d75084f8 /inc
parentdcb42a52cb89742f4c4e7805a6c615e598645a97 (diff)
bidi_cleanup: Just replace with HTML5's <bdi> (for now, at least). The old code was hardly working, and had issued with older PHP versions.
Diffstat (limited to 'inc')
-rw-r--r--inc/display.php22
1 files changed, 6 insertions, 16 deletions
diff --git a/inc/display.php b/inc/display.php
index 23794052..09c75a42 100644
--- a/inc/display.php
+++ b/inc/display.php
@@ -218,23 +218,13 @@ function truncate($body, $url, $max_lines = false, $max_chars = false) {
return $body;
}
-function bidi_cleanup($str){
- # Removes all embedded RTL and LTR unicode formatting blocks in a string so that
- # it can be used inside another without controlling its direction.
- # More info: http://www.iamcal.com/understanding-bidirectional-text/
- #
- # LRE - U+202A - 0xE2 0x80 0xAA
- # RLE - U+202B - 0xE2 0x80 0xAB
- # LRO - U+202D - 0xE2 0x80 0xAD
- # RLO - U+202E - 0xE2 0x80 0xAE
- #
- # PDF - U+202C - 0xE2 0x80 0xAC
- #
- $explicits = '\xE2\x80\xAA|\xE2\x80\xAB|\xE2\x80\xAD|\xE2\x80\xAE';
- $pdf = '\xE2\x80\xAC';
+// int(1607)int(1584)int(1575)int(32)int(1575)int(1582)int(1578)int(1576)int(1575)int(1585)int(46)
- $str = preg_replace("!(?<explicits>$explicits)|(?<pdf>$pdf)!", '', $str);
- return $str;
+function bidi_cleanup($str) {
+ // Removes all embedded RTL and LTR unicode formatting blocks in a string so that
+ // it can be used inside another without controlling its direction.
+
+ return "<bdi>$str</bdi>";
}
function secure_link_confirm($text, $title, $confirm_message, $href) {