From e7f25aa480cf30ed901ce72d230cc5e08269179e Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Sat, 17 Aug 2013 16:06:45 +1000 Subject: add delete event --- inc/functions.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'inc') diff --git a/inc/functions.php b/inc/functions.php index 80d67b6b..09933ade 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -949,6 +949,8 @@ function deletePost($id, $error_if_doesnt_exist=true, $rebuild_after=true) { // Delete posts and maybe replies while ($post = $query->fetch(PDO::FETCH_ASSOC)) { + event('delete', $post); + if (!$post['thread']) { // Delete thread HTML page file_unlink($board['dir'] . $config['dir']['res'] . sprintf($config['file_page'], $post['id'])); -- cgit v1.3 From b2d5ec253b53345f46f6e1a246a725167d4ab814 Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Sat, 17 Aug 2013 17:41:22 +1000 Subject: escape_markup_modifiers: make it case insensitive --- inc/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc') diff --git a/inc/functions.php b/inc/functions.php index 09933ade..50937a29 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -1631,7 +1631,7 @@ function markup(&$body, $track_cites = false) { } function escape_markup_modifiers($string) { - return preg_replace('@@m', '', $string); + return preg_replace('@@mi', '', $string); } function utf8tohtml($utf8) { -- cgit v1.3 From 998002fd3442ad036391293fbb4382552081bf0f Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Sat, 17 Aug 2013 17:53:39 +1000 Subject: better modifier escaping again --- inc/functions.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'inc') diff --git a/inc/functions.php b/inc/functions.php index 50937a29..d1ae2267 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -1482,7 +1482,8 @@ function markup(&$body, $track_cites = false) { $modifiers = extract_modifiers($body); - $body = preg_replace('@(.+?)@us', '', $body); + $body = preg_replace('@(.+?)@us', '', $body); + $body = preg_replace('@@i', '', $body); if (isset($modifiers['raw html']) && $modifiers['raw html'] == '1') return $body; -- cgit v1.3 From 28f366b686d8e8d62bd20160fb085330314601bd Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Sat, 17 Aug 2013 17:56:38 +1000 Subject: keep casing of escape modifiers --- inc/functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'inc') diff --git a/inc/functions.php b/inc/functions.php index d1ae2267..3b81cf4c 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -1483,7 +1483,7 @@ function markup(&$body, $track_cites = false) { $modifiers = extract_modifiers($body); $body = preg_replace('@(.+?)@us', '', $body); - $body = preg_replace('@@i', '', $body); + $body = preg_replace('@<(tinyboard) escape ([\w\s]+)>@i', '<$1 $2>', $body); if (isset($modifiers['raw html']) && $modifiers['raw html'] == '1') return $body; @@ -1632,7 +1632,7 @@ function markup(&$body, $track_cites = false) { } function escape_markup_modifiers($string) { - return preg_replace('@@mi', '', $string); + return preg_replace('@<(tinyboard) ([\w\s]+)>@mi', '<$1 escape $2>', $string); } function utf8tohtml($utf8) { -- cgit v1.3 From cff62b250c90f9fd336ceac5e2c557bf4c448859 Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Sun, 18 Aug 2013 04:49:56 +1000 Subject: Bugfix: raw html posting --- inc/functions.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'inc') diff --git a/inc/functions.php b/inc/functions.php index 3b81cf4c..259245f3 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -1485,8 +1485,9 @@ function markup(&$body, $track_cites = false) { $body = preg_replace('@(.+?)@us', '', $body); $body = preg_replace('@<(tinyboard) escape ([\w\s]+)>@i', '<$1 $2>', $body); - if (isset($modifiers['raw html']) && $modifiers['raw html'] == '1') - return $body; + if (isset($modifiers['raw html']) && $modifiers['raw html'] == '1') { + return array(); + } $body = str_replace("\r", '', $body); $body = utf8tohtml($body); -- cgit v1.3