X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FOpenSearch.php;h=9f89660eeda1b9df477681787ee09bfa632c596c;hb=de1c0f4c139fcbb5341a3176e12bf5dad53c802b;hp=044c2b12788af279883c0c8788e05d52b421e629;hpb=3c76826793feeb933dab7a07dab7cc7eb2efc451;p=friendica.git diff --git a/src/Module/OpenSearch.php b/src/Module/OpenSearch.php index 044c2b1278..9f89660eed 100644 --- a/src/Module/OpenSearch.php +++ b/src/Module/OpenSearch.php @@ -1,10 +1,30 @@ . + * + */ namespace Friendica\Module; use DOMDocument; use DOMElement; use Friendica\BaseModule; +use Friendica\Core\System; use Friendica\DI; use Friendica\Util\XML; @@ -17,10 +37,8 @@ class OpenSearch extends BaseModule /** * @throws \Exception */ - public static function rawContent(array $parameters = []) + protected function rawContent(array $request = []) { - header('Content-type: application/opensearchdescription+xml'); - $hostname = DI::baseUrl()->getHostname(); $baseUrl = DI::baseUrl()->get(); @@ -32,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); @@ -66,8 +87,6 @@ class OpenSearch extends BaseModule 'template' => "$baseUrl/opensearch", ]); - echo $xml->saveXML(); - - exit(); + System::httpExit($xml->saveXML(), Response::TYPE_XML, 'application/opensearchdescription+xml'); } }