protected static function _processFolders($secureFolders)
    {
        $secureFolders = array_filter(is_array($secureFolders) ? $secureFolders : explode(',', $secureFolders), 'trim');
        foreach ($secureFolders as $k => $folder) {
            $secureFolders[$k] = '/' . trim($folder, '/');
        }
        if (in_array('/', $secureFolders)) {
            return ['/']; // all uploads are secure
        }
        foreach ($secureFolders as $k => $folder) {
            foreach ($secureFolders as $folderCheck) {
                if (strpos($folder, $folderCheck . '/') === 0) {
                    unset($secureFolders[$k]);
                }
            }
        }
        return $secureFolders;
    }
protected static function _processFolders($secureFolders)
    {
        $secureFolders = array_filter(is_array($secureFolders) ? $secureFolders : explode(',', $secureFolders), 'trim');
        foreach ($secureFolders as $k => $folder) {
            $secureFolders[$k] = '/' . trim($folder, '/');
        }
        if (in_array('/', $secureFolders)) {
            return ['/']; // all uploads are secure
        }
        foreach ($secureFolders as $k => $folder) {
            foreach ($secureFolders as $folderCheck) {
                if (strpos($folder, $folderCheck . '/') === 0) {
                    unset($secureFolders[$k]);
                }
            }
        }
        return $secureFolders;
    }
protected static function _processFolders ( $ secureFolders ) { $ secureFolders = array_filter ( is_array ( $ secureFolders ) ? $ secureFolders : explode ( ',' , $ secureFolders ) , 'trim' ) ; foreach ( $ secureFolders as $ k => $ folder ) { $ secureFolders [ $ k ] = '/' . trim ( $ folder , '/' ) ; } if ( in_array ( '/' , $ secureFolders ) ) { return [ '/' ] ; // all uploads are secure } foreach ( $ secureFolders as $ k => $ folder ) { foreach ( $ secureFolders as $ folderCheck ) { if ( strpos ( $ folder , $ folderCheck . '/' ) === 0 ) { unset ( $ secureFolders [ $ k ] ) ; } } } return $ secureFolders ; }
Remove subfolders and blank entries then return array
@param string|array $secureFolders
@return array
Remove subfolders and blank entries then return array