SN/T: since inclusion of the title 2xMax_Char is too short, increasing that

pull/40/merge
Tobias Diekershoff 2012-04-06 19:37:23 +02:00
parent 75dd08fa73
commit 26dec371bb
2 changed files with 4 additions and 4 deletions

View File

@ -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);

View File

@ -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);