Make sure we always have the language code in the URL

This commit is contained in:
Flavio Copes
2015-08-19 17:27:57 +02:00
parent a27ee216dd
commit 8d2440d238

View File

@@ -117,6 +117,11 @@ class AdminController
} }
$base = $this->admin->base; $base = $this->admin->base;
if ($base[3] !== '/') {
$base = '/' . $this->grav['session']->admin_lang . $base;
}
$path = trim(substr($this->redirect, 0, strlen($base)) == $base ? substr($this->redirect, strlen($base)) : $this->redirect, '/'); $path = trim(substr($this->redirect, 0, strlen($base)) == $base ? substr($this->redirect, strlen($base)) : $this->redirect, '/');
$this->grav->redirect($base . '/' . preg_replace('|/+|', '/', $path), $this->redirectCode); $this->grav->redirect($base . '/' . preg_replace('|/+|', '/', $path), $this->redirectCode);