New function to exit the program

This commit is contained in:
Michael 2022-05-18 02:13:54 +00:00
parent 4e9d7df31a
commit f6167b4cfd
27 changed files with 73 additions and 94 deletions

View file

@ -23,6 +23,7 @@ namespace Friendica\Module;
use Friendica\BaseModule;
use Friendica\Content;
use Friendica\Core\System;
use Friendica\DI;
use Friendica\Util\Strings;
@ -43,16 +44,14 @@ class Oembed extends BaseModule
if (DI::args()->getArgv()[1] == 'b2h') {
$url = ["", trim(hex2bin($_REQUEST['url']))];
echo Content\OEmbed::replaceCallback($url);
DI::page()->logRuntime();
exit();
System::exit();
}
// Unused form: /oembed/h2b?text=...
if (DI::args()->getArgv()[1] == 'h2b') {
$text = trim(hex2bin($_REQUEST['text']));
echo Content\OEmbed::HTML2BBCode($text);
DI::page()->logRuntime();
exit();
System::exit();
}
// @TODO: Replace with parameter from router
@ -70,7 +69,6 @@ class Oembed extends BaseModule
echo $j->html;
echo '</body></html>';
}
DI::page()->logRuntime();
exit();
System::exit();
}
}