summaryrefslogtreecommitdiff
path: root/modules/comment/helpers/comment_event.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2010-01-23 16:29:10 -0800
committerBharat Mediratta <bharat@menalto.com>2010-01-23 16:29:10 -0800
commitfecac4a8596a69088270e48a90868e845fc8f4ca (patch)
treea4683906d481d1091e218c9b6662a1997cb11086 /modules/comment/helpers/comment_event.php
parent8849594aa17768f564e45370a62f01e440570dcf (diff)
parent3b16d0662b8a4b06f4be72165c858a1231e9bd67 (diff)
Merge branch 'master' of git@github.com:gallery/gallery3 into bharat_dev
Conflicts: modules/gallery/tests/xss_data.txt
Diffstat (limited to 'modules/comment/helpers/comment_event.php')
-rw-r--r--modules/comment/helpers/comment_event.php18
1 files changed, 10 insertions, 8 deletions
diff --git a/modules/comment/helpers/comment_event.php b/modules/comment/helpers/comment_event.php
index 43a30d70..bd336cda 100644
--- a/modules/comment/helpers/comment_event.php
+++ b/modules/comment/helpers/comment_event.php
@@ -27,14 +27,16 @@ class comment_event_Core {
static function user_deleted($user) {
$guest = identity::guest();
- db::build()
- ->update("comments")
- ->set("author_id", $guest->id)
- ->set("guest_email", null)
- ->set("guest_name", "guest")
- ->set("guest_url", null)
- ->where("author_id", "=", $user->id)
- ->execute();
+ if (!empty($guest)) { // could be empty if there is not identity provider
+ db::build()
+ ->update("comments")
+ ->set("author_id", $guest->id)
+ ->set("guest_email", null)
+ ->set("guest_name", "guest")
+ ->set("guest_url", null)
+ ->where("author_id", "=", $user->id)
+ ->execute();
+ }
}
static function identity_provider_changed($old_provider, $new_provider) {