[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] phpgwapi/inc class.http_dav_client.inc.php
From: |
Caeies |
Subject: |
[Phpgroupware-cvs] phpgwapi/inc class.http_dav_client.inc.php |
Date: |
Sun, 10 Sep 2006 15:53:15 +0000 |
CVSROOT: /cvsroot/phpgwapi
Module name: phpgwapi
Changes by: Caeies <Caeies> 06/09/10 15:53:15
Modified files:
inc : class.http_dav_client.inc.php
Log message:
kill more bugs and E_ALL fixes
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/phpgwapi/inc/class.http_dav_client.inc.php?cvsroot=phpgwapi&r1=1.19&r2=1.20
Patches:
Index: class.http_dav_client.inc.php
===================================================================
RCS file: /cvsroot/phpgwapi/phpgwapi/inc/class.http_dav_client.inc.php,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- class.http_dav_client.inc.php 10 Sep 2006 10:12:15 -0000 1.19
+++ class.http_dav_client.inc.php 10 Sep 2006 15:53:15 -0000 1.20
@@ -7,7 +7,7 @@
* @license http://www.fsf.org/licenses/lgpl.html GNU Lesser General
Public License
* @package phpgwapi
* @subpackage network
- * @version $Id: class.http_dav_client.inc.php,v 1.19 2006/09/10
10:12:15 Caeies Exp $
+ * @version $Id: class.http_dav_client.inc.php,v 1.20 2006/09/10
15:53:15 Caeies Exp $
* @internal At the moment much of this is simply a wrapper around the
NET_HTTP_Client class, with some other methods for parsing the returned XML etc
Ideally this will eventually use groupware's inbuilt HTTP class
*/
@@ -42,6 +42,10 @@
function davtree($branch)
{
$object = array();
+ if(!is_object($branch))
+ {
+ return $object;
+ }
$branch = $branch->first_child();
while ($branch)
@@ -212,6 +216,11 @@
$xml_string =
preg_replace('/"DAV:"/','"http://webdav.org/dav/"',$this->xml);
// Build it
$domobj = domxml_open_mem($xml_string);
+ if(!is_object($domobj))
+ {
+ _debug_array($xml_string);
+ return;
+ }
// $time1 = getmicrotime();
$this->tree = dav_parser::davtree($domobj);
// echo getmicrotime() - $time1."\n";
@@ -504,7 +513,7 @@
$dav_processor = $this->dav_processor;
$dav_processor->parse_tree($xml_result);
$result_array = $dav_processor->tree;
-
+ $result = array();
foreach($result_array as $name=>$item) {
/* _debug_array("**".$name."**");*/
$name = $this->decodeurl($name);
@@ -512,7 +521,7 @@
//Get any extra properties that may share the
vfs name
foreach ($this->attributes as $num=>$vfs_name)
{
- if (isset($item[$vfs_name]))
+ if (isset($item[$vfs_name]) &&
$item[$vfs_name])
{
if(is_string($item[$vfs_name]))
{
@@ -528,7 +537,7 @@
//Map some DAV properties onto VFS ones.
foreach ($this->vfs_property_map as
$dav_name=>$vfs_name)
{
- if (isset($item[$dav_name]))
+ if (isset($item[$dav_name]) &&
$item[$dav_name])
{
if(is_string($item[$dav_name]))
{
@@ -570,7 +579,7 @@
$this->debug($newitem);
$result[$name]=$newitem;
}
- if ($sorted)
+ if ($sorted && is_array($result))
{
ksort($result);
}
@@ -1133,7 +1142,7 @@
unset($this->cached_propfind[$uri]);
unset($this->cached_propfind[$uri.'/']);
unset($this->cached_propfind[$this->server.$uri]);
- unset($this->cached_propfind[$rhis->server.$uri.'/']);
+ unset($this->cached_propfind[$this->server.$uri.'/']);
$suri = substr($uri,strlen($this->server));
unset($this->cached_propfind[$suri]);
unset($this->cached_propfind[$suri.'/']);