summaryrefslogtreecommitdiffstats
path: root/lib/private/ocsclient.php
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-08-01 09:54:32 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2014-08-01 09:54:32 +0200
commit378f35f0ec7145b6ddeca4023a3a8bdadb450cc1 (patch)
treee3d94c4c248df552e64602abe0d928857b471c98 /lib/private/ocsclient.php
parent6cbfe8fd987d166ff26a7987c7e4983797ada78d (diff)
downloadnextcloud-server-378f35f0ec7145b6ddeca4023a3a8bdadb450cc1.tar.gz
nextcloud-server-378f35f0ec7145b6ddeca4023a3a8bdadb450cc1.zip
prevent PHP errors and enhance logging
Diffstat (limited to 'lib/private/ocsclient.php')
-rw-r--r--lib/private/ocsclient.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/private/ocsclient.php b/lib/private/ocsclient.php
index dc52fc27b5e..e1db0995eab 100644
--- a/lib/private/ocsclient.php
+++ b/lib/private/ocsclient.php
@@ -162,7 +162,7 @@ class OC_OCSClient{
$xml=OC_OCSClient::getOCSresponse($url);
if($xml==false) {
- OC_Log::write('core', 'Unable to parse OCS content', OC_Log::FATAL);
+ OC_Log::write('core', 'Unable to parse OCS content for app ' . $id, OC_Log::FATAL);
return null;
}
$loadEntities = libxml_disable_entity_loader(true);
@@ -170,6 +170,10 @@ class OC_OCSClient{
libxml_disable_entity_loader($loadEntities);
$tmp=$data->data->content;
+ if (is_null($tmp)) {
+ OC_Log::write('core', 'Invalid OCS content returned for app ' . $id, OC_Log::FATAL);
+ return null;
+ }
$app=array();
$app['id']=$tmp->id;
$app['name']=$tmp->name;