From 43f1be01a3265d4314317f95a11e3ccbcb1f36c8 Mon Sep 17 00:00:00 2001 From: Mark Holtzhausen Date: Mon, 21 Dec 2009 16:55:38 +0200 Subject: [PATCH] Created client_service::bool to force boolean values --- webservice/clienttools/client_service.php | 7 +++++-- webservice/clienttools/services/0.9/kt.php | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/webservice/clienttools/client_service.php b/webservice/clienttools/client_service.php index addca68..73b0eb8 100644 --- a/webservice/clienttools/client_service.php +++ b/webservice/clienttools/client_service.php @@ -72,9 +72,12 @@ class client_service{ * $isTrue array contains a list of values that are recognized as 'true' values in boolean */ protected function bool($var=NULL){ + $ret=false; $isTrue=Array('true','0','yes'); - if(is_bool($var))return $var; - return (in_array(strtolower(trim((string)$var)),$isTrue)); + if(is_bool($var))$ret=$var; + $var=strtolower(trim(($var.''))); + $ret=(in_array($var,$isTrue)); + return $ret; } } diff --git a/webservice/clienttools/services/0.9/kt.php b/webservice/clienttools/services/0.9/kt.php index bc9f8b7..1c02bc6 100644 --- a/webservice/clienttools/services/0.9/kt.php +++ b/webservice/clienttools/services/0.9/kt.php @@ -532,7 +532,7 @@ class kt extends client_service { $filename = $params ['filename']; $reason = $params ['reason']; $tempfilename = $params ['tempfilename']; - $major_update = $this->bool($params); //Force value into boolean container. + $major_update = $this->bool($params['major_update']); //Force value into boolean container. $application = $this->AuthInfo ['appType']; $kt = &$this->KT; -- libgit2 0.21.4