stript #anchors from urls

This commit is contained in:
Lynne Megido 2020-09-04 21:31:09 +10:00
parent 0a400cf53b
commit c2c53cedd2
Signed by: lynnesbian
GPG Key ID: F0A184B5213D9F90

View File

@ -20,7 +20,7 @@ namespace Buypeeb {
public static string IDFromURL(string url) {
// TODO: handle invalid URLs better, or at all really
Regex rx = new Regex(@"^([^?]+)");
Regex rx = new Regex(@"^([^?#]+)");
url = rx.Match(url).Groups[1].Value; // remove query params (if any)
rx = new Regex(@".+\/(.+?)/?$");