aboutsummaryrefslogtreecommitdiffstats
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-07 00:55:22 +0200
commit5b88d3d3fc52478265549053839d810dcc76e803 (patch)
tree79b14c8e0cf37eff699bf2deb7704c134bd87110
parentd59b94fa4c024d89eca09411e84c1fec7acaca51 (diff)
downloadnextcloud-server-5b88d3d3fc52478265549053839d810dcc76e803.tar.gz
nextcloud-server-5b88d3d3fc52478265549053839d810dcc76e803.zip
prevent PHP errors and enhance logging
-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;