From 274257a0153615c19a075cac836bbe9bf27e472f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20Schw=C3=B6rer?= Date: Mon, 20 Jan 2020 18:47:06 +0100 Subject: [PATCH] and more selftest fixes... ... ... --- www/commands/updates_show.php | 8 +++++++- www/internals/modules/selftest.php | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/www/commands/updates_show.php b/www/commands/updates_show.php index 021f7b3..1669b1b 100644 --- a/www/commands/updates_show.php +++ b/www/commands/updates_show.php @@ -5,6 +5,12 @@ require_once (__DIR__ . '/../internals/website.php'); /** @var URLRoute $ROUTE */ global $ROUTE; /** @var Website $SITE */ global $SITE; ?> + +forceResult(400, "Wrong parameters."); return; } +$ulname = $API_OPTIONS['ulname']; +?> +
@@ -15,7 +21,7 @@ require_once (__DIR__ . '/../internals/website.php'); - modules->UpdatesLog()->getEntries($_GET['ulname'], 512) as $entry): ?> + modules->UpdatesLog()->getEntries($ulname, 512) as $entry): ?> diff --git a/www/internals/modules/selftest.php b/www/internals/modules/selftest.php index 21524cf..4ec0358 100644 --- a/www/internals/modules/selftest.php +++ b/www/internals/modules/selftest.php @@ -125,7 +125,7 @@ class SelfTest implements IWebsiteModule $this->addMethodMultiPathStatus("api::default::updatecheck-7", 200, '/api/update/{0}', function(){ return array_keys(Website::inst()->modules->UpdatesLog()->listUpdateData()); }); $this->addMethodPathStatus( "api::default::egg-status", 200, "/api/extendedgitgraph::status?secret=$ajaxsecret"); $this->addMethodPathStatus( "api::default::an-show", 200, "/api/alephnote::show?secret=$ajaxsecret"); - $this->addMethodPathStatus( "api::default::updates-show", 200, "/api/updates::show?secret=$ajaxsecret"); + $this->addMethodMultiPathStatus("api::default::updates-show", 200, "/api/updates::show?secret=$ajaxsecret&ulname={0}", function(){ return array_key_map(Website::inst()->modules->UpdatesLog()->listProgramsInformation(), 'name'); }); $this->addMethodPathStatus( "api::default::aoc-ajax", 200, "/api/html::panel_aoc_calendar"); $this->addMethodPathStatus( "api::default::404-1", 404, '/api/update/no_prog_xx'); $this->addMethodPathStatus( "api::default::404-2", 404, '/api/asdf::notfound');