X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FOpenSearch.php;h=9f89660eeda1b9df477681787ee09bfa632c596c;hb=f114ad188353910f1714a2df04affb7e5ee58253;hp=e1da6741841190dcb9ad71e0e1d3442c3a8cb197;hpb=e944d7bed6b971494bff82396960d280e6a82cca;p=friendica.git diff --git a/src/Module/OpenSearch.php b/src/Module/OpenSearch.php index e1da674184..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,11 +37,9 @@ 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()(); + $hostname = DI::baseUrl()->getHostname(); $baseUrl = DI::baseUrl()->get(); /** @var DOMDocument $xml */ @@ -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'); } }