From 6805a135226e89c292b5ca79e383a0ec9913dc76 Mon Sep 17 00:00:00 2001 From: Alex Cabal Date: Thu, 8 May 2025 13:47:52 -0500 Subject: [PATCH] Remove query strings from GitHub URLs when creating a project --- lib/Project.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/Project.php b/lib/Project.php index e7a286b0..b4eeb071 100644 --- a/lib/Project.php +++ b/lib/Project.php @@ -237,6 +237,8 @@ final class Project{ } elseif(preg_match('|^https?://(www\.)?github.com/|ius', $this->VcsUrl)){ $this->VcsUrl = rtrim($this->VcsUrl, '/'); + // Remove query strings. + $this->VcsUrl = preg_replace('/\?[^\?]+$/iu', '', $this->VcsUrl); if(!preg_match('|^https://github.com/[^/]+/[^/]+$|ius', $this->VcsUrl)){ $error->Add(new Exceptions\InvalidVcsUrlException($this->VcsUrl)); }