[Pkg-owncloud-commits] [owncloud] 21/121: prevent PHP errors and enhance logging

David Prévot taffit at moszumanska.debian.org
Thu Aug 21 16:44:26 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit 5b88d3d3fc52478265549053839d810dcc76e803
Author: Thomas Müller <thomas.mueller at tmit.eu>
Date:   Fri Aug 1 09:54:32 2014 +0200

    prevent PHP errors and enhance logging
---
 lib/private/ocsclient.php | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/private/ocsclient.php b/lib/private/ocsclient.php
index dc52fc2..e1db099 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;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list