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

Commit

Permalink
Fix reject empty call
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Oct 17, 2016
1 parent 20ef244 commit 78328fc
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions core/src/plugins/access.imap/ImapAccessWrapper.php
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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);
Expand Down

0 comments on commit 78328fc

Please sign in to comment.