summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorczaks <marcin@6irc.net>2013-08-18 19:26:31 -0400
committerczaks <marcin@6irc.net>2013-08-18 19:26:31 -0400
commit5389b0f358abd9526cd40c91de393a4561bd627b (patch)
tree2a204eb02a398609057b5516c49350591c169a30
parenta0d0d22a64c0b02e0cf959dcb78862f63e7a0c05 (diff)
parentc8fcba943958f736582838591f5632cb214e0f15 (diff)
Merge branch 'master' of https://github.com/savetheinternet/Tinyboard
-rw-r--r--inc/display.php20
-rw-r--r--install.php2
-rw-r--r--templates/post_reply.html2
-rw-r--r--templates/post_thread.html2
4 files changed, 7 insertions, 19 deletions
diff --git a/inc/display.php b/inc/display.php
index d16b12aa..02668e40 100644
--- a/inc/display.php
+++ b/inc/display.php
@@ -232,23 +232,11 @@ 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';
+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.
- $str = preg_replace("!(?<explicits>$explicits)|(?<pdf>$pdf)!", '', $str);
- return $str;
+ return "<bdi>$str</bdi>";
}
function secure_link_confirm($text, $title, $confirm_message, $href) {
diff --git a/install.php b/install.php
index 1914434d..8bef9e11 100644
--- a/install.php
+++ b/install.php
@@ -548,7 +548,7 @@ if ($step == 0) {
array(
'category' => 'Misc',
'name' => 'Tinyboard installed using git',
- 'result' => is_dir('.git.'),
+ 'result' => is_dir('.git'),
'required' => false,
'message' => 'Tinyboard is still beta software and it\'s not going to come out of beta any time soon. As there are often many months between releases yet changes and bug fixes are very frequent, it\'s recommended to use the git repository to maintain your Tinyboard installation. Using git makes upgrading much easier.'
)
diff --git a/templates/post_reply.html b/templates/post_reply.html
index bc3d36cd..28cbd7f8 100644
--- a/templates/post_reply.html
+++ b/templates/post_reply.html
@@ -71,7 +71,7 @@
{% if config.show_filename and post.filename %}
,
{% if post.filename|length > config.max_filename_display %}
- <span class="postfilename" title="{{ post.filename|e|bidi_cleanup }}">{{ post.filename|truncate(config.max_filename_display)|bidi_cleanup }}</span>
+ <span class="postfilename" title="{{ post.filename|e }}">{{ post.filename|truncate(config.max_filename_display)|bidi_cleanup }}</span>
{% else %}
<span class="postfilename">{{ post.filename|e|bidi_cleanup }}</span>
{% endif %}
diff --git a/templates/post_thread.html b/templates/post_thread.html
index ddbb0b2e..97fad11c 100644
--- a/templates/post_thread.html
+++ b/templates/post_thread.html
@@ -23,7 +23,7 @@
{% if config.show_filename and post.filename %}
,
{% if post.filename|length > config.max_filename_display %}
- <span class="postfilename" title="{{ post.filename|e|bidi_cleanup }}">{{ post.filename|truncate(config.max_filename_display)|bidi_cleanup }}</span>
+ <span class="postfilename" title="{{ post.filename|e }}">{{ post.filename|truncate(config.max_filename_display)|bidi_cleanup }}</span>
{% else %}
<span class="postfilename">{{ post.filename|e|bidi_cleanup }}</span>
{% endif %}