summaryrefslogtreecommitdiff
path: root/actions/facebooksettings.php
diff options
context:
space:
mode:
authorZach Copley <zach@status.net>2009-10-16 23:42:02 +0000
committerZach Copley <zach@status.net>2009-10-16 23:42:02 +0000
commit0bbc05c1d57b0471c1d1f33ad0d1e00cd7d57e5c (patch)
tree3536179ac3bdafd7c00897ec5915863ad544e455 /actions/facebooksettings.php
parent0fd8e758ade32204b452cc9fd40e071f0ec8c0f6 (diff)
parente48efd322279fd67168957635fa30cf4cb46f81b (diff)
Merge branch '0.9.x' into TwitterBridgePlugin
Diffstat (limited to 'actions/facebooksettings.php')
-rw-r--r--actions/facebooksettings.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/actions/facebooksettings.php b/actions/facebooksettings.php
index 84bdde910..b2b1d6807 100644
--- a/actions/facebooksettings.php
+++ b/actions/facebooksettings.php
@@ -58,8 +58,15 @@ class FacebooksettingsAction extends FacebookAction
$this->flink->set_flags($noticesync, $replysync, false, false);
$result = $this->flink->update($original);
+ if ($prefix == '' || $prefix == '0') {
+ // Facebook bug: saving empty strings to prefs now fails
+ // http://bugs.developers.facebook.com/show_bug.cgi?id=7110
+ $trimmed = $prefix . ' ';
+ } else {
+ $trimmed = substr($prefix, 0, 128);
+ }
$this->facebook->api_client->data_setUserPreference(FACEBOOK_NOTICE_PREFIX,
- substr($prefix, 0, 128));
+ $trimmed);
if ($result === false) {
$this->showForm(_('There was a problem saving your sync preferences!'));
@@ -101,7 +108,7 @@ class FacebooksettingsAction extends FacebookAction
$this->elementStart('li');
- $prefix = $this->facebook->api_client->data_getUserPreference(FACEBOOK_NOTICE_PREFIX);
+ $prefix = trim($this->facebook->api_client->data_getUserPreference(FACEBOOK_NOTICE_PREFIX));
$this->input('prefix', _('Prefix'),
($prefix) ? $prefix : null,