Fix #2134 - inheritance of theme classes that include digits in camelcase

This commit is contained in:
Andy Miller 2018-08-06 15:37:59 -06:00
parent 08cb311e5e
commit 424da520cf
No known key found for this signature in database
GPG Key ID: E82B8D0EAB94EFB9
2 changed files with 5 additions and 3 deletions

View File

@ -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

View File

@ -190,10 +190,11 @@ class Inflector
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);
}
/**