Skip to content

Commit

Permalink
Merge pull request #6131 from getkirby/release/4.0.3
Browse files Browse the repository at this point in the history
4.0.3
  • Loading branch information
bastianallgeier authored Jan 10, 2024
2 parents ba8e9e5 + 07ee0da commit a537a4d
Show file tree
Hide file tree
Showing 17 changed files with 628 additions and 603 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.2",
"version": "4.0.3",
"keywords": [
"kirby",
"cms",
Expand Down
4 changes: 2 additions & 2 deletions 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 i18n/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"error.file.changeName.empty": "Bitte gib einen Namen an",
"error.file.changeName.permission": "Du darfst den Dateinamen von \"{filename}\" nicht ändern",
"error.file.changeTemplate.invalid": "Die Vorlage für die Datei \"{id}\" kann nicht zu \"{template}\" geändert werden (gültig: \"{blueprints}\")",
"error.file.changeTemplate.permission": "Du kannst die Voralge für die Datei \"{id}\" nicht ändern",
"error.file.changeTemplate.permission": "Du kannst die Vorlage für die Datei \"{id}\" nicht ändern",

"error.file.duplicate": "Eine Datei mit dem Dateinamen \"{filename}\" besteht bereits",
"error.file.extension.forbidden": "Verbotene Dateiendung \"{extension}\"",
Expand Down
2 changes: 1 addition & 1 deletion i18n/translations/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@
"page.changeStatus.select": "Seleziona un nuovo stato",
"page.changeTemplate": "Cambia template",
"page.changeTemplate.notice": "Changing the page's template will remove content for fields that don't match in type. Use with caution.",
"page.create": "Create as {status}",
"page.create": "Crea come \"{status}\"",
"page.delete.confirm": "Sei sicuro di voler eliminare questa pagina?",
"page.delete.confirm.subpages": "<strong>Questa pagina ha sottopagine</strong>. <br>Anche tutte le sottopagine verranno eliminate.",
"page.delete.confirm.title": "Inserisci il titolo della pagina per confermare",
Expand Down
304 changes: 152 additions & 152 deletions i18n/translations/pt_BR.json

Large diffs are not rendered by default.

760 changes: 380 additions & 380 deletions i18n/translations/pt_PT.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions i18n/translations/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@

"error.license.domain": "Lisans için alan adı eksik",
"error.license.email": "Lütfen geçerli bir e-posta adresi girin",
"error.license.format": "Please enter a valid license code",
"error.license.format": "Lütfen geçerli bir lisans anahtarı girin",
"error.license.verification": "Lisans doğrulanamadı",

"error.login.totp.confirm.invalid": "Geçersiz kod",
Expand Down Expand Up @@ -425,7 +425,7 @@
"license.code.label": "Lütfen lisans kodunu giriniz",
"license.status.active.info": "{date} tarihine kadar yeni ana sürümleri içerir",
"license.status.active.label": "Geçerli lisans",
"license.status.demo.info": "This is a demo installation",
"license.status.demo.info": "Bu bir demo kurulumudur",
"license.status.demo.label": "Demo",
"license.status.inactive.info": "Yeni ana sürümlere güncellemek için lisansı yenileyin",
"license.status.inactive.label": "Yeni ana sürüm yok",
Expand Down
2 changes: 0 additions & 2 deletions src/Cms/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,6 @@ public function contentToken(mixed $model, string $value): string
/**
* Calls a page controller by name
* and with the given arguments
*
* @internal
*/
public function controller(
string $name,
Expand Down
2 changes: 1 addition & 1 deletion src/Cms/License.php
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ public function request(string $path, array $data): array
*/
public function save(): bool
{
if ($this->status() !== LicenseStatus::Active) {
if ($this->status()->activatable() !== true) {
throw new InvalidArgumentException([
'key' => 'license.verification'
]);
Expand Down
18 changes: 17 additions & 1 deletion src/Cms/LicenseStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,22 @@ enum LicenseStatus: string
*/
case Missing = 'missing';

/**
* Checks if the license can be saved when it
* was entered in the activation dialog;
* renewable licenses are accepted as well
* to allow renewal from the Panel
*/
public function activatable(): bool
{
return match ($this) {
static::Active,
static::Inactive,
static::Legacy => true,
default => false
};
}

/**
* Returns the dialog according to the status
*/
Expand Down Expand Up @@ -95,7 +111,7 @@ public function label(): string
public function renewable(): bool
{
return match ($this) {
static::Demo => false,
static::Demo,
static::Active => false,
default => true
};
Expand Down
4 changes: 4 additions & 0 deletions src/Http/Environment.php
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,10 @@ public function isLocal(): bool
return true;
}

if (Str::endsWith($host, '.ddev.site') === true) {
return true;
}

// collect all possible visitor ips
$ips = [
$this->get('REMOTE_ADDR'),
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Url.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public static function short(
$uri->slash = false;

$url = $base ? $uri->base() : $uri->toString();
$url = str_replace('www.', '', $url);
$url = str_replace('www.', '', $url ?? '');

return Str::short($url, $length, $rep);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Cms/System/LicenseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ public function testRenewal()
/**
* @covers ::save
*/
public function testSaveWhenNotActive()
public function testSaveWhenNotActivatable()
{
$license = new License();

Expand Down
1 change: 1 addition & 0 deletions tests/Http/EnvironmentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1050,6 +1050,7 @@ public function providerForServerNames()
['localhost', true],
['mydomain.local', true],
['mydomain.test', true],
['mydomain.ddev.site', true],
['mydomain.com', false],
['mydomain.dev', false],
];
Expand Down
18 changes: 9 additions & 9 deletions tests/Option/OptionsApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class OptionsApiTest extends TestCase
*/
public function testConstruct()
{
$options = new OptionsApi($url = 'https://api.getkirby.com');
$options = new OptionsApi($url = 'https://api.example.com');
$this->assertSame($url, $options->url);
$this->assertNull($options->query);
$this->assertNull($options->text);
Expand All @@ -28,7 +28,7 @@ public function testConstruct()
*/
public function testDefaults()
{
$options = new OptionsApi($url = 'https://api.getkirby.com');
$options = new OptionsApi($url = 'https://api.example.com');
$this->assertSame($url, $options->url);
$this->assertNull($options->text);
$this->assertNull($options->value);
Expand All @@ -46,7 +46,7 @@ public function testDefaults()
public function testFactory()
{
$options = OptionsApi::factory([
'url' => $url = 'https://api.getkirby.com',
'url' => $url = 'https://api.example.com',
'query' => $query = 'Companies',
'text' => $text = '{{ item.name }}',
'value' => $value = '{{ item.id }}',
Expand All @@ -57,7 +57,7 @@ public function testFactory()
$this->assertSame($text, $options->text);
$this->assertSame($value, $options->value);

$options = OptionsApi::factory($url = 'https://api.getkirby.com');
$options = OptionsApi::factory($url = 'https://api.example.com');
$this->assertSame($url, $options->url);
$this->assertNull($options->query);
$this->assertNull($options->text);
Expand All @@ -67,12 +67,12 @@ public function testFactory()
/**
* @covers ::load
*/
public function testLoadNotFound()
public function testLoadNoJson()
{
$model = new Page(['slug' => 'test']);
$options = new OptionsApi(url: 'https://api.getkirby.com');
$options = new OptionsApi(url: 'https://example.com');
$this->expectException(NotFoundException::class);
$this->expectExceptionMessage('Options could not be loaded from API: https://api.getkirby.com');
$this->expectExceptionMessage('Options could not be loaded from API: https://example.com');
$options->resolve($model);
}

Expand All @@ -81,10 +81,10 @@ public function testLoadNotFound()
*/
public function testPolyfill()
{
$api = 'https//api.getkirby.com';
$api = 'https://api.example.com';
$this->assertSame(['url' => $api], OptionsApi::polyfill($api));

$api = ['url' => 'https//api.getkirby.com'];
$api = ['url' => 'https://api.example.com'];
$this->assertSame($api, OptionsApi::polyfill($api));

$api = ['fetch' => 'Companies'];
Expand Down
Loading

0 comments on commit a537a4d

Please sign in to comment.