summaryrefslogtreecommitdiff
path: root/inc/functions.php
diff options
context:
space:
mode:
authorczaks <marcin@6irc.net>2013-08-17 16:21:40 -0400
committerczaks <marcin@6irc.net>2013-08-17 16:21:40 -0400
commitbf119b7abd1f37a2871be7cf652adbcd37486a1e (patch)
treea5f0737f8e09e354e6908769a61ab9d73710b631 /inc/functions.php
parentca565d07c2d0157a6b7554fd26cd2157359a2791 (diff)
parentcff62b250c90f9fd336ceac5e2c557bf4c448859 (diff)
Merge branch 'master' of https://github.com/savetheinternet/Tinyboard
Conflicts: js/post-hover.js
Diffstat (limited to 'inc/functions.php')
-rw-r--r--inc/functions.php12
1 files changed, 8 insertions, 4 deletions
diff --git a/inc/functions.php b/inc/functions.php
index 3553f908..c176a481 100644
--- a/inc/functions.php
+++ b/inc/functions.php
@@ -953,6 +953,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']));
@@ -1509,10 +1511,12 @@ function markup(&$body, $track_cites = false) {
$modifiers = extract_modifiers($body);
- $body = preg_replace('@<tinyboard ([\w\s]+)>(.+?)</tinyboard>@us', '', $body);
+ $body = preg_replace('@<tinyboard (?!escape )([\w\s]+)>(.+?)</tinyboard>@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);
@@ -1658,7 +1662,7 @@ function markup(&$body, $track_cites = false) {
}
function escape_markup_modifiers($string) {
- return preg_replace('@<tinyboard ([\w\s]+)>@m', '<tinyboard escape $1>', $string);
+ return preg_replace('@<(tinyboard) ([\w\s]+)>@mi', '<$1 escape $2>', $string);
}
function utf8tohtml($utf8) {