]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
make sure passed profile_id is valid in Notice::saveNew
authormillette <millette@controlyourself.ca>
Wed, 10 Dec 2008 18:11:23 +0000 (13:11 -0500)
committermillette <millette@controlyourself.ca>
Wed, 10 Dec 2008 18:11:23 +0000 (13:11 -0500)
darcs-hash:20081210181123-099f7-b13ae11d136512655fc5ba4bb314c80256244593.gz

classes/Notice.php

index b85dccd23789345b339e36d23f6248575d9139dd..77e0948dc28d6421c421454dd5801a74ae70fcc9 100644 (file)
@@ -92,6 +92,10 @@ class Notice extends Memcached_DataObject
        }
 
        static function saveNew($profile_id, $content, $source=NULL, $is_local=1, $reply_to=NULL, $uri=NULL) {
+        if (!Profile::staticGet($profile_id)) {
+            common_log(LOG_ERR, 'Problem saving notice. Unknown user.');
+            return _('Problem saving notice. Unknown user.');
+        }
 
         if (!Notice::checkEditThrottle($profile_id)) {
             common_log(LOG_WARNING, 'Excessive posting by profile #' . $profile_id . '; throttled.');