From 5af96d3ec72f0561d7b3cb931a88dd07fa0b11b8 Mon Sep 17 00:00:00 2001 From: vinz Date: Wed, 8 Nov 2017 22:50:00 +0100 Subject: [PATCH] fixed hard coded twitter char limit --- plugins/TwitterBridge/twitter.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/TwitterBridge/twitter.php b/plugins/TwitterBridge/twitter.php index 20793784ae..dbc46bafb5 100644 --- a/plugins/TwitterBridge/twitter.php +++ b/plugins/TwitterBridge/twitter.php @@ -401,11 +401,11 @@ function format_status($notice) $statusWithoutLinks = preg_replace('`((http|https|ftp)://[^\s<]+[^\s<\.)])`i', '', $statustxt); $statusLength = mb_strlen($statusWithoutLinks) + $numberOfLinks * 23; - // Twitter still has a 140-char hardcoded max. - if ($statusLength > 140) { + // Twitter raised it but still has a 280-char hardcoded max. + if ($statusLength > 280) { $noticeUrl = common_shorten_url($notice->getUrl()); // each link uses 23 chars on twitter + 3 for the ' … ' => 26 - $statustxt = mb_substr($statustxt, 0, 140 - 26) . ' … ' . $noticeUrl; + $statustxt = mb_substr($statustxt, 0, 280 - 26) . ' … ' . $noticeUrl; } return $statustxt; -- 2.39.5