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"
}
```
This commit is contained in:
linsui
2019-08-01 18:08:16 +02:00
committed by Richard Kuhnt
parent 1508d2ab00
commit 9ad783d3a5
+1 -1
View File
@@ -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