summaryrefslogtreecommitdiff
path: root/inc/display.php
diff options
context:
space:
mode:
authorczaks <marcin@6irc.net>2013-07-16 13:02:13 -0400
committerczaks <marcin@6irc.net>2013-07-16 13:02:13 -0400
commit7bdb96a16b51eb8086fead11783bb095ea42cd90 (patch)
treeb236bbd6082d927e25ecf4b07ea45bb5e1206a60 /inc/display.php
parent8a598982a4f6ae48ad6e2a4d634314215871c4c1 (diff)
parentaadb57f2a2db9210468f25d7dcd45d561ef6ad54 (diff)
Merge branch 'master' of https://github.com/savetheinternet/Tinyboard
Conflicts: install.php templates/index.html templates/thread.html
Diffstat (limited to 'inc/display.php')
-rw-r--r--inc/display.php18
1 files changed, 2 insertions, 16 deletions
diff --git a/inc/display.php b/inc/display.php
index 30560d3a..ba55903d 100644
--- a/inc/display.php
+++ b/inc/display.php
@@ -214,7 +214,7 @@ function truncate($body, $url, $max_lines = false, $max_chars = false) {
}
function bidi_cleanup($str){
- # Closes all embedded RTL and LTR unicode formatting blocks in a string so that
+ # 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/
#
@@ -228,21 +228,7 @@ function bidi_cleanup($str){
$explicits = '\xE2\x80\xAA|\xE2\x80\xAB|\xE2\x80\xAD|\xE2\x80\xAE';
$pdf = '\xE2\x80\xAC';
- $stack = 0;
- $str = preg_replace_callback("!(?<explicits>$explicits)|(?<pdf>$pdf)!", function($match) use (&$stack) {
- if (isset($match['explicits']) && $match['explicits']) {
- $stack++;
- } else {
- if ($stack)
- $stack--;
- else
- return '';
- }
- return $match[0];
- }, $str);
- for ($i=0; $i<$stack; $i++){
- $str .= "\xE2\x80\xAC";
- }
+ $str = preg_replace("!(?<explicits>$explicits)|(?<pdf>$pdf)!", '', $str);
return $str;
}