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

Lines changed: 4 additions & 0 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy