Skip to content

Commit 0cb9f33

Browse files
committed
Finish fix
1 parent 43beea2 commit 0cb9f33

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

system/Common.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,11 +1015,13 @@ function slash_item(string $item): ?string
10151015
{
10161016
$config = config(App::class);
10171017

1018+
$configItem = '';
1019+
10181020
if (property_exists($config, $item)) {
1019-
$configItem = $config->{$item};
1021+
$configItem = (string) $config->{$item};
10201022
}
10211023

1022-
if (! isset($configItem) || empty(trim($configItem))) {
1024+
if (trim($configItem) === '') {
10231025
return null;
10241026
}
10251027

tests/system/CommonFunctionsTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -390,9 +390,9 @@ public function testReallyWritable()
390390

391391
public function testSlashItem()
392392
{
393-
$this->assertSame('/', slash_item('cookiePath')); // slash already there
394-
$this->assertNull(null, slash_item('cookieDomain')); // empty, so untouched
395-
$this->assertSame('en/', slash_item('defaultLocale')); // slash appended
393+
$this->assertSame('/', slash_item('cookiePath'));
394+
$this->assertNull(slash_item('cookieDomain'));
395+
$this->assertSame('en/', slash_item('defaultLocale'));
396396
}
397397

398398
protected function injectSessionMock()

0 commit comments

Comments
 (0)