use Friendica\BaseObject;
use Friendica\Content\Text;
use Friendica\Core\PConfig;
+use Friendica\Core\Protocol;
require_once 'boot.php';
require_once 'include/items.php';
} else {// Try to guess the correct target network
switch ($htmlmode) {
case 8:
- $abstract = Text\BBCode::getAbstract($item['body'], NETWORK_TWITTER);
+ $abstract = Text\BBCode::getAbstract($item['body'], Protocol::TWITTER);
break;
+
case 7:
- $abstract = Text\BBCode::getAbstract($item['body'], NETWORK_STATUSNET);
- break;
- case 6:
- $abstract = Text\BBCode::getAbstract($item['body'], NETWORK_APPNET);
+ $abstract = Text\BBCode::getAbstract($item['body'], Protocol::STATUSNET);
break;
+
default: // We don't know the exact target.
// We fetch an abstract since there is a posting limit.
if ($limit > 0) {
}
}
- $html = Text\BBCode::convert($post['text'] . $post['after'], false, $htmlmode);
+ $html = Text\BBCode::convert($post['text'] . defaults($post, 'after', ''), false, $htmlmode);
$msg = Text\HTML::toPlaintext($html, 0, true);
$msg = trim(html_entity_decode($msg, ENT_QUOTES, 'UTF-8'));
if ($post['type'] == 'link') {
$link = $post['url'];
} elseif ($post['type'] == 'text') {
- $link = $post['url'];
+ $link = defaults($post, 'url', '');
} elseif ($post['type'] == 'video') {
$link = $post['url'];
} elseif ($post['type'] == 'photo') {