Skip to content

Commit

Permalink
ENH Use standardised BackURL instead of non-standard returnURL
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli committed Sep 23, 2024
1 parent dca4404 commit a9ed7b9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions code/Controllers/ModelAsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ protected function beforeHandleRequest(HTTPRequest $request)
Director::absoluteBaseURL(),
'dev/build',
'?' . http_build_query([
'returnURL' => isset($_GET['url']) ? $_GET['url'] : null,
'BackURL' => isset($_GET['url']) ? $_GET['url'] : null,
])
));
}
Expand All @@ -81,7 +81,7 @@ public function handleRequest(HTTPRequest $request): HTTPResponse

// If the database has not yet been created, redirect to the build page.
if (!DB::is_active() || !ClassInfo::hasTable('SiteTree')) {
$this->getResponse()->redirect(Controller::join_links(Director::absoluteBaseURL(), 'dev/build?returnURL=' . (isset($_GET['url']) ? urlencode($_GET['url']) : null)));
$this->getResponse()->redirect(Controller::join_links(Director::absoluteBaseURL(), 'dev/build?BackURL=' . (isset($_GET['url']) ? urlencode($_GET['url']) : null)));
$this->popCurrent();

return $this->getResponse();
Expand Down
4 changes: 2 additions & 2 deletions code/Controllers/RootURLController.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ protected function beforeHandleRequest(HTTPRequest $request)
Director::absoluteBaseURL(),
'dev/build',
'?' . http_build_query([
'returnURL' => isset($_GET['url']) ? $_GET['url'] : null,
'BackURL' => isset($_GET['url']) ? $_GET['url'] : null,
])
));
}
Expand All @@ -91,7 +91,7 @@ public function handleRequest(HTTPRequest $request): HTTPResponse

if (!$this->getResponse()->isFinished()) {
if (!DB::is_active() || !ClassInfo::hasTable('SiteTree')) {
$this->getResponse()->redirect(Director::absoluteBaseURL() . 'dev/build?returnURL=' . (isset($_GET['url']) ? urlencode($_GET['url']) : null));
$this->getResponse()->redirect(Director::absoluteBaseURL() . 'dev/build?BackURL=' . (isset($_GET['url']) ? urlencode($_GET['url']) : null));
return $this->getResponse();
}

Expand Down

0 comments on commit a9ed7b9

Please sign in to comment.