diff --git a/CHANGELOG.md b/CHANGELOG.md index 73ad1d56b..25f8a0736 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/lib/install.ps1 b/lib/install.ps1 index cdbfdf1a7..5b5270411 100644 --- a/lib/install.ps1 +++ b/lib/install.ps1 @@ -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) {