From 6108123fe7f1415a1a7ecd4a0a33a0d64bf08776 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 21 Jul 2016 17:43:04 +0200 Subject: [PATCH] fix PHP Fatal in propatch --- api/src/Vfs/Sqlfs/StreamWrapper.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/api/src/Vfs/Sqlfs/StreamWrapper.php b/api/src/Vfs/Sqlfs/StreamWrapper.php index caf77b9fd4..e53742da74 100644 --- a/api/src/Vfs/Sqlfs/StreamWrapper.php +++ b/api/src/Vfs/Sqlfs/StreamWrapper.php @@ -1787,10 +1787,12 @@ class StreamWrapper extends Api\Db\Pdo implements Vfs\StreamWrapperIface */ static function proppatch($path,array $props) { + static $inst = null; if (self::LOG_LEVEL > 1) error_log(__METHOD__."(".array2string($path).','.array2string($props)); if (!is_numeric($path)) { - if (!($stat = $vfs->url_stat($path,0))) + if (!isset($inst)) $inst = new self(); + if (!($stat = $inst->url_stat($path,0))) { return false; } @@ -1852,13 +1854,15 @@ class StreamWrapper extends Api\Db\Pdo implements Vfs\StreamWrapperIface */ static function propfind($path_ids,$ns=Vfs::DEFAULT_PROP_NAMESPACE) { + static $inst = null; + $ids = is_array($path_ids) ? $path_ids : array($path_ids); foreach($ids as &$id) { if (!is_numeric($id)) { - $vfs = new self(); - if (!($stat = $vfs->url_stat($id,0))) + if (!isset($inst)) $inst = new self(); + if (!($stat = $inst->url_stat($id,0))) { if (self::LOG_LEVEL) error_log(__METHOD__."(".array2string($path_ids).",$ns) path '$id' not found!"); return false;