summaryrefslogtreecommitdiff
path: root/plugins/TwitterBridge/twitter.php
diff options
context:
space:
mode:
authorZach Copley <zach@status.net>2010-03-05 02:27:01 +0000
committerZach Copley <zach@status.net>2010-03-05 02:27:01 +0000
commit029b8c90142e08b0ed44f0528ddea7d4dcc32980 (patch)
tree193346cddb9b2762163d28e2418322747a2a96d6 /plugins/TwitterBridge/twitter.php
parent980d1a66ec0bb5b42ddb39e253fba9bad1b41aca (diff)
Fix for errant deletion of all Twitter foreign_links
Diffstat (limited to 'plugins/TwitterBridge/twitter.php')
-rw-r--r--plugins/TwitterBridge/twitter.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/plugins/TwitterBridge/twitter.php b/plugins/TwitterBridge/twitter.php
index ceb83b037..42db3c673 100644
--- a/plugins/TwitterBridge/twitter.php
+++ b/plugins/TwitterBridge/twitter.php
@@ -264,7 +264,16 @@ function remove_twitter_link($flink)
common_log(LOG_INFO, 'Removing Twitter bridge Foreign link for ' .
"user $user->nickname (user id: $user->id).");
- $result = $flink->delete();
+ $result = false;
+
+ // Be extra careful to make sure we have a good flink
+ // before deleting
+ if (!empty($flink->user_id)
+ && !empty($flink->foreign_id)
+ && !empty($flink->service))
+ {
+ $result = $flink->delete();
+ }
if (empty($result)) {
common_log(LOG_ERR, 'Could not remove Twitter bridge ' .