cvs: php-master-web /manage user-notes.php
| From: | Andrew Lindeman | Date: | Mon, 19 May 2003 02:36:10 +0000 |
| Subject: | cvs: php-master-web /manage user-notes.php | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-17796@lists.php.net to get a copy of this message | ||
alindeman Sun May 18 22:36:10 2003 EDT
Modified files:
/php-master-web/manage user-notes.php
Log:
die if note doesn't exist
Index: php-master-web/manage/user-notes.php
diff -u php-master-web/manage/user-notes.php:1.19 php-master-web/manage/user-notes.php:1.20
--- php-master-web/manage/user-notes.php:1.19 Sat May 17 17:26:23 2003
+++ php-master-web/manage/user-notes.php Sun May 18 22:36:10 2003
@@ -81,6 +81,10 @@
case 'delete':
if ($id) {
if ($result = mysql_query("SELECT * FROM note WHERE id=$id")) {
+ if (!mysql_num_rows ($result)) {
+ die ("Note #$id doesn't exist. It has probably been deleted/rejected
already");
+ }
+
$row = mysql_fetch_array($result);
if ($row['id'] && mysql_query("DELETE FROM note WHERE id=$id")) {
$mailto = "php-notes@lists.php.net";
@@ -123,6 +127,9 @@
head();
if ($result = @mysql_query("SELECT *,UNIX_TIMESTAMP(ts) AS ts FROM note WHERE
id=$id")) {
+ if (!mysql_num_rows ($result)) {
+ die ("Note #$id doesn't exist. It has probably been deleted/rejected
already");
+ }
$row = mysql_fetch_array($result);
}