. * * ███████╗███████╗██████╗ ██╗ ██╗███╗ ███╗ █████╗ ███████╗██╗ ██╗ * ██╔════╝██╔════╝██╔══██╗██║ ██║████╗ ████║██╔══██╗██╔════╝██║ ██╔╝ * ███████╗█████╗ ██████╔╝██║ ██║██╔████╔██║███████║███████╗█████╔╝ * ╚════██║██╔══╝ ██╔══██╗╚██╗ ██╔╝██║╚██╔╝██║██╔══██║╚════██║██╔═██╗ * ███████║███████╗██║ ██║ ╚████╔╝ ██║ ╚═╝ ██║██║ ██║███████║██║ ██╗ * ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ */ if ( ! defined( 'ABSPATH' ) ) { die( 'Kangaroos cannot jump here' ); } class Ai1wm_Recursive_Exclude_Filter extends RecursiveFilterIterator { protected $exclude = array(); public function __construct( RecursiveIterator $iterator, $exclude = array() ) { parent::__construct( $iterator ); // Set exclude filter $this->exclude = $exclude; } public function accept() { if ( in_array( $this->getInnerIterator()->getSubPathname(), $this->exclude ) ) { return false; } if ( strpos( $this->getInnerIterator()->getSubPathname(), "\n" ) !== false ) { return false; } if ( strpos( $this->getInnerIterator()->getSubPathname(), "\r" ) !== false ) { return false; } return true; } public function getChildren() { return new self( $this->getInnerIterator()->getChildren(), $this->exclude ); } }