Skip to content

Commit

Permalink
Change sf regex not to break some manifests. Fixes #2474 (#2476)
Browse files Browse the repository at this point in the history
  • Loading branch information
se35710 authored and r15ch13 committed Aug 8, 2018
1 parent acf11b9 commit cd33a9e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/core.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -656,9 +656,9 @@ function handle_special_urls($url)
}

# Sourceforge.net
if ($url -match "(?:downloads\.)?sourceforge.net\/projects?\/(?<project>[^\/]+)\/(?:files\/)?(?<file>.*)") {
if ($url -match "(?:downloads\.)?sourceforge.net\/projects?\/(?<project>[^\/]+)\/(?:files\/)?(?<file>.*?)(?:$|\/download|\?)") {
# Reshapes the URL to avoid redirections
$url = "https://downloads.sourceforge.net/project/$($matches['project'])/$($matches['file'])?r=&ts="
$url = "https://downloads.sourceforge.net/project/$($matches['project'])/$($matches['file'])"
}
return $url
}

0 comments on commit cd33a9e

Please sign in to comment.