Skip to content

Commit

Permalink
Merge pull request #6566 from getkirby/v5/fix/6232-uuid-cache-case-in…
Browse files Browse the repository at this point in the history
…sensitive

UUIDs: case-insensitive IDs
  • Loading branch information
distantnative authored Jul 24, 2024
2 parents 93e92a1 + 288daf2 commit d9e912e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Uuid/Uuid.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ final public static function generate(int $length = 16): string
return Str::uuid();
}

return Str::random($length, 'alphaNum');
return Str::lower(Str::random($length, 'alphaNum'));
}

/**
Expand Down
2 changes: 2 additions & 0 deletions tests/Uuid/UuidTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,12 @@ public function testGenerate()
// default length
$id = Uuid::generate();
$this->assertSame(16, strlen($id));
$this->assertSame($id, strtolower($id));

// custom length
$id = Uuid::generate(5);
$this->assertSame(5, strlen($id));
$this->assertSame($id, strtolower($id));

// UUID v4 mode
$this->app->clone([
Expand Down

0 comments on commit d9e912e

Please sign in to comment.