From 707b052c20f974f5d33fc2ba3e8cafc07e1b507a Mon Sep 17 00:00:00 2001 From: Jim Mason Date: Wed, 25 Aug 2021 19:24:31 +0100 Subject: [PATCH] fixed undefineds for Travis CI --- ui/Home.php | 2 +- ui/UICommon.php | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ui/Home.php b/ui/Home.php index 5e0ac7b1..e17c6594 100644 --- a/ui/Home.php +++ b/ui/Home.php @@ -58,7 +58,7 @@ private function emitTopPlays($numweeks=1, $limit=10) { if(! isset($y) || !$y) return; // No charts! bail. - if(!$numWeeks || $numWeeks == 1) + if(!$numweeks || $numweeks == 1) Engine::api(IChart::class)->getChart($topPlays, "", $lastWeek["week"], $limit); else { // Determine start chart date that will yield $numweeks worth of charts diff --git a/ui/UICommon.php b/ui/UICommon.php index d0b50f10..34118ceb 100644 --- a/ui/UICommon.php +++ b/ui/UICommon.php @@ -101,6 +101,9 @@ class UICommon { * return the URL of the current request, less leaf filename, if any */ public static function getBaseUrl() { + if(php_sapi_name() == "cli") + return ""; + $uri = $_SERVER['REQUEST_URI']; // strip the query string, if any