Skip to content

Commit 0a14507

Browse files
svanschuHackwar
andauthored
fix cli scheduler:run breaks if --live-site does not end with / (#123)
* fix cli scheduler:run breaks if --live-site does not end with / Signed-off-by: Sven Schultschik <sven@schultschik.de> * Use str_starts_with/str_ends_with instead * Reverting previous commit * Use str_starts_with and str_ends_with properly --------- Signed-off-by: Sven Schultschik <sven@schultschik.de> Co-authored-by: Hannes Papenberg <info@joomlager.de>
1 parent 849714e commit 0a14507

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/AbstractWebApplication.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,11 @@ protected function detectRequestUri()
817817
} else {
818818
// If not in "Apache Mode" we will assume that we are in an IIS environment and proceed.
819819
// IIS uses the SCRIPT_NAME variable instead of a REQUEST_URI variable... thanks, MS
820-
$uri .= $this->input->server->getString('SCRIPT_NAME');
820+
$scriptname = $this->input->server->getString('SCRIPT_NAME');
821+
if (!str_starts_with($scriptname, '/') && !str_ends_with($uri, '/')) {
822+
$uri .= '/';
823+
}
824+
$uri .= $scriptname;
821825
$queryHost = $this->input->server->getString('QUERY_STRING', '');
822826

823827
// If the QUERY_STRING variable exists append it to the URI string.

0 commit comments

Comments
 (0)