kopia lustrzana https://github.com/friendica/friendica
Only use http links
rodzic
d646d4eb1d
commit
b92e23273d
|
@ -27,6 +27,7 @@ use Friendica\Database\DBA;
|
||||||
use Friendica\DI;
|
use Friendica\DI;
|
||||||
use Friendica\Model\Item;
|
use Friendica\Model\Item;
|
||||||
use Friendica\Model\Post;
|
use Friendica\Model\Post;
|
||||||
|
use Friendica\Util\Network;
|
||||||
|
|
||||||
function share_init(App $a) {
|
function share_init(App $a) {
|
||||||
$post_id = ((DI::args()->getArgc() > 1) ? intval(DI::args()->getArgv()[1]) : 0);
|
$post_id = ((DI::args()->getArgc() > 1) ? intval(DI::args()->getArgv()[1]) : 0);
|
||||||
|
@ -46,7 +47,7 @@ function share_init(App $a) {
|
||||||
if (strpos($item['body'], "[/share]") !== false) {
|
if (strpos($item['body'], "[/share]") !== false) {
|
||||||
$pos = strpos($item['body'], "[share");
|
$pos = strpos($item['body'], "[share");
|
||||||
$o = substr($item['body'], $pos);
|
$o = substr($item['body'], $pos);
|
||||||
} elseif (in_array($item['network'], Protocol::FEDERATED)) {
|
} elseif (Network::isValidHttpUrl($item['uri']) && in_array($item['network'], Protocol::FEDERATED)) {
|
||||||
$o = "[share]" . $item['uri'] . "[/share]";
|
$o = "[share]" . $item['uri'] . "[/share]";
|
||||||
} else {
|
} else {
|
||||||
$o = BBCode::getShareOpeningTag($item['author-name'], $item['author-link'], $item['author-avatar'], $item['plink'], $item['created'], $item['guid']);
|
$o = BBCode::getShareOpeningTag($item['author-name'], $item['author-link'], $item['author-avatar'], $item['plink'], $item['created'], $item['guid']);
|
||||||
|
|
Ładowanie…
Reference in New Issue