Skip to content

Commit

Permalink
Merge pull request #5999 from getkirby/release/4.0.0-rc.4
Browse files Browse the repository at this point in the history
4.0.0-rc.4
  • Loading branch information
bastianallgeier authored Nov 24, 2023
2 parents b1d6619 + 379a82d commit 02eea26
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 15 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "The Kirby core",
"license": "proprietary",
"type": "kirby-cms",
"version": "4.0.0-rc.3",
"version": "4.0.0-rc.4",
"keywords": [
"kirby",
"cms",
Expand Down
2 changes: 1 addition & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion panel/dist/js/index.min.js

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions panel/src/helpers/string.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,16 @@ export function rtrim(string = "", replace = "") {
* Convert string to ASCII slug
* @param {string} string string to be converted
* @param {array} rules ruleset to convert non-ASCII characters
* @param {array} allowed list of allowed characters (default: a-z0-9)
* @param {string} separator character used to replace non-allowed characters
* @param {array} allowed list of allowed non-ASCII characters
* @param {string} separator character used to replace e.g. spaces
* @returns {string}
*/
export function slug(string, rules = [], allowed = "a-z0-9", separator = "-") {
export function slug(string, rules = [], allowed = "", separator = "-") {
if (!string) {
return "";
}

allowed = "a-z0-9" + allowed;
string = string.trim().toLowerCase();

// replace according to language and ascii rules
Expand All @@ -188,7 +189,7 @@ export function slug(string, rules = [], allowed = "a-z0-9", separator = "-") {
// remove all other non-ASCII characters
string = string.replace("/[^\x09\x0A\x0D\x20-\x7E]/", "");

// replace non-allowed characters (e.g. spaces) with separator
// replace spaces with simple dashes
string = string.replace(new RegExp("[^" + allowed + "]", "ig"), separator);

// remove double separators
Expand Down
2 changes: 1 addition & 1 deletion panel/src/helpers/string.slug.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe.concurrent("$helper.string.slug()", () => {
});

it("should replace slashes with custom separator", () => {
const result = slug("a/b/c", [], undefined, "%");
const result = slug("a/b/c", [], [], "%");
expect(result).toBe("a%b%c");
});

Expand Down
2 changes: 0 additions & 2 deletions src/Panel/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use Kirby\Form\Form;
use Kirby\Http\Router;
use Kirby\Toolkit\I18n;
use Kirby\Toolkit\Str;

/**
* Provides common field prop definitions
Expand Down Expand Up @@ -223,7 +222,6 @@ public static function slug(array $props = []): array
return array_merge([
'label' => I18n::translate('slug'),
'type' => 'slug',
'allow' => Str::$defaults['slug']['allowed']
], $props);
}

Expand Down
1 change: 0 additions & 1 deletion tests/Panel/FieldTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,6 @@ public function testSlug(): void
$expected = [
'label' => 'URL appendix',
'type' => 'slug',
'allow' => 'a-z0-9'
];

$this->assertSame($expected, $field);
Expand Down
8 changes: 4 additions & 4 deletions vendor/composer/installed.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php return array(
'root' => array(
'name' => 'getkirby/cms',
'pretty_version' => '4.0.0-rc.3',
'version' => '4.0.0.0-RC3',
'pretty_version' => '4.0.0-rc.4',
'version' => '4.0.0.0-RC4',
'reference' => NULL,
'type' => 'kirby-cms',
'install_path' => __DIR__ . '/../../',
Expand Down Expand Up @@ -47,8 +47,8 @@
'dev_requirement' => false,
),
'getkirby/cms' => array(
'pretty_version' => '4.0.0-rc.3',
'version' => '4.0.0.0-RC3',
'pretty_version' => '4.0.0-rc.4',
'version' => '4.0.0.0-RC4',
'reference' => NULL,
'type' => 'kirby-cms',
'install_path' => __DIR__ . '/../../',
Expand Down

0 comments on commit 02eea26

Please sign in to comment.