From a36c11b71a52b8d9354b7953038a901d66e12e3c Mon Sep 17 00:00:00 2001 From: Michael Vasseur <14887731+vmcj@users.noreply.github.com> Date: Fri, 23 Feb 2024 21:20:06 +0100 Subject: [PATCH] Allow shadowing from PC2 --- webapp/src/Service/ExternalContestSourceService.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/webapp/src/Service/ExternalContestSourceService.php b/webapp/src/Service/ExternalContestSourceService.php index 741862b8b83..c07b7473341 100644 --- a/webapp/src/Service/ExternalContestSourceService.php +++ b/webapp/src/Service/ExternalContestSourceService.php @@ -535,7 +535,8 @@ protected function loadContest(): void case ExternalContestSource::TYPE_CCS_API: try { // The base URL is the URL of the CCS API root. - if (preg_match('/^(.*\/)contests\/.*/', + // Proper is '^(.*\/)contests\/.*/', but PC^2 doesn't expose this (yet). + if (preg_match('/^(.*\/)contest(s\/.*/)?', $this->source->getSource(), $matches) === 0) { $this->loadingError = 'Cannot determine base URL. Did you pass a CCS API contest URL?'; $this->cachedContestData = null;