From a1f332aaa527ae36ecc8cf2944f8b71e2317afea Mon Sep 17 00:00:00 2001 From: Philipp Holzer Date: Sat, 4 May 2019 21:37:32 +0200 Subject: [PATCH 1/2] Move mod/rsd_xml to src/Module/ReallySimpleDiscovery --- mod/rsd_xml.php | 26 -------------------------- src/App/Router.php | 1 + src/Module/ReallySimpleDiscovery.php | 21 +++++++++++++++++++++ view/templates/rsd.tpl | 15 +++++++++++++++ 4 files changed, 37 insertions(+), 26 deletions(-) delete mode 100644 mod/rsd_xml.php create mode 100644 src/Module/ReallySimpleDiscovery.php create mode 100644 view/templates/rsd.tpl diff --git a/mod/rsd_xml.php b/mod/rsd_xml.php deleted file mode 100644 index 84dedd6c56..0000000000 --- a/mod/rsd_xml.php +++ /dev/null @@ -1,26 +0,0 @@ - - - - Friendica - http://friendica.com/ - - - - http://status.net/wiki/TwitterCompatibleAPI - false - - - - -'; - - exit(); -} diff --git a/src/App/Router.php b/src/App/Router.php index d35977dde1..3dc45fcfa1 100644 --- a/src/App/Router.php +++ b/src/App/Router.php @@ -161,6 +161,7 @@ class Router $collector->addRoute(['GET'], '/{sub1}/{sub2}/{url}' , Module\Proxy::class); }); $this->routeCollector->addRoute(['GET', 'POST'], '/register', Module\Register::class); + $this->routeCollector->addRoute(['GET'], '/rsd.xml', Module\ReallySimpleDiscovery::class); $this->routeCollector->addRoute(['GET'], '/statistics.json', Module\Statistics::class); $this->routeCollector->addRoute(['GET'], '/tos', Module\Tos::class); $this->routeCollector->addRoute(['GET'], '/webfinger', Module\WebFinger::class); diff --git a/src/Module/ReallySimpleDiscovery.php b/src/Module/ReallySimpleDiscovery.php new file mode 100644 index 0000000000..388a652aea --- /dev/null +++ b/src/Module/ReallySimpleDiscovery.php @@ -0,0 +1,21 @@ + + + + Friendica + http://friendica.com/ + + + + http://status.net/wiki/TwitterCompatibleAPI + false + + + + + From 1a79a741f090fc7aefdec734d1bf8bc3a58f0672 Mon Sep 17 00:00:00 2001 From: Philipp Holzer Date: Sun, 5 May 2019 10:09:08 +0200 Subject: [PATCH 2/2] include feedback --- src/Module/ReallySimpleDiscovery.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Module/ReallySimpleDiscovery.php b/src/Module/ReallySimpleDiscovery.php index 388a652aea..4c14d3c837 100644 --- a/src/Module/ReallySimpleDiscovery.php +++ b/src/Module/ReallySimpleDiscovery.php @@ -13,9 +13,9 @@ class ReallySimpleDiscovery extends BaseModule { public static function rawContent() { - header ("Content-Type: text/xml"); + header ('Content-Type: text/xml'); $tpl = Renderer::getMarkupTemplate('rsd.tpl'); - echo Renderer::replaceMacros($tpl, []); + echo Renderer::replaceMacros($tpl); exit(); } }