diff options
author | Evan Prodromou <evan@status.net> | 2010-03-02 02:56:57 -0500 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2010-03-02 02:56:57 -0500 |
commit | f504a9237e64c49286b355de87ea59abe14b1090 (patch) | |
tree | a0ce30d9099954ac912e450f1f8f01c6b9fb25d3 /lib | |
parent | 2c677e0f2d881f0c9f5713fcbc37ad24ef0dab26 (diff) | |
parent | 40e1b249cf1535a6074c8b32e5820c8ad6427836 (diff) |
Merge branch 'testing' of git@gitorious.org:statusnet/mainline into testing
Diffstat (limited to 'lib')
-rw-r--r-- | lib/action.php | 2 | ||||
-rw-r--r-- | lib/default.php | 4 | ||||
-rw-r--r-- | lib/util.php | 24 |
3 files changed, 24 insertions, 6 deletions
diff --git a/lib/action.php b/lib/action.php index a7e0eb33b..0918c6858 100644 --- a/lib/action.php +++ b/lib/action.php @@ -425,8 +425,6 @@ class Action extends HTMLOutputter // lawsuit $connect = 'imsettings'; } else if (common_config('sms', 'enabled')) { $connect = 'smssettings'; - } else if (common_config('twitter', 'enabled')) { - $connect = 'twittersettings'; } $this->elementStart('dl', array('id' => 'site_nav_global_primary')); diff --git a/lib/default.php b/lib/default.php index d849055c2..7b50242ae 100644 --- a/lib/default.php +++ b/lib/default.php @@ -177,8 +177,8 @@ $default = array('source' => 'StatusNet', # source attribute for Twitter 'taguri' => null), # base for tag URIs 'twitter' => - array('enabled' => true, - 'consumer_key' => null, + array('signin' => true, + 'consumer_key' => null, 'consumer_secret' => null), 'cache' => array('base' => null), diff --git a/lib/util.php b/lib/util.php index d12a7920d..7a170a5f5 100644 --- a/lib/util.php +++ b/lib/util.php @@ -809,8 +809,28 @@ function common_shorten_links($text) function common_xml_safe_str($str) { - // Neutralize control codes and surrogates - return preg_replace('/[\p{Cc}\p{Cs}]/u', '*', $str); + // Replace common eol and extra whitespace input chars + $unWelcome = array( + "\t", // tab + "\n", // newline + "\r", // cr + "\0", // null byte eos + "\x0B" // vertical tab + ); + + $replacement = array( + ' ', // single space + ' ', + '', // nothing + '', + ' ' + ); + + $str = str_replace($unWelcome, $replacement, $str); + + // Neutralize any additional control codes and UTF-16 surrogates + // (Twitter uses '*') + return preg_replace('/[\p{Cc}\p{Cs}]/u', '*', $str); } function common_tag_link($tag) |