X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FOpenSearch.php;h=9f89660eeda1b9df477681787ee09bfa632c596c;hb=925c30280c853c152f465d64065a6749ec5939fa;hp=309db6af950c5b2ae5f64313e5627377a21bd659;hpb=91ba4bb2aba53d74e5dc6d11dea6ad73b5e4fafe;p=friendica.git diff --git a/src/Module/OpenSearch.php b/src/Module/OpenSearch.php index 309db6af95..9f89660eed 100644 --- a/src/Module/OpenSearch.php +++ b/src/Module/OpenSearch.php @@ -1,10 +1,31 @@ . + * + */ namespace Friendica\Module; use DOMDocument; use DOMElement; use Friendica\BaseModule; +use Friendica\Core\System; +use Friendica\DI; use Friendica\Util\XML; /** @@ -16,12 +37,10 @@ class OpenSearch extends BaseModule /** * @throws \Exception */ - public static function rawContent(array $parameters = []) + protected function rawContent(array $request = []) { - header('Content-type: application/opensearchdescription+xml'); - - $hostname = self::getApp()->getHostName(); - $baseUrl = self::getApp()->getBaseURL(); + $hostname = DI::baseUrl()->getHostname(); + $baseUrl = DI::baseUrl()->get(); /** @var DOMDocument $xml */ $xml = null; @@ -31,9 +50,12 @@ class OpenSearch extends BaseModule '@attributes' => [ 'xmlns' => 'http://a9.com/-/spec/opensearch/1.1', ], - 'ShortName' => "Friendica $hostname", - 'Description' => "Search in Friendica $hostname", - 'Contact' => 'https://github.com/friendica/friendica/issues', + 'ShortName' => "Friendica $hostname", + 'Description' => "Search in Friendica $hostname", + 'Contact' => 'https://github.com/friendica/friendica/issues', + 'InputEncoding' => 'UTF-8', + 'OutputEncoding' => 'UTF-8', + 'Developer' => 'Friendica Developer Team', ], ], $xml); @@ -65,8 +87,6 @@ class OpenSearch extends BaseModule 'template' => "$baseUrl/opensearch", ]); - echo $xml->saveXML(); - - exit(); + System::httpExit($xml->saveXML(), Response::TYPE_XML, 'application/opensearchdescription+xml'); } }