diff --git a/CHANGELOG.md b/CHANGELOG.md index c22afbeb61..9d01d354e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/system/src/Grav/Common/Inflector.php b/system/src/Grav/Common/Inflector.php index f4a17ba7c5..61c2338095 100644 --- a/system/src/Grav/Common/Inflector.php +++ b/system/src/Grav/Common/Inflector.php @@ -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); } /**