From 6b017201b8753206236bf96b61c87224c6e41f41 Mon Sep 17 00:00:00 2001 From: tomneedham Date: Wed, 2 Apr 2014 15:50:51 +0000 Subject: [PATCH 1/2] Only accept success as 100 like the OCS spec does --- lib/private/ocs/result.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/private/ocs/result.php b/lib/private/ocs/result.php index 9f14e8da7e..0e3b85d590 100644 --- a/lib/private/ocs/result.php +++ b/lib/private/ocs/result.php @@ -96,7 +96,7 @@ class OC_OCS_Result{ * @return bool */ public function succeeded() { - return (substr($this->statusCode, 0, 1) === '1'); + return ($this->statusCode == 100); } From b00592ade50f48b73002682494341c429a6a12eb Mon Sep 17 00:00:00 2001 From: tomneedham Date: Thu, 3 Apr 2014 14:47:55 +0000 Subject: [PATCH 2/2] Fix test case for api response code --- tests/lib/api.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/lib/api.php b/tests/lib/api.php index 233beebd68..0f7d08543e 100644 --- a/tests/lib/api.php +++ b/tests/lib/api.php @@ -37,7 +37,7 @@ class Test_API extends PHPUnit_Framework_TestCase { function dataProviderTestOneResult() { return array( array(100, true), - array(101, true), + array(101, false), array(997, false), ); }