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