From 78328fcc1156f2aba8a6e0eb9613bd9d895e8dc4 Mon Sep 17 00:00:00 2001 From: cdujeu Date: Mon, 17 Oct 2016 15:56:25 +0200 Subject: [PATCH] Fix reject empty call --- core/src/plugins/access.imap/ImapAccessWrapper.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/core/src/plugins/access.imap/ImapAccessWrapper.php b/core/src/plugins/access.imap/ImapAccessWrapper.php index c3c5243978..646ad77cc4 100644 --- a/core/src/plugins/access.imap/ImapAccessWrapper.php +++ b/core/src/plugins/access.imap/ImapAccessWrapper.php @@ -30,8 +30,6 @@ defined('AJXP_EXEC') or die( 'Access not allowed'); -function rejectEmpty($element){return !empty($element);} - /** * Plugin to browse a mailbox content (IMAP OR POP) * @package AjaXplorer_Plugins @@ -87,6 +85,12 @@ public static function getCurrentAttachmentsMetadata() return self::$attachmentsMetadata; } + private function rejectEmpty($element){ + return !empty($element); + } + + + public function stream_open($path, $mode, $options, &$opened_path) { // parse URL @@ -102,7 +106,7 @@ public function stream_open($path, $mode, $options, &$opened_path) $this->path = substr($parts["path"], 1); //$this->mailbox = "INBOX"; $pathParts = explode("/", $this->path); - $pathParts = array_filter($pathParts, "rejectEmpty"); + $pathParts = array_filter($pathParts, [$this, "rejectEmpty"]); if (count($pathParts) > 1) { $this->path = array_pop($pathParts); $this->mailbox = implode("/", $pathParts);