Skip to content

Commit

Permalink
Upgrade to 3.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
bastianallgeier committed Jan 19, 2021
1 parent 1ee3af8 commit 8ce6dbd
Show file tree
Hide file tree
Showing 119 changed files with 2,959 additions and 3,693 deletions.
71 changes: 47 additions & 24 deletions kirby/composer.json
Original file line number Diff line number Diff line change
@@ -1,54 +1,77 @@
{
"name": "getkirby/cms",
"type": "kirby-cms",
"description": "The Kirby 3 core",
"version": "3.5.0",
"license": "proprietary",
"keywords": ["kirby", "cms", "core"],
"keywords": [
"kirby",
"cms",
"core"
],
"homepage": "https://getkirby.com",
"type": "kirby-cms",
"version": "3.5.1",
"license": "proprietary",
"authors": [
{
"name": "Kirby Team",
"email": "support@getkirby.com",
"homepage": "https://getkirby.com"
}
],
"support": {
"email": "support@getkirby.com",
"issues": "https://github.com/getkirby/kirby/issues",
"forum": "https://forum.getkirby.com",
"source": "https://github.com/getkirby/kirby"
},
"require": {
"php": ">=7.3.0 <8.1.0",
"ext-mbstring": "*",
"ext-ctype": "*",
"ext-mbstring": "*",
"claviska/simpleimage": "3.5.1",
"filp/whoops": "2.9.1",
"getkirby/composer-installer": "^1.2.0",
"mustangostang/spyc": "0.6.3",
"laminas/laminas-escaper": "2.7.0",
"michelf/php-smartypants": "1.8.1",
"claviska/simpleimage": "3.5.1",
"mustangostang/spyc": "0.6.3",
"phpmailer/phpmailer": "6.2.0",
"filp/whoops": "2.9.1",
"true/punycode": "2.1.1",
"laminas/laminas-escaper": "2.7.0"
"true/punycode": "2.1.1"
},
"config": {
"optimize-autoloader": true,
"platform-check": false
},
"autoload": {
"files": ["config/setup.php"],
"classmap": ["dependencies/"],
"psr-4": {
"Kirby\\": "src/"
}
},
"classmap": [
"dependencies/"
],
"files": [
"config/setup.php",
"config/helpers.php"
]
},
"scripts": {
"analyze": "phpstan analyse",
"post-update-cmd": "curl -o cacert.pem https://curl.haxx.se/ca/cacert.pem",
"analyze": [
"@analyze:composer",
"@analyze:psalm",
"@analyze:phpcpd",
"@analyze:phpmd"
],
"analyze:composer": "composer validate --strict --no-check-version --no-check-all",
"analyze:phpcpd": "phpcpd --fuzzy --exclude tests --exclude vendor .",
"analyze:phpmd": "phpmd . ansi phpmd.xml.dist --exclude 'dependencies/*,tests/*,vendor/*'",
"analyze:psalm": "psalm",
"build": "./scripts/build",
"ci": [
"@fix",
"@analyze",
"@test"
],
"fix": "php-cs-fixer fix --config .php_cs",
"post-update-cmd": "curl -o cacert.pem https://curl.haxx.se/ca/cacert.pem",
"test": "phpunit --stderr --coverage-html=tests/coverage",
"zip": "composer archive --format=zip --file=dist"
},
"config": {
"optimize-autoloader": true,
"platform-check": false
"support": {
"email": "support@getkirby.com",
"issues": "https://github.com/getkirby/kirby/issues",
"forum": "https://forum.getkirby.com",
"source": "https://github.com/getkirby/kirby"
}
}
41 changes: 23 additions & 18 deletions kirby/composer.lock

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

