summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormillette <millette@controlyourself.ca>2008-12-10 13:11:23 -0500
committermillette <millette@controlyourself.ca>2008-12-10 13:11:23 -0500
commit8b15411865b216f20b4f029a94310a12ab59ddc1 (patch)
tree8dff793e8a0d7c165ddad7c46e59de5ec9f5bd16
parent9553072e49518c8902a0ff7bc66bb18130dcf521 (diff)
make sure passed profile_id is valid in Notice::saveNew
darcs-hash:20081210181123-099f7-b13ae11d136512655fc5ba4bb314c80256244593.gz
-rw-r--r--classes/Notice.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/classes/Notice.php b/classes/Notice.php
index b85dccd23..77e0948dc 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -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.');