From 98692acb09bfe27b19a1b9341474b0494f36c2e2 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 24 Jul 2014 07:27:58 +0000 Subject: [PATCH] fixed sqlfs_stream_wrapper::dir_opendir("links://default/apps/$app/$id",0) links://default/apps/$app/$id is no directory! --- .../inc/class.links_stream_wrapper.inc.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/phpgwapi/inc/class.links_stream_wrapper.inc.php b/phpgwapi/inc/class.links_stream_wrapper.inc.php index ab973329d5..3a303a1a38 100644 --- a/phpgwapi/inc/class.links_stream_wrapper.inc.php +++ b/phpgwapi/inc/class.links_stream_wrapper.inc.php @@ -297,6 +297,25 @@ class links_stream_wrapper extends links_stream_wrapper_parent } return parent::stream_open($url,$mode,$options,$opened_path); } + + /** + * This method is called immediately when your stream object is created for examining directory contents with opendir(). + * + * Reimplemented to give no error, if entry directory does not exist. + * + * @param string $path URL that was passed to opendir() and that this object is expected to explore. + * @param $options + * @return booelan + */ + function dir_opendir ( $url, $options ) + { + if (!parent::url_stat($url, STREAM_URL_STAT_QUIET) && self::url_stat($url, STREAM_URL_STAT_QUIET)) + { + $this->opened_dir = array(); + return true; + } + return parent::dir_opendir($url, $options); + } } stream_register_wrapper(links_stream_wrapper::SCHEME ,'links_stream_wrapper');