mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-07-07 00:48:55 +00:00
Fixed a bug where a title was set in a way that affected other addons. Additionally some changes to bb2markdown.
This commit is contained in:
parent
c43a3773c8
commit
57441b4def
5 changed files with 25 additions and 22 deletions
|
@ -426,15 +426,15 @@ function statusnet_post_hook(&$a,&$b) {
|
|||
|
||||
if($ckey && $csecret && $otoken && $osecret) {
|
||||
|
||||
require_once('include/bbcode.php');
|
||||
require_once('include/bbcode.php');
|
||||
$dent = new StatusNetOAuth($api,$ckey,$csecret,$otoken,$osecret);
|
||||
$max_char = $dent->get_maxlength(); // max. length for a dent
|
||||
// we will only work with up to two times the length of the dent
|
||||
// we can later send to StatusNet. This way we can "gain" some
|
||||
// information during shortening of potential links but do not
|
||||
// we can later send to StatusNet. This way we can "gain" some
|
||||
// information during shortening of potential links but do not
|
||||
// shorten all the links in a 200000 character long essay.
|
||||
if (! $b['title']=='') {
|
||||
$tmp = $b['title'] . ' : '. $b['body'];
|
||||
$tmp = $b['title'].": \n".$b['body'];
|
||||
// $tmp = substr($tmp, 0, 4*$max_char);
|
||||
} else {
|
||||
$tmp = $b['body']; // substr($b['body'], 0, 3*$max_char);
|
||||
|
@ -476,7 +476,7 @@ function statusnet_post_hook(&$a,&$b) {
|
|||
}
|
||||
// ok, all the links we want to send out are save, now strip
|
||||
// away the remaining bbcode
|
||||
$msg = strip_tags(bbcode($tmp));
|
||||
$msg = strip_tags(bbcode($tmp, false, false));
|
||||
// quotes not working - let's try this
|
||||
$msg = html_entity_decode($msg);
|
||||
if (( strlen($msg) > $max_char) && $max_char > 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue