]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Catch bad replyto IDs before saving a new notice to avoid a constraint violation...
authorCiaranG <ciaran@ciarang.com>
Tue, 3 Mar 2009 21:33:52 +0000 (21:33 +0000)
committerCiaranG <ciaran@ciarang.com>
Tue, 3 Mar 2009 21:33:52 +0000 (21:33 +0000)
actions/newnotice.php

index 9f44d251652dd08a17e261194f24890f32fa4210..cbd04c58b226c0a609c44996f7048bcf28f7abcd 100644 (file)
@@ -152,6 +152,11 @@ class NewnoticeAction extends Action
         }
 
         $replyto = $this->trimmed('inreplyto');
+        #If an ID of 0 is wrongly passed here, it will cause a database error,
+        #so override it...
+        if ($replyto == 0) {
+            $replyto = 'false';
+        }
 
         $notice = Notice::saveNew($user->id, $content, 'web', 1,
                                   ($replyto == 'false') ? null : $replyto);