mirror of
https://github.com/getgrav/grav.git
synced 2026-07-20 09:21:14 +02:00
Edit check for valid slug. Fix #1459
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user