mirror of
https://github.com/danielstjules/Stringy.git
synced 2025-08-13 00:34:11 +02:00
Check offset in camelize
This commit is contained in:
@@ -139,7 +139,11 @@ class Stringy implements \Countable, \IteratorAggregate, \ArrayAccess
|
||||
$stringy->str = preg_replace_callback(
|
||||
'/[-_\s]+(.)?/u',
|
||||
function ($match) use ($encoding) {
|
||||
return $match[1] ? mb_strtoupper($match[1], $encoding) : '';
|
||||
if (isset($match[1])) {
|
||||
return mb_strtoupper($match[1], $encoding);
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
},
|
||||
$stringy->str
|
||||
);
|
||||
|
Reference in New Issue
Block a user