Edit check for valid slug. Fix #1459

This commit is contained in:
Flavio Copes
2017-05-04 09:50:46 +02:00
parent 83ed2aac00
commit c8345c6613
2 changed files with 2 additions and 1 deletions

View File

@@ -5,6 +5,7 @@
* Add more controls over HTML5 video attributes (autoplay, poster, loop controls) [#1442](https://github.com/getgrav/grav/pull/1442)
1. [](#bugfix)
* Fix to force route/redirect matching from the start of the route by default [#1446](https://github.com/getgrav/grav/issues/1446)
* Edit check for valid slug [#1459](https://github.com/getgrav/grav/issues/1459)
# v1.2.4
## 04/24/2017

View File

@@ -1497,7 +1497,7 @@ class Page
{
if ($var !== null && $var !== "") {
$this->slug = $var;
if (!preg_match('/^[a-z0-9][-a-z0-9]*$/', $this->slug)) {
if (!preg_match('/^[a-zA-Zа-яA-Я0-9][a-zA-Zа-яA-Я0-9_\-]*$/', $this->slug)) {
Grav::instance()['log']->notice("Invalid slug set in YAML frontmatter: " . $this->rawRoute() . " => " . $this->slug);
}
}