summaryrefslogtreecommitdiff
path: root/inc/mod
diff options
context:
space:
mode:
authorMichael Foster <savetheinternet@tinyboard.org>2013-08-21 21:34:18 +1000
committerMichael Foster <savetheinternet@tinyboard.org>2013-08-21 21:34:18 +1000
commit54a8c721212e279f47d786168b1c38bd9c28e8ed (patch)
tree81f941dc31a3e9a2ab42421182952d0a9c2f4963 /inc/mod
parent72beacc1da12d3851330e229ff43c8ec6f2ce352 (diff)
Huge bug with deleting boards: $tmp_board unused; sometimes it would delete the wrong board's directory
Diffstat (limited to 'inc/mod')
-rw-r--r--inc/mod/pages.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/inc/mod/pages.php b/inc/mod/pages.php
index 7df8f316..706513a3 100644
--- a/inc/mod/pages.php
+++ b/inc/mod/pages.php
@@ -379,7 +379,7 @@ function mod_edit_board($boardName) {
$query->bindValue(':uri', $board['uri'], PDO::PARAM_INT);
$query->execute() or error(db_error($query));
- $query = prepare("SELECT `board`, `post` FROM ``cites`` WHERE `target_board` = :board");
+ $query = prepare("SELECT `board`, `post` FROM ``cites`` WHERE `target_board` = :board ORDER BY `board`");
$query->bindValue(':board', $board['uri']);
$query->execute() or error(db_error($query));
while ($cite = $query->fetch(PDO::FETCH_ASSOC)) {
@@ -391,6 +391,9 @@ function mod_edit_board($boardName) {
}
}
+ if (isset($tmp_board))
+ $board = $tmp_board;
+
$query = prepare('DELETE FROM ``cites`` WHERE `board` = :board OR `target_board` = :board');
$query->bindValue(':board', $board['uri']);
$query->execute() or error(db_error($query));