Update to Kirby 3.7.5

This commit is contained in:
Nico Hoffmann
2022-08-30 20:43:20 +02:00
parent d89a0a647c
commit 26541380c4
45 changed files with 191 additions and 199 deletions

View File

@@ -12,7 +12,6 @@ if (
}
if (is_file($autoloader = dirname(__DIR__) . '/vendor/autoload.php')) {
/**
* Always prefer a site-wide Composer autoloader
* 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;
} elseif (is_file($autoloader = __DIR__ . '/vendor/autoload.php')) {
/**
* Fall back to the local autoloader if that exists
*/
include $autoloader;
} else {
/**
* If neither one exists, don't bother searching;
* it's a custom directory setup and the users need to

View File

@@ -3,7 +3,7 @@
"description": "The Kirby 3 core",
"license": "proprietary",
"type": "kirby-cms",
"version": "3.7.4",
"version": "3.7.5",
"keywords": [
"kirby",
"cms",
@@ -36,12 +36,12 @@
"ext-libxml": "*",
"ext-mbstring": "*",
"ext-openssl": "*",
"claviska/simpleimage": "3.6.5",
"claviska/simpleimage": "3.7.0",
"filp/whoops": "2.14.5",
"getkirby/composer-installer": "^1.2.1",
"laminas/laminas-escaper": "2.10.0",
"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-mbstring": "1.26.0"
},

26
kirby/composer.lock generated
View File

@@ -4,20 +4,20 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "6bfdbfb7a38bb3e59ed5ce26db82cbb7",
"content-hash": "fb087946fb5ac5910e25a4d263905d99",
"packages": [
{
"name": "claviska/simpleimage",
"version": "3.6.5",
"version": "3.7.0",
"source": {
"type": "git",
"url": "https://github.com/claviska/SimpleImage.git",
"reference": "00f90662686696b9b7157dbb176183aabe89700f"
"reference": "abd15ced313c7b8041d7d73d8d2398b4f2510cf1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/claviska/SimpleImage/zipball/00f90662686696b9b7157dbb176183aabe89700f",
"reference": "00f90662686696b9b7157dbb176183aabe89700f",
"url": "https://api.github.com/repos/claviska/SimpleImage/zipball/abd15ced313c7b8041d7d73d8d2398b4f2510cf1",
"reference": "abd15ced313c7b8041d7d73d8d2398b4f2510cf1",
"shasum": ""
},
"require": {
@@ -45,7 +45,7 @@
"description": "A PHP class that makes working with images as simple as possible.",
"support": {
"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": [
{
@@ -53,7 +53,7 @@
"type": "github"
}
],
"time": "2021-12-01T12:42:55+00:00"
"time": "2022-07-05T13:18:44+00:00"
},
{
"name": "filp/whoops",
@@ -349,16 +349,16 @@
},
{
"name": "phpmailer/phpmailer",
"version": "v6.6.3",
"version": "v6.6.4",
"source": {
"type": "git",
"url": "https://github.com/PHPMailer/PHPMailer.git",
"reference": "9400f305a898f194caff5521f64e5dfa926626f3"
"reference": "a94fdebaea6bd17f51be0c2373ab80d3d681269b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/9400f305a898f194caff5521f64e5dfa926626f3",
"reference": "9400f305a898f194caff5521f64e5dfa926626f3",
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/a94fdebaea6bd17f51be0c2373ab80d3d681269b",
"reference": "a94fdebaea6bd17f51be0c2373ab80d3d681269b",
"shasum": ""
},
"require": {
@@ -415,7 +415,7 @@
"description": "PHPMailer is a full-featured email creation and transfer class for PHP",
"support": {
"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": [
{
@@ -423,7 +423,7 @@
"type": "github"
}
],
"time": "2022-06-20T09:21:02+00:00"
"time": "2022-08-22T09:22:00+00:00"
},
{
"name": "psr/log",

View File

@@ -101,7 +101,6 @@ return [
// check if the thumb already exists
if (file_exists($thumbRoot) === false) {
// if not, create job file
$job = $mediaRoot . '/.jobs/' . $thumbName . '.json';

View File

@@ -110,7 +110,6 @@ return [
if (empty($this->columns)) {
foreach ($this->fields as $field) {
// Skip hidden and unsaveable fields
// They should never be included as column
if ($field['type'] === 'hidden' || $field['saveable'] === false) {

View File

@@ -71,7 +71,6 @@ return [
// transform into value-text objects
return array_map(function ($option) use ($options) {
// already a valid object
if (is_array($option) === true && isset($option['value'], $option['text']) === true) {
return $option;

View File

@@ -10,6 +10,7 @@ return [
*/
'converter' => null,
'counter' => null,
'pattern' => null,
'spellcheck' => null,
/**

View File

@@ -3,7 +3,6 @@
use Kirby\Toolkit\I18n;
return function (array $props) {
// load the general templates setting for all sections
$templates = $props['templates'] ?? null;

View File

@@ -107,7 +107,6 @@ return function ($kirby) {
if ($kirby->multilang() === true) {
$after = LanguageRoutes::create($kirby);
} else {
// Single-language home
$after[] = [
'pattern' => '',

View File

@@ -214,7 +214,6 @@ return [
'title'
],
'html' => function ($tag) {
// get and sanitize the username
$username = str_replace('@', '', $tag->value);
@@ -246,6 +245,7 @@ return [
'height',
'loop',
'muted',
'playsinline',
'poster',
'preload',
'style',
@@ -288,12 +288,13 @@ return [
// booleans: autoplay, controls, loop, muted
// strings : poster, preload
// for ex : `autoplay` will not work if `false` is a `string` instead of a `boolean`
$attrs['autoplay'] = $autoplay = Str::toType($tag->autoplay, 'bool');
$attrs['controls'] = Str::toType($tag->controls ?? true, 'bool');
$attrs['loop'] = Str::toType($tag->loop, 'bool');
$attrs['muted'] = Str::toType($tag->muted ?? $autoplay, 'bool');
$attrs['poster'] = $tag->poster;
$attrs['preload'] = $tag->preload;
$attrs['autoplay'] = $autoplay = Str::toType($tag->autoplay, 'bool');
$attrs['controls'] = Str::toType($tag->controls ?? true, 'bool');
$attrs['loop'] = Str::toType($tag->loop, 'bool');
$attrs['muted'] = Str::toType($tag->muted ?? $autoplay, 'bool');
$attrs['playsinline'] = Str::toType($tag->playsinline ?? $autoplay, 'bool');
$attrs['poster'] = $tag->poster;
$attrs['preload'] = $tag->preload;
}
// handles local and remote video file

File diff suppressed because one or more lines are too long

View File

@@ -75,24 +75,24 @@ class FileCache extends Cache
$keyParts = [];
foreach (preg_split('#([\/\\\\])#', $key, 0, PREG_SPLIT_DELIM_CAPTURE) as $part) {
switch ($part) {
// forward slashes don't need special treatment
case '/':
// forward slashes don't need special treatment
break;
// backslashes get their own marker in the path
// to differentiate the cache key from one with forward slashes
case '\\':
// backslashes get their own marker in the path
// to differentiate the cache key from one with forward slashes
$keyParts[] = '_backslash';
break;
// empty part means two slashes in a row;
// special marker like for backslashes
case '':
// empty part means two slashes in a row;
// special marker like for backslashes
$keyParts[] = '_empty';
break;
// an actual path segment
default:
// an actual path segment:
// check if the segment only contains safe characters;
// underscores are *not* safe to guarantee uniqueness
// as they are used in the special cases

View File

@@ -461,7 +461,6 @@ class App
}
if ($contentType !== 'html') {
// no luck for a specific representation controller?
// let's try the html controller instead
if ($controller = $this->controllerLookup($name)) {

View File

@@ -506,7 +506,6 @@ class Blueprint
}
foreach ($fields as $fieldName => $fieldProps) {
// extend field from string
if (is_string($fieldProps) === true) {
$fieldProps = [
@@ -600,7 +599,6 @@ class Blueprint
protected function normalizeSections(string $tabName, array $sections): array
{
foreach ($sections as $sectionName => $sectionProps) {
// unset / remove section if its property is false
if ($sectionProps === false) {
unset($sections[$sectionName]);
@@ -686,7 +684,6 @@ class Blueprint
}
foreach ($tabs as $tabName => $tabProps) {
// unset / remove tab if its property is false
if ($tabProps === false) {
unset($tabs[$tabName]);

View File

@@ -106,7 +106,6 @@ class Email
protected function template(): void
{
if (isset($this->props['template']) === true) {
// prepare data to be passed to template
$data = $this->props['data'] ?? [];
@@ -123,7 +122,7 @@ class Email
$this->props['body']['text'] = $text->render($data);
}
// fallback to single email text template
// fallback to single email text template
} elseif ($text->exists()) {
$this->props['body'] = $text->render($data);
} else {

View File

@@ -194,7 +194,6 @@ trait FileActions
// run the hook
return $file->commit('create', compact('file', 'upload'), function ($file, $upload) {
// delete all public versions
$file->unpublish();
@@ -230,7 +229,6 @@ trait FileActions
public function delete(): bool
{
return $this->commit('delete', ['file' => $this], function ($file) {
// remove all versions in the media folder
$file->unpublish();
@@ -289,7 +287,6 @@ trait FileActions
];
return $this->commit('replace', $arguments, function ($file, $upload) {
// delete all public versions
$file->unpublish();

View File

@@ -60,7 +60,6 @@ class LanguageRouter
// only keep the scoped language routes
$routes = array_values(array_filter($routes, function ($route) use ($language) {
// no language scope
if (empty($route['language']) === true) {
return false;
@@ -82,7 +81,6 @@ class LanguageRouter
foreach ($routes as $index => $route) {
if ($pageId = ($route['page'] ?? null)) {
if ($page = $kirby->page($pageId)) {
// convert string patterns to arrays
$patterns = A::wrap($route['pattern']);

View File

@@ -23,7 +23,6 @@ class LanguageRoutes
$baseurl = $kirby->url();
foreach ($kirby->languages() as $language) {
// ignore languages with a different base url
if ($language->baseurl() !== $baseurl) {
continue;
@@ -66,7 +65,6 @@ class LanguageRoutes
'method' => 'ALL',
'env' => 'site',
'action' => function (string $path) use ($kirby) {
// check for content representations or files
$extension = F::extension($path);
@@ -115,7 +113,6 @@ class LanguageRoutes
'method' => 'ALL',
'env' => 'site',
'action' => function () use ($kirby) {
// find all languages with the same base url as the current installation
$languages = $kirby->languages()->filter('baseurl', $kirby->url());

View File

@@ -41,7 +41,6 @@ class Media
// try to find a file by model and filename
// this should work for all original files
if ($file = $model->file($filename)) {
// check if the request contained an outdated media hash
if ($file->mediaHash() !== $hash) {
// if at least the token was correct, redirect

View File

@@ -83,7 +83,6 @@ abstract class ModelWithContent extends Model
*/
public function content(string $languageCode = null)
{
// single language support
if ($this->kirby()->multilang() === false) {
if (is_a($this->content, 'Kirby\Cms\Content') === true) {
@@ -95,7 +94,6 @@ abstract class ModelWithContent extends Model
// multi language support
} else {
// only fetch from cache for the default language
if ($languageCode === null && is_a($this->content, 'Kirby\Cms\Content') === true) {
return $this->content;

View File

@@ -478,7 +478,6 @@ trait PageActions
// run the hooks and creation action
$page = $page->commit('create', ['page' => $page, 'input' => $props], function ($page, $props) {
// always create pages in the default language
if ($page->kirby()->multilang() === true) {
$languageCode = $page->kirby()->defaultLanguage()->code();
@@ -594,7 +593,6 @@ trait PageActions
public function delete(bool $force = false): bool
{
return $this->commit('delete', ['page' => $this, 'force' => $force], function ($page, $force) {
// delete all files individually
foreach ($page->files() as $file) {
$file->delete();
@@ -607,7 +605,6 @@ trait PageActions
// actually remove the page from disc
if ($page->exists() === true) {
// delete all public media files
Dir::remove($page->mediaRoot());

View File

@@ -119,7 +119,6 @@ class PageBlueprint extends Blueprint
// clean up and translate each status
foreach ($status as $key => $options) {
// skip invalid status definitions
if (in_array($key, ['draft', 'listed', 'unlisted']) === false || $options === false) {
unset($status[$key]);

View File

@@ -648,7 +648,6 @@ class User extends ModelWithContent
// if there's an authenticated user …
if ($user = $kirby->user()) {
// admin users can select pretty much any role
if ($user->isAdmin() === true) {
// except if the user is the last admin

View File

@@ -380,7 +380,6 @@ class Database
// store the final sql to add it to the trace later
$this->lastQuery = $this->statement->queryString;
} catch (Throwable $e) {
// store the error
$this->affected = 0;
$this->lastError = $e;

View File

@@ -407,7 +407,7 @@ class Query
$mode = A::last($args);
// 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
array_pop($args);
}
@@ -431,7 +431,7 @@ class Query
$mode = A::last($args);
// 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
array_pop($args);
}
@@ -941,7 +941,7 @@ class Query
$result = '';
// 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
array_pop($args);
} else {
@@ -956,14 +956,12 @@ class Query
// ->where('username like "myuser"');
} elseif (is_string($args[0]) === true) {
// simply add the entire string to the where clause
// escaping or using bindings has to be done before calling this method
$result = $args[0];
// ->where(['username' => 'myuser']);
} elseif (is_array($args[0]) === true) {
// simple array mode (AND operator)
$sql = $this->database->sql()->values($this->table, $args[0], ' AND ', true, true);
@@ -990,7 +988,6 @@ class Query
// ->where('username like :username', ['username' => 'myuser'])
if (is_string($args[0]) === true && is_array($args[1]) === true) {
// prepared where clause
$result = $args[0];
@@ -999,7 +996,6 @@ class Query
// ->where('username like ?', 'myuser')
} elseif (is_string($args[0]) === true && is_string($args[1]) === true) {
// prepared where clause
$result = $args[0];
@@ -1012,7 +1008,6 @@ class Query
// ->where('username', 'like', 'myuser');
if (is_string($args[0]) === true && is_string($args[1]) === true) {
// validate column
$sql = $this->database->sql();
$key = $sql->columnName($this->table, $args[0]);
@@ -1061,7 +1056,6 @@ class Query
}
break;
}
// attach the where clause

View File

@@ -672,7 +672,6 @@ abstract class Sql
// array of columns
if (is_array($columns) === true) {
// validate columns
$result = [];
@@ -704,16 +703,16 @@ abstract class Sql
$parts = preg_split('/(?:`[^`]*`|"[^"]*")(*SKIP)(*F)|\./', $identifier);
switch (count($parts)) {
// non-qualified identifier
case 1:
// non-qualified identifier
return [$table, $this->unquoteIdentifier($parts[0])];
// qualified identifier
case 2:
// qualified identifier
return [$this->unquoteIdentifier($parts[0]), $this->unquoteIdentifier($parts[1])];
// every other number is an error
default:
// every other number is an error
throw new InvalidArgumentException('Invalid identifier ' . $identifier);
}
}

View File

@@ -239,7 +239,6 @@ class Dir
natsort($items);
foreach ($items as $item) {
// ignore all items with a leading dot
if (in_array(substr($item, 0, 1), ['.', '_']) === true) {
continue;
@@ -248,7 +247,6 @@ class Dir
$root = $dir . '/' . $item;
if (is_dir($root) === true) {
// extract the slug and num of the directory
if (preg_match('/^([0-9]+)' . static::$numSeparator . '(.*)$/', $item, $match)) {
$num = (int)$match[1];
@@ -313,7 +311,6 @@ class Dir
*/
protected static function inventoryContent(array $inventory, array $content): array
{
// filter meta files from the content file
if (empty($content) === true) {
$inventory['template'] = 'default';
@@ -321,7 +318,6 @@ class Dir
}
foreach ($content as $contentName) {
// could be a meta file. i.e. cover.jpg
if (isset($inventory['files'][$contentName]) === true) {
continue;

View File

@@ -73,7 +73,6 @@ class Form
$this->values = [];
foreach ($fields as $name => $props) {
// inject stuff from the form constructor (model, etc.)
$props = array_merge($inject, $props);
@@ -104,7 +103,6 @@ class Form
}
if ($strict !== true) {
// use all given values, no matter
// if there's a field or not.
$input = array_merge($values, $input);

View File

@@ -314,7 +314,6 @@ class Panel
// create a micro-router for the Panel
return Router::execute($path, $method = $kirby->request()->method(), $routes, function ($route) use ($areas, $kirby, $method, $path) {
// route needs authentication?
$auth = $route->attributes()['auth'] ?? true;
$areaId = $route->attributes()['area'] ?? null;
@@ -416,7 +415,6 @@ class Panel
$routes = [];
foreach ($dialogs as $key => $dialog) {
// create the full pattern with dialogs prefix
$pattern = 'dialogs/' . trim(($dialog['pattern'] ?? $key), '/');
@@ -492,7 +490,6 @@ class Panel
$routes = [];
foreach ($searches as $name => $params) {
// create the full routing pattern
$pattern = 'search/' . $name;

View File

@@ -420,7 +420,6 @@ class View
// if requested, send $fiber data as JSON
if (Panel::isFiberRequest() === true) {
// filter data, if only or globals headers or
// query parameters are set
$fiber = static::apply($fiber);

View File

@@ -177,7 +177,6 @@ class A
}
foreach ($array2 as $key => $value) {
// append to the merged array, don't overwrite numeric keys
if (is_int($key) === true && $mode === static::MERGE_APPEND) {
$merged[] = $value;

View File

@@ -525,7 +525,6 @@ class Collection extends Iterator implements Countable
*/
public function group($field, bool $i = true)
{
// group by field name
if (is_string($field) === true) {
return $this->group(function ($item) use ($field, $i) {
@@ -541,7 +540,6 @@ class Collection extends Iterator implements Countable
$groups = [];
foreach ($this->data as $key => $item) {
// get the value to group by
$value = $field($item);
@@ -1005,7 +1003,6 @@ class Collection extends Iterator implements Countable
$fields = [];
foreach ($args as $arg) {
// get the index of the latest field array inside the $fields array
$currentField = $fields ? count($fields) - 1 : 0;

View File

@@ -585,17 +585,17 @@ class Html extends Xml
};
switch ($path->toString()) {
// playlists
case 'embed/videoseries':
case 'playlist':
// playlists
if ($isYoutubeId($query->list) === true) {
$src = $host . '/videoseries';
}
break;
// regular video URLs
case 'watch':
// regular video URLs
if ($isYoutubeId($query->v) === true) {
$src = $host . '/' . $query->v;

View File

@@ -81,7 +81,6 @@ class Pagination
*/
return $a;
} elseif (is_array($a) === true) {
/**
* First argument is an option array
*
@@ -89,7 +88,6 @@ class Pagination
*/
$params = $a;
} elseif (is_int($a) === true && $b === null) {
/**
* First argument is the limit
*
@@ -97,7 +95,6 @@ class Pagination
*/
$params['limit'] = $a;
} elseif (is_int($a) === true && is_int($b) === true) {
/**
* First argument is the limit,
* second argument is the page
@@ -107,7 +104,6 @@ class Pagination
$params['limit'] = $a;
$params['page'] = $b;
} elseif (is_int($a) === true && is_array($b) === true) {
/**
* First argument is the limit,
* second argument are options

View File

@@ -122,7 +122,6 @@ trait Properties
// handle empty values
if ($value === null) {
// replace null with a default value, if a default handler exists
if (method_exists($this, 'default' . $name) === true) {
$value = $this->{'default' . $name}();

View File

@@ -846,11 +846,9 @@ class Str
if (is_int($replacement['limit']) === false) {
throw new Exception('Invalid limit "' . $replacement['limit'] . '".');
} elseif ($replacement['limit'] === -1) {
// no limit, we don't need our special replacement routine
$string = str_replace($replacement['search'], $replacement['replace'], $string);
} elseif ($replacement['limit'] > 0) {
// limit given, only replace for $replacement['limit'] times per replacement
$position = -1;

View File

@@ -31,7 +31,8 @@ class SimpleImage {
ERR_LIB_NOT_LOADED = 8,
ERR_UNSUPPORTED_FORMAT = 9,
ERR_WEBP_NOT_ENABLED = 10,
ERR_WRITE = 11;
ERR_WRITE = 11,
ERR_INVALID_FLAG = 12;
protected $image;
@@ -46,9 +47,10 @@ class SimpleImage {
* Creates a new SimpleImage object.
*
* @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.
*/
public function __construct($image = '') {
public function __construct($image = '', $flags = []) {
// Check for the required GD extension
if(extension_loaded('gd')) {
// 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);
}
// 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
if(preg_match('/^data:(.*?);/', $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
//////////////////////////////////////////////////////////////////////////////////////////////////
@@ -118,70 +161,66 @@ class SimpleImage {
* Loads an image from a file.
*
* @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.
* @return \claviska\SimpleImage
*/
public function fromFile($file) {
// Check if the file exists and is readable. We're using fopen() instead of file_exists()
// because not all URL wrappers support the latter.
$handle = @fopen($file, 'r');
if($handle === false) {
// Set fopen options.
$sslVerify = $this->getFlag("sslVerify"); // Don't perform peer validation when true
$opts = [
"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);
}
fclose($handle);
// Create image object from string
$this->image = imagecreatefromstring($file);
// Get image info
$info = @getimagesize($file);
$info = @getimagesizefromstring($file);
if($info === false) {
throw new \Exception("Invalid image file: $file", self::ERR_INVALID_IMAGE);
}
$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) {
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
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;
}

View File

@@ -285,9 +285,6 @@ return array(
'Psr\\Log\\LoggerInterface' => $vendorDir . '/psr/log/Psr/Log/LoggerInterface.php',
'Psr\\Log\\LoggerTrait' => $vendorDir . '/psr/log/Psr/Log/LoggerTrait.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',
'Symfony\\Polyfill\\Intl\\Idn\\Idn' => $vendorDir . '/symfony/polyfill-intl-idn/Idn.php',
'Symfony\\Polyfill\\Intl\\Idn\\Info' => $vendorDir . '/symfony/polyfill-intl-idn/Info.php',

View File

@@ -377,9 +377,6 @@ class ComposerStaticInita8011b477bb239488e5d139cdeb7b31e
'Psr\\Log\\LoggerInterface' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerInterface.php',
'Psr\\Log\\LoggerTrait' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerTrait.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',
'Symfony\\Polyfill\\Intl\\Idn\\Idn' => __DIR__ . '/..' . '/symfony/polyfill-intl-idn/Idn.php',
'Symfony\\Polyfill\\Intl\\Idn\\Info' => __DIR__ . '/..' . '/symfony/polyfill-intl-idn/Info.php',

View File

@@ -2,17 +2,17 @@
"packages": [
{
"name": "claviska/simpleimage",
"version": "3.6.5",
"version_normalized": "3.6.5.0",
"version": "3.7.0",
"version_normalized": "3.7.0.0",
"source": {
"type": "git",
"url": "https://github.com/claviska/SimpleImage.git",
"reference": "00f90662686696b9b7157dbb176183aabe89700f"
"reference": "abd15ced313c7b8041d7d73d8d2398b4f2510cf1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/claviska/SimpleImage/zipball/00f90662686696b9b7157dbb176183aabe89700f",
"reference": "00f90662686696b9b7157dbb176183aabe89700f",
"url": "https://api.github.com/repos/claviska/SimpleImage/zipball/abd15ced313c7b8041d7d73d8d2398b4f2510cf1",
"reference": "abd15ced313c7b8041d7d73d8d2398b4f2510cf1",
"shasum": ""
},
"require": {
@@ -20,7 +20,7 @@
"league/color-extractor": "0.3.*",
"php": ">=5.6.0"
},
"time": "2021-12-01T12:42:55+00:00",
"time": "2022-07-05T13:18:44+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@@ -42,7 +42,7 @@
"description": "A PHP class that makes working with images as simple as possible.",
"support": {
"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": [
{
@@ -361,17 +361,17 @@
},
{
"name": "phpmailer/phpmailer",
"version": "v6.6.3",
"version_normalized": "6.6.3.0",
"version": "v6.6.4",
"version_normalized": "6.6.4.0",
"source": {
"type": "git",
"url": "https://github.com/PHPMailer/PHPMailer.git",
"reference": "9400f305a898f194caff5521f64e5dfa926626f3"
"reference": "a94fdebaea6bd17f51be0c2373ab80d3d681269b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/9400f305a898f194caff5521f64e5dfa926626f3",
"reference": "9400f305a898f194caff5521f64e5dfa926626f3",
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/a94fdebaea6bd17f51be0c2373ab80d3d681269b",
"reference": "a94fdebaea6bd17f51be0c2373ab80d3d681269b",
"shasum": ""
},
"require": {
@@ -398,7 +398,7 @@
"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)"
},
"time": "2022-06-20T09:21:02+00:00",
"time": "2022-08-22T09:22:00+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@@ -430,7 +430,7 @@
"description": "PHPMailer is a full-featured email creation and transfer class for PHP",
"support": {
"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": [
{

View File

@@ -1,8 +1,8 @@
<?php return array(
'root' => array(
'name' => 'getkirby/cms',
'pretty_version' => '3.7.4',
'version' => '3.7.4.0',
'pretty_version' => '3.7.5',
'version' => '3.7.5.0',
'reference' => NULL,
'type' => 'kirby-cms',
'install_path' => __DIR__ . '/../../',
@@ -11,9 +11,9 @@
),
'versions' => array(
'claviska/simpleimage' => array(
'pretty_version' => '3.6.5',
'version' => '3.6.5.0',
'reference' => '00f90662686696b9b7157dbb176183aabe89700f',
'pretty_version' => '3.7.0',
'version' => '3.7.0.0',
'reference' => 'abd15ced313c7b8041d7d73d8d2398b4f2510cf1',
'type' => 'library',
'install_path' => __DIR__ . '/../claviska/simpleimage',
'aliases' => array(),
@@ -29,8 +29,8 @@
'dev_requirement' => false,
),
'getkirby/cms' => array(
'pretty_version' => '3.7.4',
'version' => '3.7.4.0',
'pretty_version' => '3.7.5',
'version' => '3.7.5.0',
'reference' => NULL,
'type' => 'kirby-cms',
'install_path' => __DIR__ . '/../../',
@@ -80,9 +80,9 @@
'dev_requirement' => false,
),
'phpmailer/phpmailer' => array(
'pretty_version' => 'v6.6.3',
'version' => '6.6.3.0',
'reference' => '9400f305a898f194caff5521f64e5dfa926626f3',
'pretty_version' => 'v6.6.4',
'version' => '6.6.4.0',
'reference' => 'a94fdebaea6bd17f51be0c2373ab80d3d681269b',
'type' => 'library',
'install_path' => __DIR__ . '/../phpmailer/phpmailer',
'aliases' => array(),

View File

@@ -5,22 +5,29 @@
* @package PHPMailer
*/
$PHPMAILER_LANG['authenticate'] = 'SMTP Σφάλμα: Αδυναμία πιστοποίησης (authentication).';
$PHPMAILER_LANG['connect_host'] = 'SMTP Σφάλμα: Αδυναμία σύνδεσης στον SMTP-Host.';
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Σφάλμα: Τα δεδομένα δεν έγιναν αποδεκτά.';
$PHPMAILER_LANG['empty_message'] = 'Το E-Mail δεν έχει περιεχόμενο .';
$PHPMAILER_LANG['encoding'] = 'Αγνωστο Encoding-Format: ';
$PHPMAILER_LANG['execute'] = 'Αδυναμία εκτέλεσης ακόλουθης εντολής: ';
$PHPMAILER_LANG['file_access'] = 'Αδυναμία προσπέλασης του αρχείου: ';
$PHPMAILER_LANG['file_open'] = 'Σφάλμα Αρχείου: Δεν είναι δυνατό το άνοιγμα του ακόλουθου αρχείου: ';
$PHPMAILER_LANG['from_failed'] = 'Η παρακάτω διεύθυνση αποστολέα δεν είναι σωστή: ';
$PHPMAILER_LANG['instantiate'] = 'Αδυναμία εκκίνησης Mail function.';
$PHPMAILER_LANG['invalid_address'] = 'Το μήνυμα δεν εστάλη, η διεύθυνση δεν είναι έγκυρη: ';
$PHPMAILER_LANG['authenticate'] = 'Σφάλμα SMTP: Αδυναμία πιστοποίησης.';
$PHPMAILER_LANG['buggy_php'] = 'Η έκδοση PHP που χρησιμοποιείτε παρουσιάζει σφάλμα που μπορεί να έχει ως αποτέλεσμα κατεστραμένα μηνύματα. Για να το διορθώσετε, αλλάξτε τον τρόπο αποστολής σε SMTP, απενεργοποιήστε την επιλογή mail.add_x_header στο αρχείο php.ini, αλλάξτε λειτουργικό σε MacOS ή Linux ή αναβαθμίστε την PHP σε έκδοση 7.0.17+ ή 7.1.3+.';
$PHPMAILER_LANG['connect_host'] = 'Σφάλμα SMTP: Αδυναμία σύνδεσης με τον φιλοξενητή SMTP.';
$PHPMAILER_LANG['data_not_accepted'] = 'Σφάλμα SMTP: Μη αποδεκτά δεδομένα.';
$PHPMAILER_LANG['empty_message'] = 'Η ηλεκτρονική επιστολή δεν έχει περιεχόμενο.';
$PHPMAILER_LANG['encoding'] = 'Άγνωστη μορφή κωδικοποίησης: ';
$PHPMAILER_LANG['execute'] = 'Αδυναμία εκτέλεσης: ';
$PHPMAILER_LANG['extension_missing'] = 'Απουσία επέκτασης: ';
$PHPMAILER_LANG['file_access'] = 'Αδυναμία πρόσβασης στο αρχείο: ';
$PHPMAILER_LANG['file_open'] = 'Σφάλμα Αρχείου: Αδυναμία ανοίγματος αρχείου: ';
$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['provide_address'] = 'Παρακαλούμε δώστε τουλάχιστον μια e-mail διεύθυνση παραλήπτη.';
$PHPMAILER_LANG['recipients_failed'] = 'SMTP Σφάλμα: Οι παρακάτω διευθύνσεις παραλήπτη δεν είναι έγκυρες: ';
$PHPMAILER_LANG['provide_address'] = 'Δώστε τουλάχιστον μια ηλεκτρονική διεύθυνση παραλήπτη.';
$PHPMAILER_LANG['recipients_failed'] = 'Σφάλμα SMTP: Οι παρακάτω διευθύνσεις παραλήπτη δεν είναι έγκυρες: ';
$PHPMAILER_LANG['signing'] = 'Σφάλμα υπογραφής: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'Αποτυχία σύνδεσης στον SMTP Server.';
$PHPMAILER_LANG['smtp_error'] = 'Σφάλμα από τον SMTP Server: ';
$PHPMAILER_LANG['variable_set'] = 'Αδυναμία ορισμού ή αρχικοποίησης μεταβλητής: ';
//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';
$PHPMAILER_LANG['smtp_code'] = 'Κώδικάς SMTP: ';
$PHPMAILER_LANG['smtp_code_ex'] = 'Πρόσθετες πληροφορίες SMTP: ';
$PHPMAILER_LANG['smtp_connect_failed'] = 'Αποτυχία σύνδεσης SMTP.';
$PHPMAILER_LANG['smtp_detail'] = 'Λεπτομέρεια: ';
$PHPMAILER_LANG['smtp_error'] = 'Σφάλμα με τον διακομιστή SMTP: ';
$PHPMAILER_LANG['variable_set'] = 'Αδυναμία ορισμού ή επαναφοράς μεταβλητής: ';

View File

@@ -350,8 +350,8 @@ class PHPMailer
public $Password = '';
/**
* SMTP auth type.
* Options are CRAM-MD5, LOGIN, PLAIN, XOAUTH2, attempted in that order if not specified.
* SMTP authentication type. Options are CRAM-MD5, LOGIN, PLAIN, XOAUTH2.
* If not specified, the first one from that list that the server supports will be selected.
*
* @var string
*/
@@ -750,7 +750,7 @@ class PHPMailer
*
* @var string
*/
const VERSION = '6.6.3';
const VERSION = '6.6.4';
/**
* Error severity: message only, continue processing.
@@ -1096,7 +1096,7 @@ class PHPMailer
return false;
}
if ($name !== null) {
if ($name !== null && is_string($name)) {
$name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim
} else {
$name = '';
@@ -1288,7 +1288,7 @@ class PHPMailer
*/
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
//Don't validate now addresses with IDN. Will be done in send().
$pos = strrpos($address, '@');
@@ -1891,7 +1891,14 @@ class PHPMailer
foreach ($this->to as $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;
//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',
'xml' => 'text/xml',
'xsl' => 'text/xml',
'csv' => 'text/csv',
'wmv' => 'video/x-ms-wmv',
'mpeg' => 'video/mpeg',
'mpe' => 'video/mpeg',

View File

@@ -46,7 +46,7 @@ class POP3
*
* @var string
*/
const VERSION = '6.6.3';
const VERSION = '6.6.4';
/**
* Default POP3 port number.

View File

@@ -35,7 +35,7 @@ class SMTP
*
* @var string
*/
const VERSION = '6.6.3';
const VERSION = '6.6.4';
/**
* SMTP line break constant.