fix(core): Fix is_in_dir under Unix (#5391)

This commit is contained in:
Hsiao-nan Cheung
2023-02-19 23:56:53 +08:00
committed by GitHub
parent 1d0bd434ab
commit 32ca856f63
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -9,6 +9,7 @@
- **decompress:** Exclude '*.nsis' that may cause error ([#5294](https://github.com/ScoopInstaller/Scoop/issues/5294))
- **autoupdate:** Fix file hash extraction ([#5295](https://github.com/ScoopInstaller/Scoop/issues/5295))
- **shortcuts:** Output correctly formatted path ([#5333](https://github.com/ScoopInstaller/Scoop/issues/5333))
- **core:** Fix `is_in_dir` under Unix ([#5391](https://github.com/ScoopInstaller/Scoop/issues/5391))
### Code Refactoring
+1 -1
View File
@@ -632,7 +632,7 @@ function cookie_header($cookies) {
function is_in_dir($dir, $check) {
$check = "$(fullpath $check)"
$dir = "$(fullpath $dir)"
$check -match "^$([regex]::escape("$dir"))(\\|`$)"
$check -match "^$([regex]::Escape("$dir"))([/\\]|`$)"
}
function ftp_file_size($url) {