diff options
author | Zach Copley <zach@status.net> | 2010-03-05 02:27:01 +0000 |
---|---|---|
committer | Zach Copley <zach@status.net> | 2010-03-05 02:27:01 +0000 |
commit | 029b8c90142e08b0ed44f0528ddea7d4dcc32980 (patch) | |
tree | 193346cddb9b2762163d28e2418322747a2a96d6 /plugins/TwitterBridge/twittersettings.php | |
parent | 980d1a66ec0bb5b42ddb39e253fba9bad1b41aca (diff) |
Fix for errant deletion of all Twitter foreign_links
Diffstat (limited to 'plugins/TwitterBridge/twittersettings.php')
-rw-r--r-- | plugins/TwitterBridge/twittersettings.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/plugins/TwitterBridge/twittersettings.php b/plugins/TwitterBridge/twittersettings.php index 0137060e9..f22a059f7 100644 --- a/plugins/TwitterBridge/twittersettings.php +++ b/plugins/TwitterBridge/twittersettings.php @@ -250,7 +250,16 @@ class TwittersettingsAction extends ConnectSettingsAction $user = common_current_user(); $flink = Foreign_link::getByUserID($user->id, TWITTER_SERVICE); - $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_db_error($flink, 'DELETE', __FILE__); |