31 changes: 15 additions & 16 deletions kirby/config/api/models/System.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@
'ascii' => function () {
return Str::$ascii;
},
'authStatus' => function () {
return $this->kirby()->auth()->status()->toArray();
},
'defaultLanguage' => function () {
return $this->kirby()->option('panel.language', 'en');
return $this->kirby()->panelLanguage();
},
'isOk' => function (System $system) {
return $system->isOk();
Expand All @@ -35,20 +38,16 @@
'license' => function (System $system) {
return $system->license();
},
'loginMethods' => function (System $system) {
return array_keys($system->loginMethods());
},
'pendingChallenge' => function () {
if ($this->session()->get('kirby.challenge.email') === null) {
return null;
'locales' => function () {
$locales = [];
$translations = $this->kirby()->translations();
foreach ($translations as $translation) {
$locales[$translation->code()] = $translation->locale();
}

// fake the email challenge if no challenge was created
// to avoid leaking whether the user exists
return $this->session()->get('kirby.challenge.type', 'email');
return $locales;
},
'pendingEmail' => function () {
return $this->session()->get('kirby.challenge.email');
'loginMethods' => function (System $system) {
return array_keys($system->loginMethods());
},
'requirements' => function (System $system) {
return $system->toArray();
Expand All @@ -70,7 +69,7 @@
if ($user = $this->user()) {
$translationCode = $user->language();
} else {
$translationCode = $this->kirby()->option('panel.language', 'en');
$translationCode = $this->kirby()->panelLanguage();
}

if ($translation = $this->kirby()->translation($translationCode)) {
Expand Down Expand Up @@ -98,12 +97,11 @@
'type' => 'Kirby\Cms\System',
'views' => [
'login' => [
'authStatus',
'isOk',
'isInstallable',
'isInstalled',
'loginMethods',
'pendingChallenge',
'pendingEmail',
'title',
'translation'
],
Expand All @@ -124,6 +122,7 @@
'kirbytext',
'languages',
'license',
'locales',
'multilang',
'requirements',
'site',
Expand Down
12 changes: 5 additions & 7 deletions kirby/config/api/routes/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
isset($methods['password']['2fa']) === true &&
$methods['password']['2fa'] === true
) {
$challenge = $auth->login2fa($email, $password, $long);
$status = $auth->login2fa($email, $password, $long);
} else {
$user = $auth->login($email, $password, $long);
}
Expand All @@ -78,7 +78,7 @@
throw new InvalidArgumentException('Login without password is not enabled');
}

$challenge = $auth->createChallenge($email, $long, $mode);
$status = $auth->createChallenge($email, $long, $mode);
}

if (isset($user)) {
Expand All @@ -89,11 +89,9 @@
];
} else {
return [
'code' => 200,
'status' => 'ok',

// don't leak users that don't exist at this point
'challenge' => $challenge ?? 'email'
'code' => 200,
'status' => 'ok',
'challenge' => $status->challenge()
];
}
}
Expand Down
1 change: 1 addition & 0 deletions kirby/config/blocks/code/code.php
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
<?php /** @var \Kirby\Cms\Block $block */ ?>
<pre><code class="language-<?= $block->language()->or('text') ?>"><?= $block->code()->html(false) ?></code></pre>
1 change: 1 addition & 0 deletions kirby/config/blocks/gallery/gallery.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?php /** @var \Kirby\Cms\Block $block */ ?>
<figure>
<ul>
<?php foreach ($block->images()->toFiles() as $image): ?>
Expand Down
1 change: 1 addition & 0 deletions kirby/config/blocks/heading/heading.php
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
<?php /** @var \Kirby\Cms\Block $block */ ?>
<<?= $level = $block->level()->or('h2') ?>><?= $block->text() ?></<?= $level ?>>
1 change: 1 addition & 0 deletions kirby/config/blocks/image/image.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php

/** @var \Kirby\Cms\Block $block */
$alt = $block->alt();
$caption = $block->caption();
$crop = $block->crop()->isTrue();
Expand Down
1 change: 1 addition & 0 deletions kirby/config/blocks/list/list.php
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
<?php /** @var \Kirby\Cms\Block $block */ ?>
<?= $block->text();
1 change: 1 addition & 0 deletions kirby/config/blocks/markdown/markdown.php
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
<?php /** @var \Kirby\Cms\Block $block */ ?>
<?= $block->text()->kt();
1 change: 1 addition & 0 deletions kirby/config/blocks/quote/quote.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?php /** @var \Kirby\Cms\Block $block */ ?>
<blockquote>
<?= $block->text() ?>
<?php if ($block->citation()->isNotEmpty()): ?>
Expand Down
1 change: 1 addition & 0 deletions kirby/config/blocks/text/text.php
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
<?php /** @var \Kirby\Cms\Block $block */ ?>
<?= $block->text();
1 change: 1 addition & 0 deletions kirby/config/blocks/video/video.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?php /** @var \Kirby\Cms\Block $block */ ?>
<?php if ($block->url()->isNotEmpty()): ?>
<figure>
<?= video($block->url()) ?>
Expand Down
7 changes: 3 additions & 4 deletions kirby/config/fields/date.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@
return Str::upper($this->display);
}
},
'format' => function () {
return $this->props['format'] ?? ($this->time === false ? 'Y-m-d' : 'Y-m-d H:i:s');
},
'time' => function () {
if ($this->time === false) {
return false;
Expand All @@ -127,10 +130,6 @@
return $this->toDatetime($this->value);
},
],
'save' => function ($value) {
$format = $this->time === false ? 'Y-m-d' : 'Y-m-d H:i:s';
return $this->toContent($value, $format);
},
'validations' => [
'date',
'minMax' => function ($value) {
Expand Down
Loading

0 comments on commit 8ce6dbd

Please sign in to comment.