summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Save <savetheinternet@tinyboard.org>2012-09-28 04:00:13 +1000
committerMichael Save <savetheinternet@tinyboard.org>2012-09-28 04:00:13 +1000
commitdb14f9ce15e460eb5e0ff0e4419d59afa244df9c (patch)
tree447a012ccbde1cc1ec10c19753ba5810e27bc6b8
parentac9296169f9b60741552c9566650f63f66820726 (diff)
Bugfix: [F]
-rw-r--r--inc/display.php4
-rw-r--r--inc/mod/pages.php8
2 files changed, 9 insertions, 3 deletions
diff --git a/inc/display.php b/inc/display.php
index 706905b0..60c95a1f 100644
--- a/inc/display.php
+++ b/inc/display.php
@@ -285,7 +285,7 @@ class Post {
// Delete file (keep post)
if (!empty($this->file) && hasPermission($config['mod']['deletefile'], $board['uri'], $this->mod))
- $built .= ' <a title="Remove file" href="?/' . $board['uri'] . '/deletefile/' . $this->id . '">' . $config['mod']['link_deletefile'] . '</a>';
+ $built .= ' ' . secure_link_confirm($config['mod']['link_deletefile'], 'Delete file', 'Are you sure you want to delete this file?', $board['uri'] . '/deletefile/' . $this->id);
// Edit post
if (hasPermission($config['mod']['editpost'], $board['uri'], $this->mod))
@@ -383,7 +383,7 @@ class Thread {
// Delete file (keep post)
if (!empty($this->file) && $this->file != 'deleted' && hasPermission($config['mod']['deletefile'], $board['uri'], $this->mod))
- $built .= ' <a title="Remove file" href="?/' . $board['uri'] . '/deletefile/' . $this->id . '">' . $config['mod']['link_deletefile'] . '</a>';
+ $built .= ' ' . secure_link_confirm($config['mod']['link_deletefile'], 'Delete file', 'Are you sure you want to delete this file?', $board['uri'] . '/deletefile/' . $this->id);
// Sticky
if (hasPermission($config['mod']['sticky'], $board['uri'], $this->mod))
diff --git a/inc/mod/pages.php b/inc/mod/pages.php
index ca6a2540..caec6443 100644
--- a/inc/mod/pages.php
+++ b/inc/mod/pages.php
@@ -1013,8 +1013,14 @@ function mod_deletefile($board, $post) {
deleteFile($post);
// Record the action
modLog("Deleted file from post #{$post}");
+
+ $query = prepare(sprintf('SELECT `thread` FROM `posts_%s` WHERE `id` = :id', $board));
+ $query->bindValue(':id', $post);
+ $query->execute() or error(db_error($query));
+ $thread = $query->fetchColumn();
+
// Rebuild thread
- buildThread($post);
+ buildThread($thread ? $thread : $post);
// Rebuild board
buildIndex();