Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit 78328fc

Browse files
committed
Fix reject empty call
1 parent 20ef244 commit 78328fc

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

core/src/plugins/access.imap/ImapAccessWrapper.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@
3030

3131
defined('AJXP_EXEC') or die( 'Access not allowed');
3232

33-
function rejectEmpty($element){return !empty($element);}
34-
3533
/**
3634
* Plugin to browse a mailbox content (IMAP OR POP)
3735
* @package AjaXplorer_Plugins
@@ -87,6 +85,12 @@ public static function getCurrentAttachmentsMetadata()
8785
return self::$attachmentsMetadata;
8886
}
8987

88+
private function rejectEmpty($element){
89+
return !empty($element);
90+
}
91+
92+
93+
9094
public function stream_open($path, $mode, $options, &$opened_path)
9195
{
9296
// parse URL
@@ -102,7 +106,7 @@ public function stream_open($path, $mode, $options, &$opened_path)
102106
$this->path = substr($parts["path"], 1);
103107
//$this->mailbox = "INBOX";
104108
$pathParts = explode("/", $this->path);
105-
$pathParts = array_filter($pathParts, "rejectEmpty");
109+
$pathParts = array_filter($pathParts, [$this, "rejectEmpty"]);
106110
if (count($pathParts) > 1) {
107111
$this->path = array_pop($pathParts);
108112
$this->mailbox = implode("/", $pathParts);

0 commit comments

Comments
 (0)