Skip to content

Commit

Permalink
Fix #2134 - inheritance of theme classes that include digits in camel…
Browse files Browse the repository at this point in the history
…case
  • Loading branch information
rhukster committed Aug 6, 2018
1 parent 08cb311 commit 424da52
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* Improved `Utils::url()` to support query strings
1. [](#bugfix)
* Fixed issue with uppercase extensions and fallback media URLs [#2133](https://github.com/getgrav/grav/issues/2133)
* Fixed theme inheritance issue with `camel-case` that includes numbers [#2134](https://github.com/getgrav/grav/issues/2134)

# v1.5.0-rc.1
## 07/31/2018
Expand Down
7 changes: 4 additions & 3 deletions system/src/Grav/Common/Inflector.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,11 @@ public function underscorize($word)
public function hyphenize($word)
{
$regex1 = preg_replace('/([A-Z]+)([A-Z][a-z])/', '\1-\2', $word);
$regex2 = preg_replace('/([a-zd])([A-Z])/', '\1-\2', $regex1);
$regex3 = preg_replace('/[^A-Z^a-z^0-9]+/', '-', $regex2);
$regex2 = preg_replace('/([a-z])([A-Z])/', '\1-\2', $regex1);
$regex3 = preg_replace('/([0-9])([A-Z])/', '\1-\2', $regex2);
$regex4 = preg_replace('/[^A-Z^a-z^0-9]+/', '-', $regex3);

return strtolower($regex3);
return strtolower($regex4);
}

/**
Expand Down

0 comments on commit 424da52

Please sign in to comment.