diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-04-10 13:03:10 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-04-10 13:03:10 +0200 |
commit | 6cc578d1a7e8b2ff77d45baa81465b376f8049ef (patch) | |
tree | 46f9fede7afb9dc0b398380da38f69f1604e8efe | |
parent | 8d05848391fc87f20d11176082820a91031a2b34 (diff) | |
parent | b00592ade50f48b73002682494341c429a6a12eb (diff) | |
download | nextcloud-server-6cc578d1a7e8b2ff77d45baa81465b376f8049ef.tar.gz nextcloud-server-6cc578d1a7e8b2ff77d45baa81465b376f8049ef.zip |
Merge pull request #8018 from owncloud/ocs_result_success_is_100
OC_OCS_Result Class, Only accept 100 code as success
-rw-r--r-- | lib/private/ocs/result.php | 2 | ||||
-rw-r--r-- | tests/lib/api.php | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/private/ocs/result.php b/lib/private/ocs/result.php index 9f14e8da7e8..0e3b85d5905 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); } diff --git a/tests/lib/api.php b/tests/lib/api.php index 233beebd68a..0f7d08543ea 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), ); } |