summaryrefslogtreecommitdiff
path: root/inc/display.php
diff options
context:
space:
mode:
authorMichael <savetheinternet@tinyboard.org>2013-01-18 23:02:24 -0800
committerMichael <savetheinternet@tinyboard.org>2013-01-18 23:02:24 -0800
commit6aac2472e66f87d2d38a3b0bd361e355836be49d (patch)
tree79b0b93d1b11f37cbff9f024e34c28ada39239cc /inc/display.php
parentced540a66ee223ba2e3e2b8dbaaf50e5b48a13d8 (diff)
parent3a9ed90c585b0e97cbc3453f5a004c34e630cf00 (diff)
Merge pull request #92 from Macil/fixes
Miscellaneous bugfixes
Diffstat (limited to 'inc/display.php')
-rw-r--r--inc/display.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/inc/display.php b/inc/display.php
index 85c21e7c..2b5d3116 100644
--- a/inc/display.php
+++ b/inc/display.php
@@ -216,7 +216,7 @@ function truncate($body, $url, $max_lines = false, $max_chars = false) {
function secure_link_confirm($text, $title, $confirm_message, $href) {
global $config;
- return '<a onclick="if (confirm(\'' . htmlentities(addslashes($confirm_message)) . '\')) document.location=\'?/' . htmlentities(addslashes($href . '/' . make_secure_link_token($href))) . '\';return false;" title="' . htmlentities($title) . '" href="?/' . $href . '">' . $text . '</a>';
+ return '<a onclick="if (event.which==2) return true;if (confirm(\'' . htmlentities(addslashes($confirm_message)) . '\')) document.location=\'?/' . htmlentities(addslashes($href . '/' . make_secure_link_token($href))) . '\';return false;" title="' . htmlentities($title) . '" href="?/' . $href . '">' . $text . '</a>';
}
function secure_link($href) {
return $href . '/' . make_secure_link_token($href);
@@ -350,8 +350,8 @@ class Thread {
// Fix internal links
// Very complicated regex
$this->body = preg_replace(
- '/<a(([a-zA-Z]+="[^"]+")|[a-zA-Z]+=[a-zA-Z]+|\s)*href="' . preg_quote($config['root'], '/') . '(' . sprintf(preg_quote($config['board_path'], '/'), '\w+') . ')/',
- '<a href="?/$3',
+ '/<a((([a-zA-Z]+="[^"]+")|[a-zA-Z]+=[a-zA-Z]+|\s)*)href="' . preg_quote($config['root'], '/') . '(' . sprintf(preg_quote($config['board_path'], '/'), '\w+') . ')/',
+ '<a $1href="?/$4',
$this->body
);
}