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;