From 26dec371bbb7d0b141610fdd9f8b061ad1d290fd Mon Sep 17 00:00:00 2001 From: Tobias Diekershoff Date: Fri, 6 Apr 2012 19:37:23 +0200 Subject: [PATCH] SN/T: since inclusion of the title 2xMax_Char is too short, increasing that --- statusnet/statusnet.php | 4 ++-- twitter/twitter.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/statusnet/statusnet.php b/statusnet/statusnet.php index 897c5415..13f3f7e2 100755 --- a/statusnet/statusnet.php +++ b/statusnet/statusnet.php @@ -435,9 +435,9 @@ function statusnet_post_hook(&$a,&$b) { // shorten all the links in a 200000 character long essay. if (! $b['title']=='') { $tmp = $b['title'] . ' : '. $b['body']; - $tmp = substr($tmp, 0, 2*$max_char); + $tmp = substr($tmp, 0, 4*$max_char); } else { - $tmp = substr($b['body'], 0, 2*$max_char); + $tmp = substr($b['body'], 0, 3*$max_char); } // if [url=bla][img]blub.png[/img][/url] get blub.png $tmp = preg_replace( '/\[url\=(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,]+)\]\[img\](\\w+.*?)\\[\\/img\]\\[\\/url\]/i', '$2', $tmp); diff --git a/twitter/twitter.php b/twitter/twitter.php index 006c1615..8a072fa2 100755 --- a/twitter/twitter.php +++ b/twitter/twitter.php @@ -301,9 +301,9 @@ function twitter_post_hook(&$a,&$b) { // shorten all the links in a 200000 character long essay. if (! $b['title']=='') { $tmp = $b['title'] . ' : '. $b['body']; - $tmp = substr($tmp, 0, 2*$max_char); + $tmp = substr($tmp, 0, 4*$max_char); } else { - $tmp = substr($b['body'], 0, 2*$max_char); + $tmp = substr($b['body'], 0, 3*$max_char); } // if [url=bla][img]blub.png[/img][/url] get blub.png $tmp = preg_replace( '/\[url\=(https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,]+)\]\[img\](\\w+.*?)\\[\\/img\]\\[\\/url\]/i', '$2', $tmp); -- 2.39.5