Skip to content

Commit

Permalink
Fixed #3111
Browse files Browse the repository at this point in the history
better implementation for #3090
  • Loading branch information
brandonkelly committed Jul 18, 2018
1 parent 5e07acb commit 5e06727
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Fixed
- Fixed a bug where the `orderBy` element query param wasn’t being respected when used in conjunction with a `with` param to eager-load elements in a specific order. ([#3109](https://github.com/craftcms/cms/issues/3109))
- Fixed a bug where underscores were getting removed from slugs. ([#3111](https://github.com/craftcms/cms/issues/3111))

## 3.0.16 - 2018-07-17

Expand Down
6 changes: 4 additions & 2 deletions src/helpers/StringHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
use Stringy\Stringy as BaseStringy;
use yii\base\Exception;
use yii\base\InvalidConfigException;
use yii\helpers\Inflector;

/**
* This helper class provides various multi-byte aware string related manipulation and encoding methods.
Expand Down Expand Up @@ -1039,9 +1038,12 @@ public static function encodeMb4(string $string): string
*/
private static function _prepStringForCasing(string $string, bool $lower = true, bool $removePunctuation = true): array
{
// Convert CamelCase to multiple words
$string = preg_replace('/(?<![A-Z])[A-Z]/', ' \0', $string);

if ($lower) {
// Make it lowercase
$string = Inflector::camel2words($string, false);
$string = static::toLowerCase($string);
}

if ($removePunctuation) {
Expand Down

0 comments on commit 5e06727

Please sign in to comment.