Skip to content

Commit bc6f40a

Browse files
committed
Switch to downloads.php.net in Get-ICUUrl [skip ci]
1 parent fe26b50 commit bc6f40a

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/scripts/extensions/http.ps1

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@ Function Get-ICUUrl() {
1010
[ValidateNotNull()]
1111
$vs_version
1212
)
13-
$trunk = "https://windows.php.net"
14-
$urls=@("${trunk}/downloads/php-sdk/deps/${vs_version}/${arch}", "${trunk}/downloads/php-sdk/deps/archives/${vs_version}/${arch}")
13+
$trunk = "https://downloads.php.net"
14+
$urls=@("${trunk}/~windows/php-sdk/deps/${vs_version}/${arch}/", "${trunk}/~windows/php-sdk/deps/archives/${vs_version}/${arch}/")
1515
foreach ($url in $urls) {
16-
$web_content = Get-File -Url $url
16+
try {
17+
$web_content = Get-File -Url $url 2>$null
18+
} catch { continue }
1719
foreach ($link in $web_content.Links) {
18-
if ($link -match "/.*ICU-${icu_version}.*/") {
19-
return $trunk + $link.HREF
20+
if ($link.href -match ".*ICU-${icu_version}.*") {
21+
return $url + $link.HREF
2022
}
2123
}
2224
}

0 commit comments

Comments
 (0)