Update to Kirby 3.7.5
This commit is contained in:
@@ -12,7 +12,6 @@ if (
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (is_file($autoloader = dirname(__DIR__) . '/vendor/autoload.php')) {
|
if (is_file($autoloader = dirname(__DIR__) . '/vendor/autoload.php')) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Always prefer a site-wide Composer autoloader
|
* Always prefer a site-wide Composer autoloader
|
||||||
* if it exists, it means that the user has probably
|
* if it exists, it means that the user has probably
|
||||||
@@ -20,13 +19,11 @@ if (is_file($autoloader = dirname(__DIR__) . '/vendor/autoload.php')) {
|
|||||||
*/
|
*/
|
||||||
include $autoloader;
|
include $autoloader;
|
||||||
} elseif (is_file($autoloader = __DIR__ . '/vendor/autoload.php')) {
|
} elseif (is_file($autoloader = __DIR__ . '/vendor/autoload.php')) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fall back to the local autoloader if that exists
|
* Fall back to the local autoloader if that exists
|
||||||
*/
|
*/
|
||||||
include $autoloader;
|
include $autoloader;
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If neither one exists, don't bother searching;
|
* If neither one exists, don't bother searching;
|
||||||
* it's a custom directory setup and the users need to
|
* it's a custom directory setup and the users need to
|
||||||
|
@@ -3,7 +3,7 @@
|
|||||||
"description": "The Kirby 3 core",
|
"description": "The Kirby 3 core",
|
||||||
"license": "proprietary",
|
"license": "proprietary",
|
||||||
"type": "kirby-cms",
|
"type": "kirby-cms",
|
||||||
"version": "3.7.4",
|
"version": "3.7.5",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"kirby",
|
"kirby",
|
||||||
"cms",
|
"cms",
|
||||||
@@ -36,12 +36,12 @@
|
|||||||
"ext-libxml": "*",
|
"ext-libxml": "*",
|
||||||
"ext-mbstring": "*",
|
"ext-mbstring": "*",
|
||||||
"ext-openssl": "*",
|
"ext-openssl": "*",
|
||||||
"claviska/simpleimage": "3.6.5",
|
"claviska/simpleimage": "3.7.0",
|
||||||
"filp/whoops": "2.14.5",
|
"filp/whoops": "2.14.5",
|
||||||
"getkirby/composer-installer": "^1.2.1",
|
"getkirby/composer-installer": "^1.2.1",
|
||||||
"laminas/laminas-escaper": "2.10.0",
|
"laminas/laminas-escaper": "2.10.0",
|
||||||
"michelf/php-smartypants": "1.8.1",
|
"michelf/php-smartypants": "1.8.1",
|
||||||
"phpmailer/phpmailer": "6.6.3",
|
"phpmailer/phpmailer": "6.6.4",
|
||||||
"symfony/polyfill-intl-idn": "1.26.0",
|
"symfony/polyfill-intl-idn": "1.26.0",
|
||||||
"symfony/polyfill-mbstring": "1.26.0"
|
"symfony/polyfill-mbstring": "1.26.0"
|
||||||
},
|
},
|
||||||
|
26
kirby/composer.lock
generated
26
kirby/composer.lock
generated
@@ -4,20 +4,20 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "6bfdbfb7a38bb3e59ed5ce26db82cbb7",
|
"content-hash": "fb087946fb5ac5910e25a4d263905d99",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "claviska/simpleimage",
|
"name": "claviska/simpleimage",
|
||||||
"version": "3.6.5",
|
"version": "3.7.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/claviska/SimpleImage.git",
|
"url": "https://github.com/claviska/SimpleImage.git",
|
||||||
"reference": "00f90662686696b9b7157dbb176183aabe89700f"
|
"reference": "abd15ced313c7b8041d7d73d8d2398b4f2510cf1"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/claviska/SimpleImage/zipball/00f90662686696b9b7157dbb176183aabe89700f",
|
"url": "https://api.github.com/repos/claviska/SimpleImage/zipball/abd15ced313c7b8041d7d73d8d2398b4f2510cf1",
|
||||||
"reference": "00f90662686696b9b7157dbb176183aabe89700f",
|
"reference": "abd15ced313c7b8041d7d73d8d2398b4f2510cf1",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
"description": "A PHP class that makes working with images as simple as possible.",
|
"description": "A PHP class that makes working with images as simple as possible.",
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/claviska/SimpleImage/issues",
|
"issues": "https://github.com/claviska/SimpleImage/issues",
|
||||||
"source": "https://github.com/claviska/SimpleImage/tree/3.6.5"
|
"source": "https://github.com/claviska/SimpleImage/tree/3.7.0"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2021-12-01T12:42:55+00:00"
|
"time": "2022-07-05T13:18:44+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "filp/whoops",
|
"name": "filp/whoops",
|
||||||
@@ -349,16 +349,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpmailer/phpmailer",
|
"name": "phpmailer/phpmailer",
|
||||||
"version": "v6.6.3",
|
"version": "v6.6.4",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/PHPMailer/PHPMailer.git",
|
"url": "https://github.com/PHPMailer/PHPMailer.git",
|
||||||
"reference": "9400f305a898f194caff5521f64e5dfa926626f3"
|
"reference": "a94fdebaea6bd17f51be0c2373ab80d3d681269b"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/9400f305a898f194caff5521f64e5dfa926626f3",
|
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/a94fdebaea6bd17f51be0c2373ab80d3d681269b",
|
||||||
"reference": "9400f305a898f194caff5521f64e5dfa926626f3",
|
"reference": "a94fdebaea6bd17f51be0c2373ab80d3d681269b",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -415,7 +415,7 @@
|
|||||||
"description": "PHPMailer is a full-featured email creation and transfer class for PHP",
|
"description": "PHPMailer is a full-featured email creation and transfer class for PHP",
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/PHPMailer/PHPMailer/issues",
|
"issues": "https://github.com/PHPMailer/PHPMailer/issues",
|
||||||
"source": "https://github.com/PHPMailer/PHPMailer/tree/v6.6.3"
|
"source": "https://github.com/PHPMailer/PHPMailer/tree/v6.6.4"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -423,7 +423,7 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2022-06-20T09:21:02+00:00"
|
"time": "2022-08-22T09:22:00+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "psr/log",
|
"name": "psr/log",
|
||||||
|
@@ -101,7 +101,6 @@ return [
|
|||||||
|
|
||||||
// check if the thumb already exists
|
// check if the thumb already exists
|
||||||
if (file_exists($thumbRoot) === false) {
|
if (file_exists($thumbRoot) === false) {
|
||||||
|
|
||||||
// if not, create job file
|
// if not, create job file
|
||||||
$job = $mediaRoot . '/.jobs/' . $thumbName . '.json';
|
$job = $mediaRoot . '/.jobs/' . $thumbName . '.json';
|
||||||
|
|
||||||
|
@@ -110,7 +110,6 @@ return [
|
|||||||
|
|
||||||
if (empty($this->columns)) {
|
if (empty($this->columns)) {
|
||||||
foreach ($this->fields as $field) {
|
foreach ($this->fields as $field) {
|
||||||
|
|
||||||
// Skip hidden and unsaveable fields
|
// Skip hidden and unsaveable fields
|
||||||
// They should never be included as column
|
// They should never be included as column
|
||||||
if ($field['type'] === 'hidden' || $field['saveable'] === false) {
|
if ($field['type'] === 'hidden' || $field['saveable'] === false) {
|
||||||
|
@@ -71,7 +71,6 @@ return [
|
|||||||
|
|
||||||
// transform into value-text objects
|
// transform into value-text objects
|
||||||
return array_map(function ($option) use ($options) {
|
return array_map(function ($option) use ($options) {
|
||||||
|
|
||||||
// already a valid object
|
// already a valid object
|
||||||
if (is_array($option) === true && isset($option['value'], $option['text']) === true) {
|
if (is_array($option) === true && isset($option['value'], $option['text']) === true) {
|
||||||
return $option;
|
return $option;
|
||||||
|
@@ -10,6 +10,7 @@ return [
|
|||||||
*/
|
*/
|
||||||
'converter' => null,
|
'converter' => null,
|
||||||
'counter' => null,
|
'counter' => null,
|
||||||
|
'pattern' => null,
|
||||||
'spellcheck' => null,
|
'spellcheck' => null,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -3,7 +3,6 @@
|
|||||||
use Kirby\Toolkit\I18n;
|
use Kirby\Toolkit\I18n;
|
||||||
|
|
||||||
return function (array $props) {
|
return function (array $props) {
|
||||||
|
|
||||||
// load the general templates setting for all sections
|
// load the general templates setting for all sections
|
||||||
$templates = $props['templates'] ?? null;
|
$templates = $props['templates'] ?? null;
|
||||||
|
|
||||||
|
@@ -107,7 +107,6 @@ return function ($kirby) {
|
|||||||
if ($kirby->multilang() === true) {
|
if ($kirby->multilang() === true) {
|
||||||
$after = LanguageRoutes::create($kirby);
|
$after = LanguageRoutes::create($kirby);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// Single-language home
|
// Single-language home
|
||||||
$after[] = [
|
$after[] = [
|
||||||
'pattern' => '',
|
'pattern' => '',
|
||||||
|
@@ -214,7 +214,6 @@ return [
|
|||||||
'title'
|
'title'
|
||||||
],
|
],
|
||||||
'html' => function ($tag) {
|
'html' => function ($tag) {
|
||||||
|
|
||||||
// get and sanitize the username
|
// get and sanitize the username
|
||||||
$username = str_replace('@', '', $tag->value);
|
$username = str_replace('@', '', $tag->value);
|
||||||
|
|
||||||
@@ -246,6 +245,7 @@ return [
|
|||||||
'height',
|
'height',
|
||||||
'loop',
|
'loop',
|
||||||
'muted',
|
'muted',
|
||||||
|
'playsinline',
|
||||||
'poster',
|
'poster',
|
||||||
'preload',
|
'preload',
|
||||||
'style',
|
'style',
|
||||||
@@ -288,12 +288,13 @@ return [
|
|||||||
// booleans: autoplay, controls, loop, muted
|
// booleans: autoplay, controls, loop, muted
|
||||||
// strings : poster, preload
|
// strings : poster, preload
|
||||||
// for ex : `autoplay` will not work if `false` is a `string` instead of a `boolean`
|
// for ex : `autoplay` will not work if `false` is a `string` instead of a `boolean`
|
||||||
$attrs['autoplay'] = $autoplay = Str::toType($tag->autoplay, 'bool');
|
$attrs['autoplay'] = $autoplay = Str::toType($tag->autoplay, 'bool');
|
||||||
$attrs['controls'] = Str::toType($tag->controls ?? true, 'bool');
|
$attrs['controls'] = Str::toType($tag->controls ?? true, 'bool');
|
||||||
$attrs['loop'] = Str::toType($tag->loop, 'bool');
|
$attrs['loop'] = Str::toType($tag->loop, 'bool');
|
||||||
$attrs['muted'] = Str::toType($tag->muted ?? $autoplay, 'bool');
|
$attrs['muted'] = Str::toType($tag->muted ?? $autoplay, 'bool');
|
||||||
$attrs['poster'] = $tag->poster;
|
$attrs['playsinline'] = Str::toType($tag->playsinline ?? $autoplay, 'bool');
|
||||||
$attrs['preload'] = $tag->preload;
|
$attrs['poster'] = $tag->poster;
|
||||||
|
$attrs['preload'] = $tag->preload;
|
||||||
}
|
}
|
||||||
|
|
||||||
// handles local and remote video file
|
// handles local and remote video file
|
||||||
|
4
kirby/panel/dist/js/vendor.js
vendored
4
kirby/panel/dist/js/vendor.js
vendored
File diff suppressed because one or more lines are too long
@@ -75,24 +75,24 @@ class FileCache extends Cache
|
|||||||
$keyParts = [];
|
$keyParts = [];
|
||||||
foreach (preg_split('#([\/\\\\])#', $key, 0, PREG_SPLIT_DELIM_CAPTURE) as $part) {
|
foreach (preg_split('#([\/\\\\])#', $key, 0, PREG_SPLIT_DELIM_CAPTURE) as $part) {
|
||||||
switch ($part) {
|
switch ($part) {
|
||||||
// forward slashes don't need special treatment
|
|
||||||
case '/':
|
case '/':
|
||||||
|
// forward slashes don't need special treatment
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// backslashes get their own marker in the path
|
|
||||||
// to differentiate the cache key from one with forward slashes
|
|
||||||
case '\\':
|
case '\\':
|
||||||
|
// backslashes get their own marker in the path
|
||||||
|
// to differentiate the cache key from one with forward slashes
|
||||||
$keyParts[] = '_backslash';
|
$keyParts[] = '_backslash';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// empty part means two slashes in a row;
|
|
||||||
// special marker like for backslashes
|
|
||||||
case '':
|
case '':
|
||||||
|
// empty part means two slashes in a row;
|
||||||
|
// special marker like for backslashes
|
||||||
$keyParts[] = '_empty';
|
$keyParts[] = '_empty';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// an actual path segment
|
|
||||||
default:
|
default:
|
||||||
|
// an actual path segment:
|
||||||
// check if the segment only contains safe characters;
|
// check if the segment only contains safe characters;
|
||||||
// underscores are *not* safe to guarantee uniqueness
|
// underscores are *not* safe to guarantee uniqueness
|
||||||
// as they are used in the special cases
|
// as they are used in the special cases
|
||||||
|
@@ -461,7 +461,6 @@ class App
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($contentType !== 'html') {
|
if ($contentType !== 'html') {
|
||||||
|
|
||||||
// no luck for a specific representation controller?
|
// no luck for a specific representation controller?
|
||||||
// let's try the html controller instead
|
// let's try the html controller instead
|
||||||
if ($controller = $this->controllerLookup($name)) {
|
if ($controller = $this->controllerLookup($name)) {
|
||||||
|
@@ -506,7 +506,6 @@ class Blueprint
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach ($fields as $fieldName => $fieldProps) {
|
foreach ($fields as $fieldName => $fieldProps) {
|
||||||
|
|
||||||
// extend field from string
|
// extend field from string
|
||||||
if (is_string($fieldProps) === true) {
|
if (is_string($fieldProps) === true) {
|
||||||
$fieldProps = [
|
$fieldProps = [
|
||||||
@@ -600,7 +599,6 @@ class Blueprint
|
|||||||
protected function normalizeSections(string $tabName, array $sections): array
|
protected function normalizeSections(string $tabName, array $sections): array
|
||||||
{
|
{
|
||||||
foreach ($sections as $sectionName => $sectionProps) {
|
foreach ($sections as $sectionName => $sectionProps) {
|
||||||
|
|
||||||
// unset / remove section if its property is false
|
// unset / remove section if its property is false
|
||||||
if ($sectionProps === false) {
|
if ($sectionProps === false) {
|
||||||
unset($sections[$sectionName]);
|
unset($sections[$sectionName]);
|
||||||
@@ -686,7 +684,6 @@ class Blueprint
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach ($tabs as $tabName => $tabProps) {
|
foreach ($tabs as $tabName => $tabProps) {
|
||||||
|
|
||||||
// unset / remove tab if its property is false
|
// unset / remove tab if its property is false
|
||||||
if ($tabProps === false) {
|
if ($tabProps === false) {
|
||||||
unset($tabs[$tabName]);
|
unset($tabs[$tabName]);
|
||||||
|
@@ -106,7 +106,6 @@ class Email
|
|||||||
protected function template(): void
|
protected function template(): void
|
||||||
{
|
{
|
||||||
if (isset($this->props['template']) === true) {
|
if (isset($this->props['template']) === true) {
|
||||||
|
|
||||||
// prepare data to be passed to template
|
// prepare data to be passed to template
|
||||||
$data = $this->props['data'] ?? [];
|
$data = $this->props['data'] ?? [];
|
||||||
|
|
||||||
@@ -123,7 +122,7 @@ class Email
|
|||||||
$this->props['body']['text'] = $text->render($data);
|
$this->props['body']['text'] = $text->render($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
// fallback to single email text template
|
// fallback to single email text template
|
||||||
} elseif ($text->exists()) {
|
} elseif ($text->exists()) {
|
||||||
$this->props['body'] = $text->render($data);
|
$this->props['body'] = $text->render($data);
|
||||||
} else {
|
} else {
|
||||||
|
@@ -194,7 +194,6 @@ trait FileActions
|
|||||||
|
|
||||||
// run the hook
|
// run the hook
|
||||||
return $file->commit('create', compact('file', 'upload'), function ($file, $upload) {
|
return $file->commit('create', compact('file', 'upload'), function ($file, $upload) {
|
||||||
|
|
||||||
// delete all public versions
|
// delete all public versions
|
||||||
$file->unpublish();
|
$file->unpublish();
|
||||||
|
|
||||||
@@ -230,7 +229,6 @@ trait FileActions
|
|||||||
public function delete(): bool
|
public function delete(): bool
|
||||||
{
|
{
|
||||||
return $this->commit('delete', ['file' => $this], function ($file) {
|
return $this->commit('delete', ['file' => $this], function ($file) {
|
||||||
|
|
||||||
// remove all versions in the media folder
|
// remove all versions in the media folder
|
||||||
$file->unpublish();
|
$file->unpublish();
|
||||||
|
|
||||||
@@ -289,7 +287,6 @@ trait FileActions
|
|||||||
];
|
];
|
||||||
|
|
||||||
return $this->commit('replace', $arguments, function ($file, $upload) {
|
return $this->commit('replace', $arguments, function ($file, $upload) {
|
||||||
|
|
||||||
// delete all public versions
|
// delete all public versions
|
||||||
$file->unpublish();
|
$file->unpublish();
|
||||||
|
|
||||||
|
@@ -60,7 +60,6 @@ class LanguageRouter
|
|||||||
|
|
||||||
// only keep the scoped language routes
|
// only keep the scoped language routes
|
||||||
$routes = array_values(array_filter($routes, function ($route) use ($language) {
|
$routes = array_values(array_filter($routes, function ($route) use ($language) {
|
||||||
|
|
||||||
// no language scope
|
// no language scope
|
||||||
if (empty($route['language']) === true) {
|
if (empty($route['language']) === true) {
|
||||||
return false;
|
return false;
|
||||||
@@ -82,7 +81,6 @@ class LanguageRouter
|
|||||||
foreach ($routes as $index => $route) {
|
foreach ($routes as $index => $route) {
|
||||||
if ($pageId = ($route['page'] ?? null)) {
|
if ($pageId = ($route['page'] ?? null)) {
|
||||||
if ($page = $kirby->page($pageId)) {
|
if ($page = $kirby->page($pageId)) {
|
||||||
|
|
||||||
// convert string patterns to arrays
|
// convert string patterns to arrays
|
||||||
$patterns = A::wrap($route['pattern']);
|
$patterns = A::wrap($route['pattern']);
|
||||||
|
|
||||||
|
@@ -23,7 +23,6 @@ class LanguageRoutes
|
|||||||
$baseurl = $kirby->url();
|
$baseurl = $kirby->url();
|
||||||
|
|
||||||
foreach ($kirby->languages() as $language) {
|
foreach ($kirby->languages() as $language) {
|
||||||
|
|
||||||
// ignore languages with a different base url
|
// ignore languages with a different base url
|
||||||
if ($language->baseurl() !== $baseurl) {
|
if ($language->baseurl() !== $baseurl) {
|
||||||
continue;
|
continue;
|
||||||
@@ -66,7 +65,6 @@ class LanguageRoutes
|
|||||||
'method' => 'ALL',
|
'method' => 'ALL',
|
||||||
'env' => 'site',
|
'env' => 'site',
|
||||||
'action' => function (string $path) use ($kirby) {
|
'action' => function (string $path) use ($kirby) {
|
||||||
|
|
||||||
// check for content representations or files
|
// check for content representations or files
|
||||||
$extension = F::extension($path);
|
$extension = F::extension($path);
|
||||||
|
|
||||||
@@ -115,7 +113,6 @@ class LanguageRoutes
|
|||||||
'method' => 'ALL',
|
'method' => 'ALL',
|
||||||
'env' => 'site',
|
'env' => 'site',
|
||||||
'action' => function () use ($kirby) {
|
'action' => function () use ($kirby) {
|
||||||
|
|
||||||
// find all languages with the same base url as the current installation
|
// find all languages with the same base url as the current installation
|
||||||
$languages = $kirby->languages()->filter('baseurl', $kirby->url());
|
$languages = $kirby->languages()->filter('baseurl', $kirby->url());
|
||||||
|
|
||||||
|
@@ -41,7 +41,6 @@ class Media
|
|||||||
// try to find a file by model and filename
|
// try to find a file by model and filename
|
||||||
// this should work for all original files
|
// this should work for all original files
|
||||||
if ($file = $model->file($filename)) {
|
if ($file = $model->file($filename)) {
|
||||||
|
|
||||||
// check if the request contained an outdated media hash
|
// check if the request contained an outdated media hash
|
||||||
if ($file->mediaHash() !== $hash) {
|
if ($file->mediaHash() !== $hash) {
|
||||||
// if at least the token was correct, redirect
|
// if at least the token was correct, redirect
|
||||||
|
@@ -83,7 +83,6 @@ abstract class ModelWithContent extends Model
|
|||||||
*/
|
*/
|
||||||
public function content(string $languageCode = null)
|
public function content(string $languageCode = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
// single language support
|
// single language support
|
||||||
if ($this->kirby()->multilang() === false) {
|
if ($this->kirby()->multilang() === false) {
|
||||||
if (is_a($this->content, 'Kirby\Cms\Content') === true) {
|
if (is_a($this->content, 'Kirby\Cms\Content') === true) {
|
||||||
@@ -95,7 +94,6 @@ abstract class ModelWithContent extends Model
|
|||||||
|
|
||||||
// multi language support
|
// multi language support
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// only fetch from cache for the default language
|
// only fetch from cache for the default language
|
||||||
if ($languageCode === null && is_a($this->content, 'Kirby\Cms\Content') === true) {
|
if ($languageCode === null && is_a($this->content, 'Kirby\Cms\Content') === true) {
|
||||||
return $this->content;
|
return $this->content;
|
||||||
|
@@ -478,7 +478,6 @@ trait PageActions
|
|||||||
|
|
||||||
// run the hooks and creation action
|
// run the hooks and creation action
|
||||||
$page = $page->commit('create', ['page' => $page, 'input' => $props], function ($page, $props) {
|
$page = $page->commit('create', ['page' => $page, 'input' => $props], function ($page, $props) {
|
||||||
|
|
||||||
// always create pages in the default language
|
// always create pages in the default language
|
||||||
if ($page->kirby()->multilang() === true) {
|
if ($page->kirby()->multilang() === true) {
|
||||||
$languageCode = $page->kirby()->defaultLanguage()->code();
|
$languageCode = $page->kirby()->defaultLanguage()->code();
|
||||||
@@ -594,7 +593,6 @@ trait PageActions
|
|||||||
public function delete(bool $force = false): bool
|
public function delete(bool $force = false): bool
|
||||||
{
|
{
|
||||||
return $this->commit('delete', ['page' => $this, 'force' => $force], function ($page, $force) {
|
return $this->commit('delete', ['page' => $this, 'force' => $force], function ($page, $force) {
|
||||||
|
|
||||||
// delete all files individually
|
// delete all files individually
|
||||||
foreach ($page->files() as $file) {
|
foreach ($page->files() as $file) {
|
||||||
$file->delete();
|
$file->delete();
|
||||||
@@ -607,7 +605,6 @@ trait PageActions
|
|||||||
|
|
||||||
// actually remove the page from disc
|
// actually remove the page from disc
|
||||||
if ($page->exists() === true) {
|
if ($page->exists() === true) {
|
||||||
|
|
||||||
// delete all public media files
|
// delete all public media files
|
||||||
Dir::remove($page->mediaRoot());
|
Dir::remove($page->mediaRoot());
|
||||||
|
|
||||||
|
@@ -119,7 +119,6 @@ class PageBlueprint extends Blueprint
|
|||||||
|
|
||||||
// clean up and translate each status
|
// clean up and translate each status
|
||||||
foreach ($status as $key => $options) {
|
foreach ($status as $key => $options) {
|
||||||
|
|
||||||
// skip invalid status definitions
|
// skip invalid status definitions
|
||||||
if (in_array($key, ['draft', 'listed', 'unlisted']) === false || $options === false) {
|
if (in_array($key, ['draft', 'listed', 'unlisted']) === false || $options === false) {
|
||||||
unset($status[$key]);
|
unset($status[$key]);
|
||||||
|
@@ -648,7 +648,6 @@ class User extends ModelWithContent
|
|||||||
|
|
||||||
// if there's an authenticated user …
|
// if there's an authenticated user …
|
||||||
if ($user = $kirby->user()) {
|
if ($user = $kirby->user()) {
|
||||||
|
|
||||||
// admin users can select pretty much any role
|
// admin users can select pretty much any role
|
||||||
if ($user->isAdmin() === true) {
|
if ($user->isAdmin() === true) {
|
||||||
// except if the user is the last admin
|
// except if the user is the last admin
|
||||||
|
@@ -380,7 +380,6 @@ class Database
|
|||||||
// store the final sql to add it to the trace later
|
// store the final sql to add it to the trace later
|
||||||
$this->lastQuery = $this->statement->queryString;
|
$this->lastQuery = $this->statement->queryString;
|
||||||
} catch (Throwable $e) {
|
} catch (Throwable $e) {
|
||||||
|
|
||||||
// store the error
|
// store the error
|
||||||
$this->affected = 0;
|
$this->affected = 0;
|
||||||
$this->lastError = $e;
|
$this->lastError = $e;
|
||||||
|
@@ -407,7 +407,7 @@ class Query
|
|||||||
$mode = A::last($args);
|
$mode = A::last($args);
|
||||||
|
|
||||||
// if there's a where clause mode attribute attached…
|
// if there's a where clause mode attribute attached…
|
||||||
if (in_array($mode, ['AND', 'OR']) === true) {
|
if (in_array($mode, ['AND', 'OR'], true) === true) {
|
||||||
// remove that from the list of arguments
|
// remove that from the list of arguments
|
||||||
array_pop($args);
|
array_pop($args);
|
||||||
}
|
}
|
||||||
@@ -431,7 +431,7 @@ class Query
|
|||||||
$mode = A::last($args);
|
$mode = A::last($args);
|
||||||
|
|
||||||
// if there's a where clause mode attribute attached…
|
// if there's a where clause mode attribute attached…
|
||||||
if (in_array($mode, ['AND', 'OR']) === true) {
|
if (in_array($mode, ['AND', 'OR'], true) === true) {
|
||||||
// remove that from the list of arguments
|
// remove that from the list of arguments
|
||||||
array_pop($args);
|
array_pop($args);
|
||||||
}
|
}
|
||||||
@@ -941,7 +941,7 @@ class Query
|
|||||||
$result = '';
|
$result = '';
|
||||||
|
|
||||||
// if there's a where clause mode attribute attached…
|
// if there's a where clause mode attribute attached…
|
||||||
if (in_array($mode, ['AND', 'OR'])) {
|
if (in_array($mode, ['AND', 'OR'], true) === true) {
|
||||||
// remove that from the list of arguments
|
// remove that from the list of arguments
|
||||||
array_pop($args);
|
array_pop($args);
|
||||||
} else {
|
} else {
|
||||||
@@ -956,14 +956,12 @@ class Query
|
|||||||
|
|
||||||
// ->where('username like "myuser"');
|
// ->where('username like "myuser"');
|
||||||
} elseif (is_string($args[0]) === true) {
|
} elseif (is_string($args[0]) === true) {
|
||||||
|
|
||||||
// simply add the entire string to the where clause
|
// simply add the entire string to the where clause
|
||||||
// escaping or using bindings has to be done before calling this method
|
// escaping or using bindings has to be done before calling this method
|
||||||
$result = $args[0];
|
$result = $args[0];
|
||||||
|
|
||||||
// ->where(['username' => 'myuser']);
|
// ->where(['username' => 'myuser']);
|
||||||
} elseif (is_array($args[0]) === true) {
|
} elseif (is_array($args[0]) === true) {
|
||||||
|
|
||||||
// simple array mode (AND operator)
|
// simple array mode (AND operator)
|
||||||
$sql = $this->database->sql()->values($this->table, $args[0], ' AND ', true, true);
|
$sql = $this->database->sql()->values($this->table, $args[0], ' AND ', true, true);
|
||||||
|
|
||||||
@@ -990,7 +988,6 @@ class Query
|
|||||||
|
|
||||||
// ->where('username like :username', ['username' => 'myuser'])
|
// ->where('username like :username', ['username' => 'myuser'])
|
||||||
if (is_string($args[0]) === true && is_array($args[1]) === true) {
|
if (is_string($args[0]) === true && is_array($args[1]) === true) {
|
||||||
|
|
||||||
// prepared where clause
|
// prepared where clause
|
||||||
$result = $args[0];
|
$result = $args[0];
|
||||||
|
|
||||||
@@ -999,7 +996,6 @@ class Query
|
|||||||
|
|
||||||
// ->where('username like ?', 'myuser')
|
// ->where('username like ?', 'myuser')
|
||||||
} elseif (is_string($args[0]) === true && is_string($args[1]) === true) {
|
} elseif (is_string($args[0]) === true && is_string($args[1]) === true) {
|
||||||
|
|
||||||
// prepared where clause
|
// prepared where clause
|
||||||
$result = $args[0];
|
$result = $args[0];
|
||||||
|
|
||||||
@@ -1012,7 +1008,6 @@ class Query
|
|||||||
|
|
||||||
// ->where('username', 'like', 'myuser');
|
// ->where('username', 'like', 'myuser');
|
||||||
if (is_string($args[0]) === true && is_string($args[1]) === true) {
|
if (is_string($args[0]) === true && is_string($args[1]) === true) {
|
||||||
|
|
||||||
// validate column
|
// validate column
|
||||||
$sql = $this->database->sql();
|
$sql = $this->database->sql();
|
||||||
$key = $sql->columnName($this->table, $args[0]);
|
$key = $sql->columnName($this->table, $args[0]);
|
||||||
@@ -1061,7 +1056,6 @@ class Query
|
|||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// attach the where clause
|
// attach the where clause
|
||||||
|
@@ -672,7 +672,6 @@ abstract class Sql
|
|||||||
|
|
||||||
// array of columns
|
// array of columns
|
||||||
if (is_array($columns) === true) {
|
if (is_array($columns) === true) {
|
||||||
|
|
||||||
// validate columns
|
// validate columns
|
||||||
$result = [];
|
$result = [];
|
||||||
|
|
||||||
@@ -704,16 +703,16 @@ abstract class Sql
|
|||||||
$parts = preg_split('/(?:`[^`]*`|"[^"]*")(*SKIP)(*F)|\./', $identifier);
|
$parts = preg_split('/(?:`[^`]*`|"[^"]*")(*SKIP)(*F)|\./', $identifier);
|
||||||
|
|
||||||
switch (count($parts)) {
|
switch (count($parts)) {
|
||||||
// non-qualified identifier
|
|
||||||
case 1:
|
case 1:
|
||||||
|
// non-qualified identifier
|
||||||
return [$table, $this->unquoteIdentifier($parts[0])];
|
return [$table, $this->unquoteIdentifier($parts[0])];
|
||||||
|
|
||||||
// qualified identifier
|
|
||||||
case 2:
|
case 2:
|
||||||
|
// qualified identifier
|
||||||
return [$this->unquoteIdentifier($parts[0]), $this->unquoteIdentifier($parts[1])];
|
return [$this->unquoteIdentifier($parts[0]), $this->unquoteIdentifier($parts[1])];
|
||||||
|
|
||||||
// every other number is an error
|
|
||||||
default:
|
default:
|
||||||
|
// every other number is an error
|
||||||
throw new InvalidArgumentException('Invalid identifier ' . $identifier);
|
throw new InvalidArgumentException('Invalid identifier ' . $identifier);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -239,7 +239,6 @@ class Dir
|
|||||||
natsort($items);
|
natsort($items);
|
||||||
|
|
||||||
foreach ($items as $item) {
|
foreach ($items as $item) {
|
||||||
|
|
||||||
// ignore all items with a leading dot
|
// ignore all items with a leading dot
|
||||||
if (in_array(substr($item, 0, 1), ['.', '_']) === true) {
|
if (in_array(substr($item, 0, 1), ['.', '_']) === true) {
|
||||||
continue;
|
continue;
|
||||||
@@ -248,7 +247,6 @@ class Dir
|
|||||||
$root = $dir . '/' . $item;
|
$root = $dir . '/' . $item;
|
||||||
|
|
||||||
if (is_dir($root) === true) {
|
if (is_dir($root) === true) {
|
||||||
|
|
||||||
// extract the slug and num of the directory
|
// extract the slug and num of the directory
|
||||||
if (preg_match('/^([0-9]+)' . static::$numSeparator . '(.*)$/', $item, $match)) {
|
if (preg_match('/^([0-9]+)' . static::$numSeparator . '(.*)$/', $item, $match)) {
|
||||||
$num = (int)$match[1];
|
$num = (int)$match[1];
|
||||||
@@ -313,7 +311,6 @@ class Dir
|
|||||||
*/
|
*/
|
||||||
protected static function inventoryContent(array $inventory, array $content): array
|
protected static function inventoryContent(array $inventory, array $content): array
|
||||||
{
|
{
|
||||||
|
|
||||||
// filter meta files from the content file
|
// filter meta files from the content file
|
||||||
if (empty($content) === true) {
|
if (empty($content) === true) {
|
||||||
$inventory['template'] = 'default';
|
$inventory['template'] = 'default';
|
||||||
@@ -321,7 +318,6 @@ class Dir
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach ($content as $contentName) {
|
foreach ($content as $contentName) {
|
||||||
|
|
||||||
// could be a meta file. i.e. cover.jpg
|
// could be a meta file. i.e. cover.jpg
|
||||||
if (isset($inventory['files'][$contentName]) === true) {
|
if (isset($inventory['files'][$contentName]) === true) {
|
||||||
continue;
|
continue;
|
||||||
|
@@ -73,7 +73,6 @@ class Form
|
|||||||
$this->values = [];
|
$this->values = [];
|
||||||
|
|
||||||
foreach ($fields as $name => $props) {
|
foreach ($fields as $name => $props) {
|
||||||
|
|
||||||
// inject stuff from the form constructor (model, etc.)
|
// inject stuff from the form constructor (model, etc.)
|
||||||
$props = array_merge($inject, $props);
|
$props = array_merge($inject, $props);
|
||||||
|
|
||||||
@@ -104,7 +103,6 @@ class Form
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($strict !== true) {
|
if ($strict !== true) {
|
||||||
|
|
||||||
// use all given values, no matter
|
// use all given values, no matter
|
||||||
// if there's a field or not.
|
// if there's a field or not.
|
||||||
$input = array_merge($values, $input);
|
$input = array_merge($values, $input);
|
||||||
|
@@ -314,7 +314,6 @@ class Panel
|
|||||||
|
|
||||||
// create a micro-router for the Panel
|
// create a micro-router for the Panel
|
||||||
return Router::execute($path, $method = $kirby->request()->method(), $routes, function ($route) use ($areas, $kirby, $method, $path) {
|
return Router::execute($path, $method = $kirby->request()->method(), $routes, function ($route) use ($areas, $kirby, $method, $path) {
|
||||||
|
|
||||||
// route needs authentication?
|
// route needs authentication?
|
||||||
$auth = $route->attributes()['auth'] ?? true;
|
$auth = $route->attributes()['auth'] ?? true;
|
||||||
$areaId = $route->attributes()['area'] ?? null;
|
$areaId = $route->attributes()['area'] ?? null;
|
||||||
@@ -416,7 +415,6 @@ class Panel
|
|||||||
$routes = [];
|
$routes = [];
|
||||||
|
|
||||||
foreach ($dialogs as $key => $dialog) {
|
foreach ($dialogs as $key => $dialog) {
|
||||||
|
|
||||||
// create the full pattern with dialogs prefix
|
// create the full pattern with dialogs prefix
|
||||||
$pattern = 'dialogs/' . trim(($dialog['pattern'] ?? $key), '/');
|
$pattern = 'dialogs/' . trim(($dialog['pattern'] ?? $key), '/');
|
||||||
|
|
||||||
@@ -492,7 +490,6 @@ class Panel
|
|||||||
$routes = [];
|
$routes = [];
|
||||||
|
|
||||||
foreach ($searches as $name => $params) {
|
foreach ($searches as $name => $params) {
|
||||||
|
|
||||||
// create the full routing pattern
|
// create the full routing pattern
|
||||||
$pattern = 'search/' . $name;
|
$pattern = 'search/' . $name;
|
||||||
|
|
||||||
|
@@ -420,7 +420,6 @@ class View
|
|||||||
|
|
||||||
// if requested, send $fiber data as JSON
|
// if requested, send $fiber data as JSON
|
||||||
if (Panel::isFiberRequest() === true) {
|
if (Panel::isFiberRequest() === true) {
|
||||||
|
|
||||||
// filter data, if only or globals headers or
|
// filter data, if only or globals headers or
|
||||||
// query parameters are set
|
// query parameters are set
|
||||||
$fiber = static::apply($fiber);
|
$fiber = static::apply($fiber);
|
||||||
|
@@ -177,7 +177,6 @@ class A
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach ($array2 as $key => $value) {
|
foreach ($array2 as $key => $value) {
|
||||||
|
|
||||||
// append to the merged array, don't overwrite numeric keys
|
// append to the merged array, don't overwrite numeric keys
|
||||||
if (is_int($key) === true && $mode === static::MERGE_APPEND) {
|
if (is_int($key) === true && $mode === static::MERGE_APPEND) {
|
||||||
$merged[] = $value;
|
$merged[] = $value;
|
||||||
|
@@ -525,7 +525,6 @@ class Collection extends Iterator implements Countable
|
|||||||
*/
|
*/
|
||||||
public function group($field, bool $i = true)
|
public function group($field, bool $i = true)
|
||||||
{
|
{
|
||||||
|
|
||||||
// group by field name
|
// group by field name
|
||||||
if (is_string($field) === true) {
|
if (is_string($field) === true) {
|
||||||
return $this->group(function ($item) use ($field, $i) {
|
return $this->group(function ($item) use ($field, $i) {
|
||||||
@@ -541,7 +540,6 @@ class Collection extends Iterator implements Countable
|
|||||||
$groups = [];
|
$groups = [];
|
||||||
|
|
||||||
foreach ($this->data as $key => $item) {
|
foreach ($this->data as $key => $item) {
|
||||||
|
|
||||||
// get the value to group by
|
// get the value to group by
|
||||||
$value = $field($item);
|
$value = $field($item);
|
||||||
|
|
||||||
@@ -1005,7 +1003,6 @@ class Collection extends Iterator implements Countable
|
|||||||
$fields = [];
|
$fields = [];
|
||||||
|
|
||||||
foreach ($args as $arg) {
|
foreach ($args as $arg) {
|
||||||
|
|
||||||
// get the index of the latest field array inside the $fields array
|
// get the index of the latest field array inside the $fields array
|
||||||
$currentField = $fields ? count($fields) - 1 : 0;
|
$currentField = $fields ? count($fields) - 1 : 0;
|
||||||
|
|
||||||
|
@@ -585,17 +585,17 @@ class Html extends Xml
|
|||||||
};
|
};
|
||||||
|
|
||||||
switch ($path->toString()) {
|
switch ($path->toString()) {
|
||||||
// playlists
|
|
||||||
case 'embed/videoseries':
|
case 'embed/videoseries':
|
||||||
case 'playlist':
|
case 'playlist':
|
||||||
|
// playlists
|
||||||
if ($isYoutubeId($query->list) === true) {
|
if ($isYoutubeId($query->list) === true) {
|
||||||
$src = $host . '/videoseries';
|
$src = $host . '/videoseries';
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// regular video URLs
|
|
||||||
case 'watch':
|
case 'watch':
|
||||||
|
// regular video URLs
|
||||||
if ($isYoutubeId($query->v) === true) {
|
if ($isYoutubeId($query->v) === true) {
|
||||||
$src = $host . '/' . $query->v;
|
$src = $host . '/' . $query->v;
|
||||||
|
|
||||||
|
@@ -81,7 +81,6 @@ class Pagination
|
|||||||
*/
|
*/
|
||||||
return $a;
|
return $a;
|
||||||
} elseif (is_array($a) === true) {
|
} elseif (is_array($a) === true) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* First argument is an option array
|
* First argument is an option array
|
||||||
*
|
*
|
||||||
@@ -89,7 +88,6 @@ class Pagination
|
|||||||
*/
|
*/
|
||||||
$params = $a;
|
$params = $a;
|
||||||
} elseif (is_int($a) === true && $b === null) {
|
} elseif (is_int($a) === true && $b === null) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* First argument is the limit
|
* First argument is the limit
|
||||||
*
|
*
|
||||||
@@ -97,7 +95,6 @@ class Pagination
|
|||||||
*/
|
*/
|
||||||
$params['limit'] = $a;
|
$params['limit'] = $a;
|
||||||
} elseif (is_int($a) === true && is_int($b) === true) {
|
} elseif (is_int($a) === true && is_int($b) === true) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* First argument is the limit,
|
* First argument is the limit,
|
||||||
* second argument is the page
|
* second argument is the page
|
||||||
@@ -107,7 +104,6 @@ class Pagination
|
|||||||
$params['limit'] = $a;
|
$params['limit'] = $a;
|
||||||
$params['page'] = $b;
|
$params['page'] = $b;
|
||||||
} elseif (is_int($a) === true && is_array($b) === true) {
|
} elseif (is_int($a) === true && is_array($b) === true) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* First argument is the limit,
|
* First argument is the limit,
|
||||||
* second argument are options
|
* second argument are options
|
||||||
|
@@ -122,7 +122,6 @@ trait Properties
|
|||||||
|
|
||||||
// handle empty values
|
// handle empty values
|
||||||
if ($value === null) {
|
if ($value === null) {
|
||||||
|
|
||||||
// replace null with a default value, if a default handler exists
|
// replace null with a default value, if a default handler exists
|
||||||
if (method_exists($this, 'default' . $name) === true) {
|
if (method_exists($this, 'default' . $name) === true) {
|
||||||
$value = $this->{'default' . $name}();
|
$value = $this->{'default' . $name}();
|
||||||
|
@@ -846,11 +846,9 @@ class Str
|
|||||||
if (is_int($replacement['limit']) === false) {
|
if (is_int($replacement['limit']) === false) {
|
||||||
throw new Exception('Invalid limit "' . $replacement['limit'] . '".');
|
throw new Exception('Invalid limit "' . $replacement['limit'] . '".');
|
||||||
} elseif ($replacement['limit'] === -1) {
|
} elseif ($replacement['limit'] === -1) {
|
||||||
|
|
||||||
// no limit, we don't need our special replacement routine
|
// no limit, we don't need our special replacement routine
|
||||||
$string = str_replace($replacement['search'], $replacement['replace'], $string);
|
$string = str_replace($replacement['search'], $replacement['replace'], $string);
|
||||||
} elseif ($replacement['limit'] > 0) {
|
} elseif ($replacement['limit'] > 0) {
|
||||||
|
|
||||||
// limit given, only replace for $replacement['limit'] times per replacement
|
// limit given, only replace for $replacement['limit'] times per replacement
|
||||||
$position = -1;
|
$position = -1;
|
||||||
|
|
||||||
|
@@ -31,7 +31,8 @@ class SimpleImage {
|
|||||||
ERR_LIB_NOT_LOADED = 8,
|
ERR_LIB_NOT_LOADED = 8,
|
||||||
ERR_UNSUPPORTED_FORMAT = 9,
|
ERR_UNSUPPORTED_FORMAT = 9,
|
||||||
ERR_WEBP_NOT_ENABLED = 10,
|
ERR_WEBP_NOT_ENABLED = 10,
|
||||||
ERR_WRITE = 11;
|
ERR_WRITE = 11,
|
||||||
|
ERR_INVALID_FLAG = 12;
|
||||||
|
|
||||||
|
|
||||||
protected $image;
|
protected $image;
|
||||||
@@ -46,9 +47,10 @@ class SimpleImage {
|
|||||||
* Creates a new SimpleImage object.
|
* Creates a new SimpleImage object.
|
||||||
*
|
*
|
||||||
* @param string $image An image file or a data URI to load.
|
* @param string $image An image file or a data URI to load.
|
||||||
|
* @param array $flags Optional override of default flags.
|
||||||
* @throws \Exception Thrown if the GD library is not found; file|URI or image data is invalid.
|
* @throws \Exception Thrown if the GD library is not found; file|URI or image data is invalid.
|
||||||
*/
|
*/
|
||||||
public function __construct($image = '') {
|
public function __construct($image = '', $flags = []) {
|
||||||
// Check for the required GD extension
|
// Check for the required GD extension
|
||||||
if(extension_loaded('gd')) {
|
if(extension_loaded('gd')) {
|
||||||
// Ignore JPEG warnings that cause imagecreatefromjpeg() to fail
|
// Ignore JPEG warnings that cause imagecreatefromjpeg() to fail
|
||||||
@@ -57,6 +59,16 @@ class SimpleImage {
|
|||||||
throw new \Exception('Required extension GD is not loaded.', self::ERR_GD_NOT_ENABLED);
|
throw new \Exception('Required extension GD is not loaded.', self::ERR_GD_NOT_ENABLED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Associative array of flags.
|
||||||
|
$this->flags = [
|
||||||
|
"sslVerify" => true // Skip SSL peer validation
|
||||||
|
];
|
||||||
|
|
||||||
|
// Override default flag values.
|
||||||
|
foreach($flags as $flag => $value) {
|
||||||
|
$this->setFlag($flag, $value);
|
||||||
|
}
|
||||||
|
|
||||||
// Load an image through the constructor
|
// Load an image through the constructor
|
||||||
if(preg_match('/^data:(.*?);/', $image)) {
|
if(preg_match('/^data:(.*?);/', $image)) {
|
||||||
$this->fromDataUri($image);
|
$this->fromDataUri($image);
|
||||||
@@ -77,6 +89,37 @@ class SimpleImage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Helper functions
|
||||||
|
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set flag value.
|
||||||
|
*
|
||||||
|
* @param string $flag Name of the flag to set.
|
||||||
|
* @param boolean $value State of the flag.
|
||||||
|
* @throws \Exception Thrown if flag does not exist (no default value).
|
||||||
|
*/
|
||||||
|
public function setFlag($flag, $value) {
|
||||||
|
// Throw if flag does not exist
|
||||||
|
if(!in_array($flag, array_keys($this->flags))) {
|
||||||
|
throw new \Exception('Invalid flag.', self::ERR_INVALID_FLAG);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set flag value by name
|
||||||
|
$this->flags[$flag] = $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get flag value.
|
||||||
|
*
|
||||||
|
* @param string $flag Name of the flag to get.
|
||||||
|
* @return boolean|null
|
||||||
|
*/
|
||||||
|
public function getFlag($flag) {
|
||||||
|
return in_array($flag, array_keys($this->flags)) ? $this->flags[$flag] : null;
|
||||||
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Loaders
|
// Loaders
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
@@ -118,70 +161,66 @@ class SimpleImage {
|
|||||||
* Loads an image from a file.
|
* Loads an image from a file.
|
||||||
*
|
*
|
||||||
* @param string $file The image file to load.
|
* @param string $file The image file to load.
|
||||||
|
* @param boolean $sslVerify Set to false to skip SSL validation.
|
||||||
* @throws \Exception Thrown if file or image data is invalid.
|
* @throws \Exception Thrown if file or image data is invalid.
|
||||||
* @return \claviska\SimpleImage
|
* @return \claviska\SimpleImage
|
||||||
*/
|
*/
|
||||||
public function fromFile($file) {
|
public function fromFile($file) {
|
||||||
// Check if the file exists and is readable. We're using fopen() instead of file_exists()
|
// Set fopen options.
|
||||||
// because not all URL wrappers support the latter.
|
$sslVerify = $this->getFlag("sslVerify"); // Don't perform peer validation when true
|
||||||
$handle = @fopen($file, 'r');
|
$opts = [
|
||||||
if($handle === false) {
|
"ssl" => [
|
||||||
|
"verify_peer" => $sslVerify,
|
||||||
|
"verify_peer_name" => $sslVerify
|
||||||
|
]
|
||||||
|
];
|
||||||
|
|
||||||
|
// Check if the file exists and is readable.
|
||||||
|
$file = @file_get_contents($file, false, stream_context_create($opts));
|
||||||
|
if($file === false) {
|
||||||
throw new \Exception("File not found: $file", self::ERR_FILE_NOT_FOUND);
|
throw new \Exception("File not found: $file", self::ERR_FILE_NOT_FOUND);
|
||||||
}
|
}
|
||||||
fclose($handle);
|
|
||||||
|
// Create image object from string
|
||||||
|
$this->image = imagecreatefromstring($file);
|
||||||
|
|
||||||
// Get image info
|
// Get image info
|
||||||
$info = @getimagesize($file);
|
$info = @getimagesizefromstring($file);
|
||||||
if($info === false) {
|
if($info === false) {
|
||||||
throw new \Exception("Invalid image file: $file", self::ERR_INVALID_IMAGE);
|
throw new \Exception("Invalid image file: $file", self::ERR_INVALID_IMAGE);
|
||||||
}
|
}
|
||||||
$this->mimeType = $info['mime'];
|
$this->mimeType = $info['mime'];
|
||||||
|
|
||||||
// Create image object from file
|
|
||||||
switch($this->mimeType) {
|
|
||||||
case 'image/gif':
|
|
||||||
// Load the gif
|
|
||||||
$gif = imagecreatefromgif($file);
|
|
||||||
if($gif) {
|
|
||||||
// Copy the gif over to a true color image to preserve its transparency. This is a
|
|
||||||
// workaround to prevent imagepalettetruecolor() from borking transparency.
|
|
||||||
$width = imagesx($gif);
|
|
||||||
$height = imagesy($gif);
|
|
||||||
$this->image = imagecreatetruecolor((int) $width, (int) $height);
|
|
||||||
$transparentColor = imagecolorallocatealpha($this->image, 0, 0, 0, 127);
|
|
||||||
imagecolortransparent($this->image, $transparentColor);
|
|
||||||
imagefill($this->image, 0, 0, $transparentColor);
|
|
||||||
imagecopy($this->image, $gif, 0, 0, 0, 0, $width, $height);
|
|
||||||
imagedestroy($gif);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'image/jpeg':
|
|
||||||
$this->image = imagecreatefromjpeg($file);
|
|
||||||
break;
|
|
||||||
case 'image/png':
|
|
||||||
$this->image = imagecreatefrompng($file);
|
|
||||||
break;
|
|
||||||
case 'image/webp':
|
|
||||||
$this->image = imagecreatefromwebp($file);
|
|
||||||
break;
|
|
||||||
case 'image/bmp':
|
|
||||||
case 'image/x-ms-bmp':
|
|
||||||
case 'image/x-windows-bmp':
|
|
||||||
$this->image = imagecreatefrombmp($file);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if(!$this->image) {
|
if(!$this->image) {
|
||||||
throw new \Exception("Unsupported format: " . $this->mimeType, self::ERR_UNSUPPORTED_FORMAT);
|
throw new \Exception("Unsupported format: " . $this->mimeType, self::ERR_UNSUPPORTED_FORMAT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switch($this->mimeType) {
|
||||||
|
case 'image/gif':
|
||||||
|
// Copy the gif over to a true color image to preserve its transparency. This is a
|
||||||
|
// workaround to prevent imagepalettetotruecolor() from borking transparency.
|
||||||
|
$width = imagesx($this->image);
|
||||||
|
$height = imagesx($this->image);
|
||||||
|
|
||||||
|
$gif = imagecreatetruecolor((int) $width, (int) $height);
|
||||||
|
$alpha = imagecolorallocatealpha($gif, 0, 0, 0, 127);
|
||||||
|
imagecolortransparent($gif, $alpha);
|
||||||
|
imagefill($gif, 0, 0, $alpha);
|
||||||
|
|
||||||
|
imagecopy($this->image, $gif, 0, 0, 0, 0, $width, $height);
|
||||||
|
imagedestroy($gif);
|
||||||
|
break;
|
||||||
|
case 'image/jpeg':
|
||||||
|
// Load exif data from JPEG images
|
||||||
|
if(function_exists('exif_read_data')) {
|
||||||
|
$this->exif = @exif_read_data("data://image/jpeg;base64," . base64_encode($file));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// Convert pallete images to true color images
|
// Convert pallete images to true color images
|
||||||
imagepalettetotruecolor($this->image);
|
imagepalettetotruecolor($this->image);
|
||||||
|
|
||||||
// Load exif data from JPEG images
|
|
||||||
if($this->mimeType === 'image/jpeg' && function_exists('exif_read_data')) {
|
|
||||||
$this->exif = @exif_read_data($file);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
3
kirby/vendor/composer/autoload_classmap.php
vendored
3
kirby/vendor/composer/autoload_classmap.php
vendored
@@ -285,9 +285,6 @@ return array(
|
|||||||
'Psr\\Log\\LoggerInterface' => $vendorDir . '/psr/log/Psr/Log/LoggerInterface.php',
|
'Psr\\Log\\LoggerInterface' => $vendorDir . '/psr/log/Psr/Log/LoggerInterface.php',
|
||||||
'Psr\\Log\\LoggerTrait' => $vendorDir . '/psr/log/Psr/Log/LoggerTrait.php',
|
'Psr\\Log\\LoggerTrait' => $vendorDir . '/psr/log/Psr/Log/LoggerTrait.php',
|
||||||
'Psr\\Log\\NullLogger' => $vendorDir . '/psr/log/Psr/Log/NullLogger.php',
|
'Psr\\Log\\NullLogger' => $vendorDir . '/psr/log/Psr/Log/NullLogger.php',
|
||||||
'Psr\\Log\\Test\\DummyTest' => $vendorDir . '/psr/log/Psr/Log/Test/DummyTest.php',
|
|
||||||
'Psr\\Log\\Test\\LoggerInterfaceTest' => $vendorDir . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
|
|
||||||
'Psr\\Log\\Test\\TestLogger' => $vendorDir . '/psr/log/Psr/Log/Test/TestLogger.php',
|
|
||||||
'Spyc' => $baseDir . '/dependencies/spyc/Spyc.php',
|
'Spyc' => $baseDir . '/dependencies/spyc/Spyc.php',
|
||||||
'Symfony\\Polyfill\\Intl\\Idn\\Idn' => $vendorDir . '/symfony/polyfill-intl-idn/Idn.php',
|
'Symfony\\Polyfill\\Intl\\Idn\\Idn' => $vendorDir . '/symfony/polyfill-intl-idn/Idn.php',
|
||||||
'Symfony\\Polyfill\\Intl\\Idn\\Info' => $vendorDir . '/symfony/polyfill-intl-idn/Info.php',
|
'Symfony\\Polyfill\\Intl\\Idn\\Info' => $vendorDir . '/symfony/polyfill-intl-idn/Info.php',
|
||||||
|
3
kirby/vendor/composer/autoload_static.php
vendored
3
kirby/vendor/composer/autoload_static.php
vendored
@@ -377,9 +377,6 @@ class ComposerStaticInita8011b477bb239488e5d139cdeb7b31e
|
|||||||
'Psr\\Log\\LoggerInterface' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerInterface.php',
|
'Psr\\Log\\LoggerInterface' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerInterface.php',
|
||||||
'Psr\\Log\\LoggerTrait' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerTrait.php',
|
'Psr\\Log\\LoggerTrait' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerTrait.php',
|
||||||
'Psr\\Log\\NullLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/NullLogger.php',
|
'Psr\\Log\\NullLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/NullLogger.php',
|
||||||
'Psr\\Log\\Test\\DummyTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/DummyTest.php',
|
|
||||||
'Psr\\Log\\Test\\LoggerInterfaceTest' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/LoggerInterfaceTest.php',
|
|
||||||
'Psr\\Log\\Test\\TestLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/Test/TestLogger.php',
|
|
||||||
'Spyc' => __DIR__ . '/../..' . '/dependencies/spyc/Spyc.php',
|
'Spyc' => __DIR__ . '/../..' . '/dependencies/spyc/Spyc.php',
|
||||||
'Symfony\\Polyfill\\Intl\\Idn\\Idn' => __DIR__ . '/..' . '/symfony/polyfill-intl-idn/Idn.php',
|
'Symfony\\Polyfill\\Intl\\Idn\\Idn' => __DIR__ . '/..' . '/symfony/polyfill-intl-idn/Idn.php',
|
||||||
'Symfony\\Polyfill\\Intl\\Idn\\Info' => __DIR__ . '/..' . '/symfony/polyfill-intl-idn/Info.php',
|
'Symfony\\Polyfill\\Intl\\Idn\\Info' => __DIR__ . '/..' . '/symfony/polyfill-intl-idn/Info.php',
|
||||||
|
28
kirby/vendor/composer/installed.json
vendored
28
kirby/vendor/composer/installed.json
vendored
@@ -2,17 +2,17 @@
|
|||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "claviska/simpleimage",
|
"name": "claviska/simpleimage",
|
||||||
"version": "3.6.5",
|
"version": "3.7.0",
|
||||||
"version_normalized": "3.6.5.0",
|
"version_normalized": "3.7.0.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/claviska/SimpleImage.git",
|
"url": "https://github.com/claviska/SimpleImage.git",
|
||||||
"reference": "00f90662686696b9b7157dbb176183aabe89700f"
|
"reference": "abd15ced313c7b8041d7d73d8d2398b4f2510cf1"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/claviska/SimpleImage/zipball/00f90662686696b9b7157dbb176183aabe89700f",
|
"url": "https://api.github.com/repos/claviska/SimpleImage/zipball/abd15ced313c7b8041d7d73d8d2398b4f2510cf1",
|
||||||
"reference": "00f90662686696b9b7157dbb176183aabe89700f",
|
"reference": "abd15ced313c7b8041d7d73d8d2398b4f2510cf1",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
"league/color-extractor": "0.3.*",
|
"league/color-extractor": "0.3.*",
|
||||||
"php": ">=5.6.0"
|
"php": ">=5.6.0"
|
||||||
},
|
},
|
||||||
"time": "2021-12-01T12:42:55+00:00",
|
"time": "2022-07-05T13:18:44+00:00",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"installation-source": "dist",
|
"installation-source": "dist",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
"description": "A PHP class that makes working with images as simple as possible.",
|
"description": "A PHP class that makes working with images as simple as possible.",
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/claviska/SimpleImage/issues",
|
"issues": "https://github.com/claviska/SimpleImage/issues",
|
||||||
"source": "https://github.com/claviska/SimpleImage/tree/3.6.5"
|
"source": "https://github.com/claviska/SimpleImage/tree/3.7.0"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -361,17 +361,17 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpmailer/phpmailer",
|
"name": "phpmailer/phpmailer",
|
||||||
"version": "v6.6.3",
|
"version": "v6.6.4",
|
||||||
"version_normalized": "6.6.3.0",
|
"version_normalized": "6.6.4.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/PHPMailer/PHPMailer.git",
|
"url": "https://github.com/PHPMailer/PHPMailer.git",
|
||||||
"reference": "9400f305a898f194caff5521f64e5dfa926626f3"
|
"reference": "a94fdebaea6bd17f51be0c2373ab80d3d681269b"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/9400f305a898f194caff5521f64e5dfa926626f3",
|
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/a94fdebaea6bd17f51be0c2373ab80d3d681269b",
|
||||||
"reference": "9400f305a898f194caff5521f64e5dfa926626f3",
|
"reference": "a94fdebaea6bd17f51be0c2373ab80d3d681269b",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -398,7 +398,7 @@
|
|||||||
"stevenmaguire/oauth2-microsoft": "Needed for Microsoft XOAUTH2 authentication",
|
"stevenmaguire/oauth2-microsoft": "Needed for Microsoft XOAUTH2 authentication",
|
||||||
"symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)"
|
"symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)"
|
||||||
},
|
},
|
||||||
"time": "2022-06-20T09:21:02+00:00",
|
"time": "2022-08-22T09:22:00+00:00",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"installation-source": "dist",
|
"installation-source": "dist",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
@@ -430,7 +430,7 @@
|
|||||||
"description": "PHPMailer is a full-featured email creation and transfer class for PHP",
|
"description": "PHPMailer is a full-featured email creation and transfer class for PHP",
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/PHPMailer/PHPMailer/issues",
|
"issues": "https://github.com/PHPMailer/PHPMailer/issues",
|
||||||
"source": "https://github.com/PHPMailer/PHPMailer/tree/v6.6.3"
|
"source": "https://github.com/PHPMailer/PHPMailer/tree/v6.6.4"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
|
20
kirby/vendor/composer/installed.php
vendored
20
kirby/vendor/composer/installed.php
vendored
@@ -1,8 +1,8 @@
|
|||||||
<?php return array(
|
<?php return array(
|
||||||
'root' => array(
|
'root' => array(
|
||||||
'name' => 'getkirby/cms',
|
'name' => 'getkirby/cms',
|
||||||
'pretty_version' => '3.7.4',
|
'pretty_version' => '3.7.5',
|
||||||
'version' => '3.7.4.0',
|
'version' => '3.7.5.0',
|
||||||
'reference' => NULL,
|
'reference' => NULL,
|
||||||
'type' => 'kirby-cms',
|
'type' => 'kirby-cms',
|
||||||
'install_path' => __DIR__ . '/../../',
|
'install_path' => __DIR__ . '/../../',
|
||||||
@@ -11,9 +11,9 @@
|
|||||||
),
|
),
|
||||||
'versions' => array(
|
'versions' => array(
|
||||||
'claviska/simpleimage' => array(
|
'claviska/simpleimage' => array(
|
||||||
'pretty_version' => '3.6.5',
|
'pretty_version' => '3.7.0',
|
||||||
'version' => '3.6.5.0',
|
'version' => '3.7.0.0',
|
||||||
'reference' => '00f90662686696b9b7157dbb176183aabe89700f',
|
'reference' => 'abd15ced313c7b8041d7d73d8d2398b4f2510cf1',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../claviska/simpleimage',
|
'install_path' => __DIR__ . '/../claviska/simpleimage',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
@@ -29,8 +29,8 @@
|
|||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'getkirby/cms' => array(
|
'getkirby/cms' => array(
|
||||||
'pretty_version' => '3.7.4',
|
'pretty_version' => '3.7.5',
|
||||||
'version' => '3.7.4.0',
|
'version' => '3.7.5.0',
|
||||||
'reference' => NULL,
|
'reference' => NULL,
|
||||||
'type' => 'kirby-cms',
|
'type' => 'kirby-cms',
|
||||||
'install_path' => __DIR__ . '/../../',
|
'install_path' => __DIR__ . '/../../',
|
||||||
@@ -80,9 +80,9 @@
|
|||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'phpmailer/phpmailer' => array(
|
'phpmailer/phpmailer' => array(
|
||||||
'pretty_version' => 'v6.6.3',
|
'pretty_version' => 'v6.6.4',
|
||||||
'version' => '6.6.3.0',
|
'version' => '6.6.4.0',
|
||||||
'reference' => '9400f305a898f194caff5521f64e5dfa926626f3',
|
'reference' => 'a94fdebaea6bd17f51be0c2373ab80d3d681269b',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../phpmailer/phpmailer',
|
'install_path' => __DIR__ . '/../phpmailer/phpmailer',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
|
@@ -5,22 +5,29 @@
|
|||||||
* @package PHPMailer
|
* @package PHPMailer
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$PHPMAILER_LANG['authenticate'] = 'SMTP Σφάλμα: Αδυναμία πιστοποίησης (authentication).';
|
$PHPMAILER_LANG['authenticate'] = 'Σφάλμα SMTP: Αδυναμία πιστοποίησης.';
|
||||||
$PHPMAILER_LANG['connect_host'] = 'SMTP Σφάλμα: Αδυναμία σύνδεσης στον SMTP-Host.';
|
$PHPMAILER_LANG['buggy_php'] = 'Η έκδοση PHP που χρησιμοποιείτε παρουσιάζει σφάλμα που μπορεί να έχει ως αποτέλεσμα κατεστραμένα μηνύματα. Για να το διορθώσετε, αλλάξτε τον τρόπο αποστολής σε SMTP, απενεργοποιήστε την επιλογή mail.add_x_header στο αρχείο php.ini, αλλάξτε λειτουργικό σε MacOS ή Linux ή αναβαθμίστε την PHP σε έκδοση 7.0.17+ ή 7.1.3+.';
|
||||||
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Σφάλμα: Τα δεδομένα δεν έγιναν αποδεκτά.';
|
$PHPMAILER_LANG['connect_host'] = 'Σφάλμα SMTP: Αδυναμία σύνδεσης με τον φιλοξενητή SMTP.';
|
||||||
$PHPMAILER_LANG['empty_message'] = 'Το E-Mail δεν έχει περιεχόμενο .';
|
$PHPMAILER_LANG['data_not_accepted'] = 'Σφάλμα SMTP: Μη αποδεκτά δεδομένα.';
|
||||||
$PHPMAILER_LANG['encoding'] = 'Αγνωστο Encoding-Format: ';
|
$PHPMAILER_LANG['empty_message'] = 'Η ηλεκτρονική επιστολή δεν έχει περιεχόμενο.';
|
||||||
$PHPMAILER_LANG['execute'] = 'Αδυναμία εκτέλεσης ακόλουθης εντολής: ';
|
$PHPMAILER_LANG['encoding'] = 'Άγνωστη μορφή κωδικοποίησης: ';
|
||||||
$PHPMAILER_LANG['file_access'] = 'Αδυναμία προσπέλασης του αρχείου: ';
|
$PHPMAILER_LANG['execute'] = 'Αδυναμία εκτέλεσης: ';
|
||||||
$PHPMAILER_LANG['file_open'] = 'Σφάλμα Αρχείου: Δεν είναι δυνατό το άνοιγμα του ακόλουθου αρχείου: ';
|
$PHPMAILER_LANG['extension_missing'] = 'Απουσία επέκτασης: ';
|
||||||
$PHPMAILER_LANG['from_failed'] = 'Η παρακάτω διεύθυνση αποστολέα δεν είναι σωστή: ';
|
$PHPMAILER_LANG['file_access'] = 'Αδυναμία πρόσβασης στο αρχείο: ';
|
||||||
$PHPMAILER_LANG['instantiate'] = 'Αδυναμία εκκίνησης Mail function.';
|
$PHPMAILER_LANG['file_open'] = 'Σφάλμα Αρχείου: Αδυναμία ανοίγματος αρχείου: ';
|
||||||
$PHPMAILER_LANG['invalid_address'] = 'Το μήνυμα δεν εστάλη, η διεύθυνση δεν είναι έγκυρη: ';
|
$PHPMAILER_LANG['from_failed'] = 'Η ακόλουθη διεύθυνση αποστολέα δεν είναι σωστή: ';
|
||||||
|
$PHPMAILER_LANG['instantiate'] = 'Αδυναμία εκκίνησης συνάρτησης Mail.';
|
||||||
|
$PHPMAILER_LANG['invalid_address'] = 'Μη έγκυρη διεύθυνση: ';
|
||||||
|
$PHPMAILER_LANG['invalid_header'] = 'Μη έγκυρο όνομα κεφαλίδας ή τιμή';
|
||||||
|
$PHPMAILER_LANG['invalid_hostentry'] = 'Μη έγκυρη εισαγωγή φιλοξενητή: ';
|
||||||
|
$PHPMAILER_LANG['invalid_host'] = 'Μη έγκυρος φιλοξενητής: ';
|
||||||
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer δεν υποστηρίζεται.';
|
$PHPMAILER_LANG['mailer_not_supported'] = ' mailer δεν υποστηρίζεται.';
|
||||||
$PHPMAILER_LANG['provide_address'] = 'Παρακαλούμε δώστε τουλάχιστον μια e-mail διεύθυνση παραλήπτη.';
|
$PHPMAILER_LANG['provide_address'] = 'Δώστε τουλάχιστον μια ηλεκτρονική διεύθυνση παραλήπτη.';
|
||||||
$PHPMAILER_LANG['recipients_failed'] = 'SMTP Σφάλμα: Οι παρακάτω διευθύνσεις παραλήπτη δεν είναι έγκυρες: ';
|
$PHPMAILER_LANG['recipients_failed'] = 'Σφάλμα SMTP: Οι παρακάτω διευθύνσεις παραλήπτη δεν είναι έγκυρες: ';
|
||||||
$PHPMAILER_LANG['signing'] = 'Σφάλμα υπογραφής: ';
|
$PHPMAILER_LANG['signing'] = 'Σφάλμα υπογραφής: ';
|
||||||
$PHPMAILER_LANG['smtp_connect_failed'] = 'Αποτυχία σύνδεσης στον SMTP Server.';
|
$PHPMAILER_LANG['smtp_code'] = 'Κώδικάς SMTP: ';
|
||||||
$PHPMAILER_LANG['smtp_error'] = 'Σφάλμα από τον SMTP Server: ';
|
$PHPMAILER_LANG['smtp_code_ex'] = 'Πρόσθετες πληροφορίες SMTP: ';
|
||||||
$PHPMAILER_LANG['variable_set'] = 'Αδυναμία ορισμού ή αρχικοποίησης μεταβλητής: ';
|
$PHPMAILER_LANG['smtp_connect_failed'] = 'Αποτυχία σύνδεσης SMTP.';
|
||||||
//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';
|
$PHPMAILER_LANG['smtp_detail'] = 'Λεπτομέρεια: ';
|
||||||
|
$PHPMAILER_LANG['smtp_error'] = 'Σφάλμα με τον διακομιστή SMTP: ';
|
||||||
|
$PHPMAILER_LANG['variable_set'] = 'Αδυναμία ορισμού ή επαναφοράς μεταβλητής: ';
|
||||||
|
@@ -350,8 +350,8 @@ class PHPMailer
|
|||||||
public $Password = '';
|
public $Password = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SMTP auth type.
|
* SMTP authentication type. Options are CRAM-MD5, LOGIN, PLAIN, XOAUTH2.
|
||||||
* Options are CRAM-MD5, LOGIN, PLAIN, XOAUTH2, attempted in that order if not specified.
|
* If not specified, the first one from that list that the server supports will be selected.
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
@@ -750,7 +750,7 @@ class PHPMailer
|
|||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
const VERSION = '6.6.3';
|
const VERSION = '6.6.4';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Error severity: message only, continue processing.
|
* Error severity: message only, continue processing.
|
||||||
@@ -1096,7 +1096,7 @@ class PHPMailer
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if ($name !== null) {
|
if ($name !== null && is_string($name)) {
|
||||||
$name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim
|
$name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim
|
||||||
} else {
|
} else {
|
||||||
$name = '';
|
$name = '';
|
||||||
@@ -1288,7 +1288,7 @@ class PHPMailer
|
|||||||
*/
|
*/
|
||||||
public function setFrom($address, $name = '', $auto = true)
|
public function setFrom($address, $name = '', $auto = true)
|
||||||
{
|
{
|
||||||
$address = trim($address);
|
$address = trim((string)$address);
|
||||||
$name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim
|
$name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim
|
||||||
//Don't validate now addresses with IDN. Will be done in send().
|
//Don't validate now addresses with IDN. Will be done in send().
|
||||||
$pos = strrpos($address, '@');
|
$pos = strrpos($address, '@');
|
||||||
@@ -1891,7 +1891,14 @@ class PHPMailer
|
|||||||
foreach ($this->to as $toaddr) {
|
foreach ($this->to as $toaddr) {
|
||||||
$toArr[] = $this->addrFormat($toaddr);
|
$toArr[] = $this->addrFormat($toaddr);
|
||||||
}
|
}
|
||||||
$to = implode(', ', $toArr);
|
$to = trim(implode(', ', $toArr));
|
||||||
|
|
||||||
|
//If there are no To-addresses (e.g. when sending only to BCC-addresses)
|
||||||
|
//the following should be added to get a correct DKIM-signature.
|
||||||
|
//Compare with $this->preSend()
|
||||||
|
if ($to === '') {
|
||||||
|
$to = 'undisclosed-recipients:;';
|
||||||
|
}
|
||||||
|
|
||||||
$params = null;
|
$params = null;
|
||||||
//This sets the SMTP envelope sender which gets turned into a return-path header by the receiver
|
//This sets the SMTP envelope sender which gets turned into a return-path header by the receiver
|
||||||
@@ -4470,6 +4477,7 @@ class PHPMailer
|
|||||||
'ics' => 'text/calendar',
|
'ics' => 'text/calendar',
|
||||||
'xml' => 'text/xml',
|
'xml' => 'text/xml',
|
||||||
'xsl' => 'text/xml',
|
'xsl' => 'text/xml',
|
||||||
|
'csv' => 'text/csv',
|
||||||
'wmv' => 'video/x-ms-wmv',
|
'wmv' => 'video/x-ms-wmv',
|
||||||
'mpeg' => 'video/mpeg',
|
'mpeg' => 'video/mpeg',
|
||||||
'mpe' => 'video/mpeg',
|
'mpe' => 'video/mpeg',
|
||||||
|
@@ -46,7 +46,7 @@ class POP3
|
|||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
const VERSION = '6.6.3';
|
const VERSION = '6.6.4';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default POP3 port number.
|
* Default POP3 port number.
|
||||||
|
@@ -35,7 +35,7 @@ class SMTP
|
|||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
const VERSION = '6.6.3';
|
const VERSION = '6.6.4';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SMTP line break constant.
|
* SMTP line break constant.
|
||||||
|
Reference in New Issue
Block a user