3.0
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "getkirby/cms",
|
||||
"description": "The Kirby 3 core",
|
||||
"version": "3.0.0-RC-6.0",
|
||||
"version": "3.0.0",
|
||||
"license": "proprietary",
|
||||
"keywords": ["kirby", "cms", "core"],
|
||||
"homepage": "https://getkirby.com",
|
||||
|
2
kirby/composer.lock
generated
2
kirby/composer.lock
generated
@@ -4,7 +4,7 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "795a9baff274c8a85cd3670e696e6331",
|
||||
"content-hash": "fccb729b1a9f9683c43cc376216e49cf",
|
||||
"packages": [
|
||||
{
|
||||
"name": "claviska/simpleimage",
|
||||
|
@@ -35,6 +35,7 @@ return [
|
||||
$long = $this->requestBody('long');
|
||||
$password = $this->requestBody('password');
|
||||
|
||||
try {
|
||||
if ($user = $this->kirby()->auth()->login($email, $password, $long)) {
|
||||
return [
|
||||
'code' => 200,
|
||||
@@ -42,6 +43,9 @@ return [
|
||||
'user' => $this->resolve($user)->view('auth')->toArray()
|
||||
];
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
// catch any kind of login error
|
||||
}
|
||||
|
||||
throw new InvalidArgumentException('Invalid email or password');
|
||||
}
|
||||
|
@@ -97,7 +97,13 @@ function css($url, $options = null)
|
||||
$url = $component($kirby, $url, $options);
|
||||
}
|
||||
|
||||
$url = $url === '@auto' ? Url::toTemplateAsset('css/templates', 'css') : Url::to($url);
|
||||
if ($url === '@auto') {
|
||||
if (!$url = Url::toTemplateAsset('css/templates', 'css')) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
$url = Url::to($url);
|
||||
$attr = array_merge((array)$options, [
|
||||
'href' => $url,
|
||||
'rel' => 'stylesheet'
|
||||
@@ -345,7 +351,13 @@ function js($url, $options = null)
|
||||
$url = $component($kirby, $url, $options);
|
||||
}
|
||||
|
||||
$url = $url === '@auto' ? Url::toTemplateAsset('js/templates', 'js') : Url::to($url);
|
||||
if ($url === '@auto') {
|
||||
if (!$url = Url::toTemplateAsset('js/templates', 'js')) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
$url = Url::to($url);
|
||||
$attr = array_merge((array)$options, ['src' => $url]);
|
||||
|
||||
return '<script ' . attr($attr) . '></script>';
|
||||
|
@@ -42,4 +42,24 @@ class Url extends BaseUrl
|
||||
|
||||
return file_exists($file) === true ? $url : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Smart resolver for internal and external urls
|
||||
*
|
||||
* @param string $path
|
||||
* @param array $options
|
||||
* @return string
|
||||
*/
|
||||
public static function to(string $path = null, array $options = null): string
|
||||
{
|
||||
$kirby = App::instance();
|
||||
|
||||
if ($handler = $kirby->component('url')) {
|
||||
return $handler($kirby, $path, $options, function (string $path = null, array $options = null) {
|
||||
return parent::to($path, $options);
|
||||
});
|
||||
}
|
||||
|
||||
return parent::to($path, $options);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user