From 9ad783d3a5dd8f043965d91dbe77c30dfe49697e Mon Sep 17 00:00:00 2001 From: linsui <36977733+linsui@users.noreply.github.com> Date: Thu, 1 Aug 2019 16:08:16 +0000 Subject: [PATCH] fix(autoupdate): remove any whitespace from hash (#3579) Allow extracting hashes with containing spaces and newlines (e.g. `ef 5d 41 08 32 9c 71 b4 b5 b6 0f be 2f bc 49 ac ef 86 69 49 42 e8 37 65 a4 86 30 10 ea be 0d 79`) FreeCad Example: ```json "hash": { "url": "$url-SHA256.txt", "regex": "(?sm):\\s+([a-f\\d\\s]+)CertUtil" } ``` --- lib/autoupdate.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/autoupdate.ps1 b/lib/autoupdate.ps1 index 57910d08..e28bc595 100644 --- a/lib/autoupdate.ps1 +++ b/lib/autoupdate.ps1 @@ -58,7 +58,7 @@ function find_hash_in_textfile([String] $url, [Hashtable] $substitutions, [Strin $regex = substitute $regex $substitutions $true debug $regex if ($hashfile -match $regex) { - $hash = $matches[1] -replace ' ','' + $hash = $matches[1] -replace '\s','' } # convert base64 encoded hash values