Commit 43f1be01a3265d4314317f95a11e3ccbcb1f36c8
1 parent
5f57588f
Created client_service::bool to force boolean values
Fixed KTE-49 - Checkin major version / minor version
Showing
2 changed files
with
6 additions
and
3 deletions
webservice/clienttools/client_service.php
| @@ -72,9 +72,12 @@ class client_service{ | @@ -72,9 +72,12 @@ class client_service{ | ||
| 72 | * $isTrue array contains a list of values that are recognized as 'true' values in boolean | 72 | * $isTrue array contains a list of values that are recognized as 'true' values in boolean |
| 73 | */ | 73 | */ |
| 74 | protected function bool($var=NULL){ | 74 | protected function bool($var=NULL){ |
| 75 | + $ret=false; | ||
| 75 | $isTrue=Array('true','0','yes'); | 76 | $isTrue=Array('true','0','yes'); |
| 76 | - if(is_bool($var))return $var; | ||
| 77 | - return (in_array(strtolower(trim((string)$var)),$isTrue)); | 77 | + if(is_bool($var))$ret=$var; |
| 78 | + $var=strtolower(trim(($var.''))); | ||
| 79 | + $ret=(in_array($var,$isTrue)); | ||
| 80 | + return $ret; | ||
| 78 | } | 81 | } |
| 79 | 82 | ||
| 80 | } | 83 | } |
webservice/clienttools/services/0.9/kt.php
| @@ -532,7 +532,7 @@ class kt extends client_service { | @@ -532,7 +532,7 @@ class kt extends client_service { | ||
| 532 | $filename = $params ['filename']; | 532 | $filename = $params ['filename']; |
| 533 | $reason = $params ['reason']; | 533 | $reason = $params ['reason']; |
| 534 | $tempfilename = $params ['tempfilename']; | 534 | $tempfilename = $params ['tempfilename']; |
| 535 | - $major_update = $this->bool($params); //Force value into boolean container. | 535 | + $major_update = $this->bool($params['major_update']); //Force value into boolean container. |
| 536 | $application = $this->AuthInfo ['appType']; | 536 | $application = $this->AuthInfo ['appType']; |
| 537 | 537 | ||
| 538 | $kt = &$this->KT; | 538 | $kt = &$this->KT; |