X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FOembed.php;h=7a28115d449013a790482c7853257591209bc002;hb=e1dfcc35d7a93c54bf7b751b9c2a3654470f7b05;hp=0107782122b5c0c877025d09805eca4a22794315;hpb=c9cce8492e5b2607b2a092474d1de4d188b7a2c9;p=friendica.git diff --git a/src/Module/Oembed.php b/src/Module/Oembed.php index 0107782122..7a28115d44 100644 --- a/src/Module/Oembed.php +++ b/src/Module/Oembed.php @@ -1,9 +1,30 @@ . + * + */ namespace Friendica\Module; use Friendica\BaseModule; use Friendica\Content; +use Friendica\Core\System; +use Friendica\DI; use Friendica\Util\Strings; /** @@ -17,28 +38,26 @@ use Friendica\Util\Strings; */ class Oembed extends BaseModule { - public static function content() + protected function content(array $request = []): string { - $a = self::getApp(); - // Unused form: /oembed/b2h?url=... - if ($a->argv[1] == 'b2h') { + if (DI::args()->getArgv()[1] == 'b2h') { $url = ["", trim(hex2bin($_REQUEST['url']))]; echo Content\OEmbed::replaceCallback($url); - exit(); + System::exit(); } // Unused form: /oembed/h2b?text=... - if ($a->argv[1] == 'h2b') { + if (DI::args()->getArgv()[1] == 'h2b') { $text = trim(hex2bin($_REQUEST['text'])); echo Content\OEmbed::HTML2BBCode($text); - exit(); + System::exit(); } // @TODO: Replace with parameter from router - if ($a->argc == 2) { + if (DI::args()->getArgc() == 2) { echo ''; - $url = Strings::base64UrlDecode($a->argv[1]); + $url = Strings::base64UrlDecode(DI::args()->getArgv()[1]); $j = Content\OEmbed::fetchURL($url); // workaround for media.ccc.de (and any other endpoint that return size 0) @@ -50,6 +69,6 @@ class Oembed extends BaseModule echo $j->html; echo ''; } - exit(); + System::exit(); } }