|
@@ -661,6 +661,9 @@ class SiteController extends ActionController
|
|
|
|
|
|
|
|
// Prepare the redirection
|
|
// Prepare the redirection
|
|
|
if ($redirectTo) {
|
|
if ($redirectTo) {
|
|
|
|
|
+ if ($redirectTo == $organizationId) {
|
|
|
|
|
+ throw new \InvalidArgumentException('redirectTo value has to be different from the organizationId');
|
|
|
|
|
+ }
|
|
|
$originUrl = $this->getSiteInfosAction($organizationId)['baseUrl'];
|
|
$originUrl = $this->getSiteInfosAction($organizationId)['baseUrl'];
|
|
|
$targetUrl = $this->getSiteInfosAction($redirectTo)['baseUrl'];
|
|
$targetUrl = $this->getSiteInfosAction($redirectTo)['baseUrl'];
|
|
|
}
|
|
}
|
|
@@ -1230,6 +1233,10 @@ class SiteController extends ActionController
|
|
|
$originUrl = $infos['baseUrl'];
|
|
$originUrl = $infos['baseUrl'];
|
|
|
$rootUid = $infos['rootUid'];
|
|
$rootUid = $infos['rootUid'];
|
|
|
|
|
|
|
|
|
|
+ if (preg_replace('/https?:\/\//', '', $originUrl) == preg_replace('/https?:\/\//', '', $newDomain) ) {
|
|
|
|
|
+ throw new \RuntimeException('The new domain should be different of the current one');
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
$this->writeConfigFile($organizationId, $rootUid, $newDomain);
|
|
$this->writeConfigFile($organizationId, $rootUid, $newDomain);
|
|
|
|
|
|
|
|
if ($redirect) {
|
|
if ($redirect) {
|