From f45d3fdb32a932a7202c1e68331b442ae23d1a63 Mon Sep 17 00:00:00 2001 From: Savetheinternet Date: Thu, 16 Dec 2010 17:05:29 +1100 Subject: [PATCH] Check if post exists when deleting --- inc/mod.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/inc/mod.php b/inc/mod.php index 46d966fe..a6cf3793 100644 --- a/inc/mod.php +++ b/inc/mod.php @@ -152,6 +152,10 @@ $id ), $sql) or error(mysql_error($sql)); + if(mysql_num_rows($post_res) < 1) { + error(ERROR_INVALIDPOST); + } + // Delete posts and maybe replies while($post = mysql_fetch_array($post_res)) {