]> source.dussan.org Git - nextcloud-server.git/commitdiff
Correct the api response when both a shipped app and/or a third party app fail
authorTom Needham <tom@owncloud.com>
Thu, 25 Apr 2013 00:08:11 +0000 (01:08 +0100)
committerTom Needham <tom@owncloud.com>
Thu, 25 Apr 2013 00:08:11 +0000 (01:08 +0100)
lib/api.php

index 8d6bbb7cc09631f038d9beca6bcae25e123c7ad0..12eea52d3b3f2437b3da1fc551b921c79e047154 100644 (file)
@@ -155,11 +155,11 @@ class OC_API {
                        // They may have failed for different reasons (different status codes)
                        // Which reponse code should we return?
                        // Maybe any that are not OC_API::RESPOND_SERVER_ERROR
-                       $response = $shipped['failed'][0];
+                       $response = reset($shipped['failed']);
                        return $response;
                } else {
                        // Return the third party failure result
-                       $response = $thirdparty['failed'][0];
+                       $response = reset($thirdparty['failed']);
                        return $response;
                }
                // Merge the successful responses