diff --git a/webapp/src/Service/ExternalContestSourceService.php b/webapp/src/Service/ExternalContestSourceService.php index c07b747334..6e49f51c2a 100644 --- a/webapp/src/Service/ExternalContestSourceService.php +++ b/webapp/src/Service/ExternalContestSourceService.php @@ -536,7 +536,7 @@ protected function loadContest(): void try { // The base URL is the URL of the CCS API root. // Proper is '^(.*\/)contests\/.*/', but PC^2 doesn't expose this (yet). - if (preg_match('/^(.*\/)contest(s\/.*/)?', + 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;