Skip to content

Commit

Permalink
Fix scheme being added twice when APP_URL has the scheme (area17#651)
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonio Carlos Ribeiro authored May 24, 2020
1 parent 3c2c3a1 commit 2e5784c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Http/Controllers/Admin/ModuleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1512,7 +1512,13 @@ protected function getParentModuleForeignKey()
*/
protected function getPermalinkBaseUrl()
{
return $this->request->getScheme() . '://' . Config::get('app.url') . '/'
$appUrl = Config::get('app.url');

if (blank(parse_url($appUrl)['scheme'] ?? null)) {
$appUrl = $this->request->getScheme() . '://' . $appUrl;
}

return $appUrl . '/'
. ($this->moduleHas('translations') ? '{language}/' : '')
. ($this->moduleHas('revisions') ? '{preview}/' : '')
. ($this->permalinkBase ?? $this->moduleName)
Expand Down

0 comments on commit 2e5784c

Please sign in to comment.