Bug fix + dependency update

This commit is contained in:
Roman Hergenreder 2020-06-24 21:18:26 +02:00
parent 6162eff694
commit 36cee43c74
5 changed files with 11 additions and 16 deletions

@ -49,14 +49,14 @@ class Request {
public function parseParams($values) { public function parseParams($values) {
foreach($this->params as $name => $param) { foreach($this->params as $name => $param) {
$value = (isset($values[$name]) ? $values[$name] : NULL); $value = $values[$name] ?? NULL;
if(!$param->optional && is_null($value)) { if(!$param->optional && (is_null($value) || empty($value))) {
$this->lastError = 'Missing parameter: ' . $name; $this->lastError = 'Missing parameter: ' . $name;
return false; return false;
} }
if(!is_null($value)) { if(!is_null($value) && !empty($value)) {
if(!$param->parseParam($value)) { if(!$param->parseParam($value)) {
$value = print_r($value, true); $value = print_r($value, true);
$this->lastError = "Invalid Type for parameter: $name '$value' (Required: " . $param->getTypeName() . ")"; $this->lastError = "Invalid Type for parameter: $name '$value' (Required: " . $param->getTypeName() . ")";

@ -68,11 +68,6 @@ abstract class Head extends View {
$this->addJS(Script::BOOTSTRAP); $this->addJS(Script::BOOTSTRAP);
} }
public function loadAdminlte() {
$this->addCSS(Link::ADMINLTE);
$this->addJS(Script::ADMINLTE);
}
public function getCode() { public function getCode() {
$header = "<head>"; $header = "<head>";

@ -245,7 +245,7 @@ class User extends ApiObject {
} }
public function processVisit() { public function processVisit() {
if ($this->sql && isset($_COOKIE["PHPSESSID"]) && !empty($_COOKIE["PHPSESSID"])) { if ($this->sql && $this->sql->isConnected() && isset($_COOKIE["PHPSESSID"]) && !empty($_COOKIE["PHPSESSID"])) {
if ($this->isBot()) { if ($this->isBot()) {
return; return;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long