Skip to content

Commit

Permalink
Edit check for valid slug. Fix #1459
Browse files Browse the repository at this point in the history
  • Loading branch information
flaviocopes committed May 4, 2017
1 parent 83ed2aa commit c8345c6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion system/src/Grav/Common/Page/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -1497,7 +1497,7 @@ public function slug($var = null)
{
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);
}
}
Expand Down

0 comments on commit c8345c6

Please sign in to comment.