Updated taskSave to ensure route is prefixed with a forward slash

This commit is contained in:
Gavin Roberts
2016-02-27 07:54:17 +00:00
parent b3a9d992d5
commit 772172821b

View File

@@ -1185,6 +1185,9 @@ class AdminController
$route = !isset($data['route']) ? dirname($this->admin->route) : $data['route'];
$obj = $this->admin->page(true);
// Ensure route is prefixed with a forward slash.
$route = '/' . ltrim($route, '/');
if (isset($data['frontmatter']) && !$this->checkValidFrontmatter($data['frontmatter'])) {
$this->admin->setMessage($this->admin->translate('PLUGIN_ADMIN.INVALID_FRONTMATTER_COULD_NOT_SAVE'), 'error');
return false;