automatically trim() all parameters given

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2018-02-26 08:21:56 +01:00
parent 4a1decf359
commit 592c9ed0b9
6 changed files with 35 additions and 31 deletions

View File

@@ -63,7 +63,7 @@ class Admins extends ApiCommand implements ResourceEntity
{
$id = $this->getParam('id', true, 0);
$ln_optional = ($id <= 0 ? false : true);
$loginname = trim($this->getParam('loginname', $ln_optional, ''));
$loginname = $this->getParam('loginname', $ln_optional, '');
if ($this->isAdmin() && ($this->getUserDetail('change_serversettings') == 1 || ($this->getUserDetail('adminid') == $id || $this->getUserDetail('loginname') == $loginname))) {
$result_stmt = Database::prepare("
@@ -314,7 +314,7 @@ class Admins extends ApiCommand implements ResourceEntity
$id = $this->getParam('id', true, 0);
$ln_optional = ($id <= 0 ? false : true);
$loginname = trim($this->getParam('loginname', $ln_optional, ''));
$loginname = $this->getParam('loginname', $ln_optional, '');
$json_result = Admins::getLocal($this->getUserData(), array(
'id' => $id,
@@ -582,7 +582,7 @@ class Admins extends ApiCommand implements ResourceEntity
if ($this->isAdmin() && $this->getUserDetail('change_serversettings') == 1) {
$id = $this->getParam('id', true, 0);
$ln_optional = ($id <= 0 ? false : true);
$loginname = trim($this->getParam('loginname', $ln_optional, ''));
$loginname = $this->getParam('loginname', $ln_optional, '');
$json_result = Admins::getLocal($this->getUserData(), array(
'id' => $id,
@@ -659,7 +659,7 @@ class Admins extends ApiCommand implements ResourceEntity
if ($this->isAdmin() && $this->getUserDetail('change_serversettings') == 1) {
$id = $this->getParam('id', true, 0);
$ln_optional = ($id <= 0 ? false : true);
$loginname = trim($this->getParam('loginname', $ln_optional, ''));
$loginname = $this->getParam('loginname', $ln_optional, '');
$json_result = Admins::getLocal($this->getUserData(), array(
'id' => $id,