Skip to content

Updated to work with NC15. Fixed wildcard matching. #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@ occ config:app:set --value '[".snapshot","anotherfolder", "pattern/*/match"]' fi
Any file or folder matching one of the configured rules will not be included in Nextcloud if
it exists on the filesystem and any user will be blocked from creating any file or folder matching
any of the rules.

## Installation

* Clone the repository (or download and uncompress it) into a new subdirectory under your nextcloud/apps directory called files\_excludedirs
* In the files\_excludedirs subdirectory run this command to install it: "composer install"
* Make sure the "Exclude directories" app inside nextcloud has been enabled, and you should be good to go!
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<version>0.0.1</version>
<namespace>Files_ExcludeDirs</namespace>
<dependencies>
<nextcloud min-version="10" max-version="13" />
<nextcloud min-version="10" max-version="15" />
</dependencies>
<types>
<filesystem/>
Expand Down
4 changes: 3 additions & 1 deletion lib/Wrapper/Exclude.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ private function excludedPath($path) {
// glob requires all paths to be absolute so we put /'s in front of them
if (strpos($rule, '/') !== false) {
$rule = '/' . rtrim($rule, '/');
return Glob::match('/' . $path, $rule);
if(Glob::match('/' . $path, $rule)) {
return true;
}
} else {
$parts = explode('/', $path);
$rule = '/' . $rule;
Expand Down