Skip to content

Commit cef4339

Browse files
Do not add double slash to submission ZIP URL's when shadowing
1 parent b4a4fcc commit cef4339

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

webapp/src/Service/ExternalContestSourceService.php

+4
Original file line numberDiff line numberDiff line change
@@ -1435,6 +1435,10 @@ protected function importSubmission(Event $event, EventData $data): void
14351435
$zipUrl = $data->files[0]->href;
14361436
if (preg_match('/^https?:\/\//', $zipUrl) === 0) {
14371437
// Relative URL, prepend the base URL.
1438+
// If the base URL ends with a slash and the zip URL starts with one, remove the slash.
1439+
if (str_ends_with($this->basePath, '/') && str_starts_with($zipUrl, '/')) {
1440+
$zipUrl = substr($zipUrl, 1);
1441+
}
14381442
$zipUrl = ($this->basePath ?? '') . $zipUrl;
14391443
}
14401444

0 commit comments

Comments
 (0)