Upgrade to 3.5.7

This commit is contained in:
Bastian Allgeier
2021-07-02 11:34:29 +02:00
parent 5358f8885c
commit 62b533a28f
37 changed files with 329 additions and 233 deletions

View File

@@ -8,7 +8,7 @@
"core" "core"
], ],
"homepage": "https://getkirby.com", "homepage": "https://getkirby.com",
"version": "3.5.6", "version": "3.5.7",
"license": "proprietary", "license": "proprietary",
"authors": [ "authors": [
{ {
@@ -27,7 +27,7 @@
"laminas/laminas-escaper": "2.7.0", "laminas/laminas-escaper": "2.7.0",
"michelf/php-smartypants": "1.8.1", "michelf/php-smartypants": "1.8.1",
"mustangostang/spyc": "0.6.3", "mustangostang/spyc": "0.6.3",
"phpmailer/phpmailer": "6.4.1", "phpmailer/phpmailer": "6.5.0",
"true/punycode": "2.1.1" "true/punycode": "2.1.1"
}, },
"config": { "config": {

24
kirby/composer.lock generated
View File

@@ -4,7 +4,7 @@
"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": "78eb32b81134b851388c57f7f3007b9f", "content-hash": "e02ab3eeb053451df9880dfd3ebabba8",
"packages": [ "packages": [
{ {
"name": "claviska/simpleimage", "name": "claviska/simpleimage",
@@ -238,16 +238,16 @@
}, },
{ {
"name": "laminas/laminas-zendframework-bridge", "name": "laminas/laminas-zendframework-bridge",
"version": "1.2.0", "version": "1.3.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/laminas/laminas-zendframework-bridge.git", "url": "https://github.com/laminas/laminas-zendframework-bridge.git",
"reference": "6cccbddfcfc742eb02158d6137ca5687d92cee32" "reference": "13af2502d9bb6f7d33be2de4b51fb68c6cdb476e"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/laminas/laminas-zendframework-bridge/zipball/6cccbddfcfc742eb02158d6137ca5687d92cee32", "url": "https://api.github.com/repos/laminas/laminas-zendframework-bridge/zipball/13af2502d9bb6f7d33be2de4b51fb68c6cdb476e",
"reference": "6cccbddfcfc742eb02158d6137ca5687d92cee32", "reference": "13af2502d9bb6f7d33be2de4b51fb68c6cdb476e",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -296,7 +296,7 @@
"type": "community_bridge" "type": "community_bridge"
} }
], ],
"time": "2021-02-25T21:54:58+00:00" "time": "2021-06-24T12:49:22+00:00"
}, },
{ {
"name": "league/color-extractor", "name": "league/color-extractor",
@@ -462,16 +462,16 @@
}, },
{ {
"name": "phpmailer/phpmailer", "name": "phpmailer/phpmailer",
"version": "v6.4.1", "version": "v6.5.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/PHPMailer/PHPMailer.git", "url": "https://github.com/PHPMailer/PHPMailer.git",
"reference": "9256f12d8fb0cd0500f93b19e18c356906cbed3d" "reference": "a5b5c43e50b7fba655f793ad27303cd74c57363c"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/9256f12d8fb0cd0500f93b19e18c356906cbed3d", "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/a5b5c43e50b7fba655f793ad27303cd74c57363c",
"reference": "9256f12d8fb0cd0500f93b19e18c356906cbed3d", "reference": "a5b5c43e50b7fba655f793ad27303cd74c57363c",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -526,7 +526,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.4.1" "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.5.0"
}, },
"funding": [ "funding": [
{ {
@@ -534,7 +534,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2021-04-29T12:25:04+00:00" "time": "2021-06-16T14:33:43+00:00"
}, },
{ {
"name": "psr/log", "name": "psr/log",

View File

@@ -59,7 +59,7 @@ return function ($kirby) {
} }
], ],
[ [
'pattern' => $media . '/plugins/(:any)/(:any)/(:all).(css|gif|js|jpg|png|svg|webp|woff2|woff)', 'pattern' => $media . '/plugins/(:any)/(:any)/(:all).(css|map|gif|js|mjs|jpg|png|svg|webp|avif|woff2|woff|json)',
'env' => 'media', 'env' => 'media',
'action' => function (string $provider, string $pluginName, string $filename, string $extension) { 'action' => function (string $provider, string $pluginName, string $filename, string $extension) {
return PluginAssets::resolve($provider . '/' . $pluginName, $filename . '.' . $extension); return PluginAssets::resolve($provider . '/' . $pluginName, $filename . '.' . $extension);

View File

@@ -1,6 +1,7 @@
<?php <?php
use Kirby\Cms\File; use Kirby\Cms\File;
use Kirby\Toolkit\Escape;
use Kirby\Toolkit\I18n; use Kirby\Toolkit\I18n;
return [ return [
@@ -116,6 +117,13 @@ return [
foreach ($this->files as $file) { foreach ($this->files as $file) {
$image = $file->panelImage($this->image); $image = $file->panelImage($this->image);
// escape the default text
// TODO: no longer needed in 3.6
$text = $file->toString($this->text);
if ($this->text === '{{ file.filename }}') {
$text = Escape::html($text);
}
$data[] = [ $data[] = [
'dragText' => $file->dragText('auto', $dragTextAbsolute), 'dragText' => $file->dragText('auto', $dragTextAbsolute),
'extension' => $file->extension(), 'extension' => $file->extension(),
@@ -127,7 +135,7 @@ return [
'link' => $file->panelUrl(true), 'link' => $file->panelUrl(true),
'mime' => $file->mime(), 'mime' => $file->mime(),
'parent' => $file->parent()->panelPath(), 'parent' => $file->parent()->panelPath(),
'text' => $file->toString($this->text), 'text' => $text,
'url' => $file->url(), 'url' => $file->url(),
]; ];
} }

View File

@@ -2,6 +2,7 @@
use Kirby\Cms\Blueprint; use Kirby\Cms\Blueprint;
use Kirby\Toolkit\A; use Kirby\Toolkit\A;
use Kirby\Toolkit\Escape;
use Kirby\Toolkit\I18n; use Kirby\Toolkit\I18n;
return [ return [
@@ -153,10 +154,17 @@ return [
$permissions = $item->permissions(); $permissions = $item->permissions();
$image = $item->panelImage($this->image); $image = $item->panelImage($this->image);
// escape the default text
// TODO: no longer needed in 3.6
$text = $item->toString($this->text);
if ($this->text === '{{ page.title }}') {
$text = Escape::html($text);
}
$data[] = [ $data[] = [
'id' => $item->id(), 'id' => $item->id(),
'dragText' => $item->dragText(), 'dragText' => $item->dragText(),
'text' => $item->toString($this->text), 'text' => $text,
'info' => $item->toString($this->info ?? false), 'info' => $item->toString($this->info ?? false),
'parent' => $item->parentId(), 'parent' => $item->parentId(),
'icon' => $item->panelIcon($image), 'icon' => $item->panelIcon($image),

View File

@@ -43,8 +43,8 @@
"error.access.code": "Neplatný kód", "error.access.code": "Neplatný kód",
"error.access.login": "Neplatné přihlášení", "error.access.login": "Neplatné přihlášení",
"error.access.panel": "Nemáte povoleno vstoupit do panelu", "error.access.panel": "Nemáte oprávnění k přihlášení do panelu",
"error.access.view": "Nejste oprávněni vstoupit do této části panelu.", "error.access.view": "Nete oprávnění ke vstupu do této části panelu.",
"error.avatar.create.fail": "Nebylo možné nahrát profilový obrázek", "error.avatar.create.fail": "Nebylo možné nahrát profilový obrázek",
"error.avatar.delete.fail": "Nebylo mo\u017en\u00e9 smazat profilov\u00fd obr\u00e1zek", "error.avatar.delete.fail": "Nebylo mo\u017en\u00e9 smazat profilov\u00fd obr\u00e1zek",
@@ -118,7 +118,7 @@
"error.page.duplicate.permission": "Nemáte dovoleno duplikovat \"{slug}\"", "error.page.duplicate.permission": "Nemáte dovoleno duplikovat \"{slug}\"",
"error.page.notFound": "Str\u00e1nku se nepoda\u0159ilo nal\u00e9zt.", "error.page.notFound": "Str\u00e1nku se nepoda\u0159ilo nal\u00e9zt.",
"error.page.num.invalid": "Zadejte prosím platné pořadové číslo. Čísla nesmí být záporná.", "error.page.num.invalid": "Zadejte prosím platné pořadové číslo. Čísla nesmí být záporná.",
"error.page.slug.invalid": "Please enter a valid URL appendix", "error.page.slug.invalid": "Podtržení",
"error.page.slug.maxlength": "URL musí mít méně než \"{length}\" znaků", "error.page.slug.maxlength": "URL musí mít méně než \"{length}\" znaků",
"error.page.sort.permission": "Stránce \"{slug}\" nelze změnit pořadí", "error.page.sort.permission": "Stránce \"{slug}\" nelze změnit pořadí",
"error.page.status.invalid": "Nastavte prosím platný status stránky", "error.page.status.invalid": "Nastavte prosím platný status stránky",
@@ -163,7 +163,7 @@
"error.user.password.invalid": "Zadejte prosím platné heslo. Heslo musí být dlouhé alespoň 8 znaků.", "error.user.password.invalid": "Zadejte prosím platné heslo. Heslo musí být dlouhé alespoň 8 znaků.",
"error.user.password.notSame": "Pros\u00edm potvr\u010fte heslo", "error.user.password.notSame": "Pros\u00edm potvr\u010fte heslo",
"error.user.password.undefined": "Uživatel nemá nastavené heslo.", "error.user.password.undefined": "Uživatel nemá nastavené heslo.",
"error.user.password.wrong": "Wrong password", "error.user.password.wrong": "Špatné heslo",
"error.user.role.invalid": "Zadejte prosím platnou roli", "error.user.role.invalid": "Zadejte prosím platnou roli",
"error.user.update.permission": "Nemáte dovoleno upravit uživatele \"{name}\"", "error.user.update.permission": "Nemáte dovoleno upravit uživatele \"{name}\"",
@@ -372,11 +372,11 @@
"more": "Více", "more": "Více",
"name": "Jméno", "name": "Jméno",
"next": "Další", "next": "Další",
"no": "no", "no": "ne",
"off": "vypnuto", "off": "vypnuto",
"on": "zapnuto", "on": "zapnuto",
"open": "Otevřít", "open": "Otevřít",
"open.newWindow": "Open in new window", "open.newWindow": "Otevřít v novém okně",
"options": "Možnosti", "options": "Možnosti",
"options.none": "Žádné možnosti", "options.none": "Žádné možnosti",
@@ -468,9 +468,9 @@
"toolbar.button.file.select": "Vyberte soubor", "toolbar.button.file.select": "Vyberte soubor",
"toolbar.button.file.upload": "Nahrajte soubor", "toolbar.button.file.upload": "Nahrajte soubor",
"toolbar.button.link": "Odkaz", "toolbar.button.link": "Odkaz",
"toolbar.button.strike": "Strike-through", "toolbar.button.strike": "Přeškrtnutí",
"toolbar.button.ol": "Číslovaný seznam", "toolbar.button.ol": "Číslovaný seznam",
"toolbar.button.underline": "Underline", "toolbar.button.underline": "Podtržení",
"toolbar.button.ul": "Odrážkový seznam", "toolbar.button.ul": "Odrážkový seznam",
"translation.author": "Kirby tým", "translation.author": "Kirby tým",
@@ -523,5 +523,5 @@
"welcome": "Vítejte", "welcome": "Vítejte",
"year": "Rok", "year": "Rok",
"yes": "yes" "yes": "ano"
} }

View File

@@ -6,8 +6,8 @@
"change": "Zmie\u0144", "change": "Zmie\u0144",
"close": "Zamknij", "close": "Zamknij",
"confirm": "Ok", "confirm": "Ok",
"collapse": "Collapse", "collapse": "Zwiń",
"collapse.all": "Collapse All", "collapse.all": "Zwiń wszystkie",
"copy": "Kopiuj", "copy": "Kopiuj",
"create": "Utwórz", "create": "Utwórz",
@@ -24,15 +24,15 @@
"days.wed": "\u015ar", "days.wed": "\u015ar",
"delete": "Usu\u0144", "delete": "Usu\u0144",
"delete.all": "Delete all", "delete.all": "Usuń wszystkie",
"dimensions": "Wymiary", "dimensions": "Wymiary",
"disabled": "Wyłączone", "disabled": "Wyłączone",
"discard": "Odrzu\u0107", "discard": "Odrzu\u0107",
"download": "Pobierz", "download": "Pobierz",
"duplicate": "Zduplikuj", "duplicate": "Zduplikuj",
"edit": "Edytuj", "edit": "Edytuj",
"expand": "Expand", "expand": "Rozwiń",
"expand.all": "Expand All", "expand.all": "Rozwiń wszystkie",
"dialog.files.empty": "Brak plików do wyboru", "dialog.files.empty": "Brak plików do wyboru",
"dialog.pages.empty": "Brak stron do wyboru", "dialog.pages.empty": "Brak stron do wyboru",
@@ -41,7 +41,7 @@
"email": "Email", "email": "Email",
"email.placeholder": "mail@example.com", "email.placeholder": "mail@example.com",
"error.access.code": "Invalid code", "error.access.code": "Nieprawidłowy kod",
"error.access.login": "Nieprawidłowy login", "error.access.login": "Nieprawidłowy login",
"error.access.panel": "Nie masz uprawnień by dostać się do panelu", "error.access.panel": "Nie masz uprawnień by dostać się do panelu",
"error.access.view": "Nie masz uprawnień, by dostać się do tej części panelu", "error.access.view": "Nie masz uprawnień, by dostać się do tej części panelu",
@@ -53,11 +53,11 @@
"error.blueprint.notFound": "Nie udało się załadować wzorca \"{name}\"", "error.blueprint.notFound": "Nie udało się załadować wzorca \"{name}\"",
"error.blocks.max.plural": "You must not add more than {max} blocks", "error.blocks.max.plural": "Możesz dodać nie więcej niż {max} bloki/-ów",
"error.blocks.max.singular": "You must not add more than one block", "error.blocks.max.singular": "Możesz dodać tylko jeden blok",
"error.blocks.min.plural": "You must add at least {min} blocks", "error.blocks.min.plural": "Musisz dodać co najmniej {min} bloki/-ów",
"error.blocks.min.singular": "You must add at least one block", "error.blocks.min.singular": "Musisz dodać co najmniej jeden blok",
"error.blocks.validation": "There's an error in block {index}", "error.blocks.validation": "W bloku {index} jest błąd",
"error.email.preset.notFound": "Nie udało się załadować wzorca wiadomości e-mail \"{name}\"", "error.email.preset.notFound": "Nie udało się załadować wzorca wiadomości e-mail \"{name}\"",
@@ -67,7 +67,7 @@
"error.file.changeName.permission": "Nie masz uprawnień, by zmienić nazwę \"{filename}\"", "error.file.changeName.permission": "Nie masz uprawnień, by zmienić nazwę \"{filename}\"",
"error.file.duplicate": "Istnieje już plik o nazwie \"{filename}\"", "error.file.duplicate": "Istnieje już plik o nazwie \"{filename}\"",
"error.file.extension.forbidden": "Rozszerzenie \"{extension}\" jest niedozwolone", "error.file.extension.forbidden": "Rozszerzenie \"{extension}\" jest niedozwolone",
"error.file.extension.invalid": "Invalid extension: {extension}", "error.file.extension.invalid": "Nieprawidłowe rozszerzenie: {extension}",
"error.file.extension.missing": "Brak rozszerzenia pliku \"{filename}\"", "error.file.extension.missing": "Brak rozszerzenia pliku \"{filename}\"",
"error.file.maxheight": "Wysokość obrazka nie może być większa niż {height} pikseli", "error.file.maxheight": "Wysokość obrazka nie może być większa niż {height} pikseli",
"error.file.maxsize": "Plik jest za duży", "error.file.maxsize": "Plik jest za duży",
@@ -83,7 +83,7 @@
"error.file.notFound": "Nie można znaleźć pliku \"{filename}\"", "error.file.notFound": "Nie można znaleźć pliku \"{filename}\"",
"error.file.orientation": "Orientacja obrazka musi być \"{orientation}\"", "error.file.orientation": "Orientacja obrazka musi być \"{orientation}\"",
"error.file.type.forbidden": "Nie możesz przesyłać plików {type}", "error.file.type.forbidden": "Nie możesz przesyłać plików {type}",
"error.file.type.invalid": "Invalid file type: {type}", "error.file.type.invalid": "Nieprawidłowy typ pliku: {type}",
"error.file.undefined": "Nie można znaleźć pliku", "error.file.undefined": "Nie można znaleźć pliku",
"error.form.incomplete": "Popraw wszystkie błędy w formularzu…", "error.form.incomplete": "Popraw wszystkie błędy w formularzu…",
@@ -93,8 +93,8 @@
"error.language.duplicate": "Język już istnieje.", "error.language.duplicate": "Język już istnieje.",
"error.language.name": "Wprowadź poprawną nazwę języka.", "error.language.name": "Wprowadź poprawną nazwę języka.",
"error.layout.validation.block": "There's an error in block {blockIndex} in layout {layoutIndex}", "error.layout.validation.block": "W bloku {blockIndex} w układzie {layoutIndex} jest błąd",
"error.layout.validation.settings": "There's an error in layout {index} settings", "error.layout.validation.settings": "W ustawieniach układu {index} jest błąd",
"error.license.format": "Wprowadź poprawny klucz licencyjny", "error.license.format": "Wprowadź poprawny klucz licencyjny",
"error.license.email": "Wprowadź poprawny adres email", "error.license.email": "Wprowadź poprawny adres email",
@@ -118,8 +118,8 @@
"error.page.duplicate.permission": "Nie masz uprawnień, by zduplikować \"{slug}\"", "error.page.duplicate.permission": "Nie masz uprawnień, by zduplikować \"{slug}\"",
"error.page.notFound": "Nie można znaleźć strony \"{slug}\"", "error.page.notFound": "Nie można znaleźć strony \"{slug}\"",
"error.page.num.invalid": "Wprowadź poprawny numer sortujący. Liczby nie mogą być ujemne.", "error.page.num.invalid": "Wprowadź poprawny numer sortujący. Liczby nie mogą być ujemne.",
"error.page.slug.invalid": "Please enter a valid URL appendix", "error.page.slug.invalid": "Wprowadź poprawną końcówkę adresu URL",
"error.page.slug.maxlength": "Slug length must be less than \"{length}\" characters", "error.page.slug.maxlength": "Końcówka adresu musi być krótsza niż \"{length}\" znaków",
"error.page.sort.permission": "Nie można sortować strony \"{slug}\"", "error.page.sort.permission": "Nie można sortować strony \"{slug}\"",
"error.page.status.invalid": "Ustaw prawidłowy status strony", "error.page.status.invalid": "Ustaw prawidłowy status strony",
"error.page.undefined": "Nie udało się znaleźć strony", "error.page.undefined": "Nie udało się znaleźć strony",
@@ -163,7 +163,7 @@
"error.user.password.invalid": "Wprowadź prawidłowe hasło. Hasła muszą mieć co najmniej 8 znaków.", "error.user.password.invalid": "Wprowadź prawidłowe hasło. Hasła muszą mieć co najmniej 8 znaków.",
"error.user.password.notSame": "Hasła nie są takie same", "error.user.password.notSame": "Hasła nie są takie same",
"error.user.password.undefined": "Użytkownik nie ma hasła", "error.user.password.undefined": "Użytkownik nie ma hasła",
"error.user.password.wrong": "Wrong password", "error.user.password.wrong": "Nieprawidłowe hasło",
"error.user.role.invalid": "Wprowadź poprawną rolę", "error.user.role.invalid": "Wprowadź poprawną rolę",
"error.user.update.permission": "Nie masz uprawnień, by zaktualizować użytkownika \"{name}\"", "error.user.update.permission": "Nie masz uprawnień, by zaktualizować użytkownika \"{name}\"",
@@ -203,78 +203,78 @@
"error.validation.size": "Rozmiar wartości musi wynosić \"{size}\"", "error.validation.size": "Rozmiar wartości musi wynosić \"{size}\"",
"error.validation.startswith": "Wartość musi zaczynać się od \"{start}\"", "error.validation.startswith": "Wartość musi zaczynać się od \"{start}\"",
"error.validation.time": "Wprowadź poprawny czas", "error.validation.time": "Wprowadź poprawny czas",
"error.validation.time.after": "Please enter a time after {time}", "error.validation.time.after": "Wprowadź czas późniejszy niż {time}",
"error.validation.time.before": "Please enter a time before {time}", "error.validation.time.before": "Wprowadź czas wcześniejszy niż {time}",
"error.validation.time.between": "Please enter a time between {min} and {max}", "error.validation.time.between": "Wprowadź czas między {min} a {max}",
"error.validation.url": "Wprowadź poprawny adres URL", "error.validation.url": "Wprowadź poprawny adres URL",
"field.required": "Pole jest wymagane", "field.required": "Pole jest wymagane",
"field.blocks.changeType": "Change type", "field.blocks.changeType": "Zmień typ",
"field.blocks.code.name": "Kod", "field.blocks.code.name": "Kod",
"field.blocks.code.language": "Język", "field.blocks.code.language": "Język",
"field.blocks.code.placeholder": "Your code …", "field.blocks.code.placeholder": "Twój kod …",
"field.blocks.delete.confirm": "Do you really want to delete this block?", "field.blocks.delete.confirm": "Czy na pewno chcesz usunąć ten blok?",
"field.blocks.delete.confirm.all": "Do you really want to delete all blocks?", "field.blocks.delete.confirm.all": "Czy na pewno chcesz usunąć wszystkie bloki?",
"field.blocks.delete.confirm.selected": "Do you really want to delete the selected blocks?", "field.blocks.delete.confirm.selected": "Czy na pewno chcesz usunąć wszystkie wybrane bloki?",
"field.blocks.empty": "No blocks yet", "field.blocks.empty": "Nie ma jeszcze żadnych bloków",
"field.blocks.fieldsets.label": "Please select a block type …", "field.blocks.fieldsets.label": "Wybierz typ bloku …",
"field.blocks.gallery.name": "Gallery", "field.blocks.gallery.name": "Galeria",
"field.blocks.gallery.images.empty": "No images yet", "field.blocks.gallery.images.empty": "Nie ma jeszcze żadnych obrazków",
"field.blocks.gallery.images.label": "Images", "field.blocks.gallery.images.label": "Obrazki",
"field.blocks.heading.level": "Level", "field.blocks.heading.level": "Poziom",
"field.blocks.heading.name": "Heading", "field.blocks.heading.name": "Nagłówek",
"field.blocks.heading.text": "Text", "field.blocks.heading.text": "Tekst",
"field.blocks.heading.placeholder": "Heading …", "field.blocks.heading.placeholder": "Nagłówek …",
"field.blocks.image.alt": "Alternative text", "field.blocks.image.alt": "Tekst alternatywny",
"field.blocks.image.caption": "Caption", "field.blocks.image.caption": "Podpis",
"field.blocks.image.crop": "Crop", "field.blocks.image.crop": "Przytnij",
"field.blocks.image.link": "Link", "field.blocks.image.link": "Link",
"field.blocks.image.location": "Location", "field.blocks.image.location": "Lokalizacja",
"field.blocks.image.name": "Obrazek", "field.blocks.image.name": "Obrazek",
"field.blocks.image.placeholder": "Select an image", "field.blocks.image.placeholder": "Wybierz obrazek",
"field.blocks.image.ratio": "Ratio", "field.blocks.image.ratio": "Proporcje",
"field.blocks.image.url": "Image URL", "field.blocks.image.url": "URL obrazka",
"field.blocks.list.name": "List", "field.blocks.list.name": "Lista",
"field.blocks.markdown.name": "Markdown", "field.blocks.markdown.name": "Markdown",
"field.blocks.markdown.label": "Text", "field.blocks.markdown.label": "Tekst",
"field.blocks.markdown.placeholder": "Markdown …", "field.blocks.markdown.placeholder": "Markdown …",
"field.blocks.quote.name": "Quote", "field.blocks.quote.name": "Cytat",
"field.blocks.quote.text.label": "Text", "field.blocks.quote.text.label": "Tekst",
"field.blocks.quote.text.placeholder": "Quote …", "field.blocks.quote.text.placeholder": "Cytat …",
"field.blocks.quote.citation.label": "Citation", "field.blocks.quote.citation.label": "Źródło",
"field.blocks.quote.citation.placeholder": "by …", "field.blocks.quote.citation.placeholder": "autorstwa …",
"field.blocks.text.name": "Text", "field.blocks.text.name": "Tekst",
"field.blocks.text.placeholder": "Text …", "field.blocks.text.placeholder": "Tekst …",
"field.blocks.video.caption": "Caption", "field.blocks.video.caption": "Podpis",
"field.blocks.video.name": "Video", "field.blocks.video.name": "Video",
"field.blocks.video.placeholder": "Enter a video URL", "field.blocks.video.placeholder": "Wprowadź URL video",
"field.blocks.video.url.label": "Video-URL", "field.blocks.video.url.label": "URL video",
"field.blocks.video.url.placeholder": "https://youtube.com/?v=", "field.blocks.video.url.placeholder": "https://youtube.com/?v=",
"field.files.empty": "Nie wybrano jeszcze żadnych plików", "field.files.empty": "Nie wybrano jeszcze żadnych plików",
"field.layout.delete": "Delete layout", "field.layout.delete": "Usuń układ",
"field.layout.delete.confirm": "Do you really want to delete this layout?", "field.layout.delete.confirm": "Czy na pewno chcesz usunąć ten układ?",
"field.layout.empty": "No rows yet", "field.layout.empty": "Nie ma jeszcze żadnych rzędów",
"field.layout.select": "Select a layout", "field.layout.select": "Wybierz układ",
"field.pages.empty": "Nie wybrano jeszcze żadnych stron", "field.pages.empty": "Nie wybrano jeszcze żadnych stron",
"field.structure.delete.confirm": "Czy na pewno chcesz usunąć ten wiersz?", "field.structure.delete.confirm": "Czy na pewno chcesz usunąć ten wiersz?",
"field.structure.empty": "Nie ma jeszcze \u017cadnych wpis\u00f3w.", "field.structure.empty": "Nie ma jeszcze \u017cadnych wpis\u00f3w.",
"field.users.empty": "Nie wybrano jeszcze żadnych użytkowników", "field.users.empty": "Nie wybrano jeszcze żadnych użytkowników",
"file.blueprint": "This file has no blueprint yet. You can define the setup in <strong>/site/blueprints/{template}.yml</strong>", "file.blueprint": "Ten plik nie ma jeszcze wzorca. Możesz go zdefiniować w <strong>/site/blueprints/{template}.yml</strong>",
"file.delete.confirm": "Czy na pewno chcesz usunąć <br><strong>{filename}</strong>?", "file.delete.confirm": "Czy na pewno chcesz usunąć <br><strong>{filename}</strong>?",
"file.sort": "Change position", "file.sort": "Zmień pozycję",
"files": "Pliki", "files": "Pliki",
"files.empty": "Nie ma jeszcze żadnych plików", "files.empty": "Nie ma jeszcze żadnych plików",
"hide": "Hide", "hide": "Ukryj",
"hour": "Godzina", "hour": "Godzina",
"insert": "Wstaw", "insert": "Wstaw",
"insert.after": "Insert after", "insert.after": "Wstaw po",
"insert.before": "Insert before", "insert.before": "Wstaw przed",
"install": "Zainstaluj", "install": "Zainstaluj",
"installation": "Instalacja", "installation": "Instalacja",
@@ -333,20 +333,20 @@
"lock.isUnlocked": "Twoje niezapisane zmiany zostały nadpisane przez innego użytkownika. Możesz pobrać swoje zmiany, by scalić je ręcznie.", "lock.isUnlocked": "Twoje niezapisane zmiany zostały nadpisane przez innego użytkownika. Możesz pobrać swoje zmiany, by scalić je ręcznie.",
"login": "Zaloguj", "login": "Zaloguj",
"login.code.label.login": "Login code", "login.code.label.login": "Kod logowania się",
"login.code.label.password-reset": "Password reset code", "login.code.label.password-reset": "Kod resetowania hasła",
"login.code.placeholder.email": "000 000", "login.code.placeholder.email": "000 000",
"login.code.text.email": "If your email address is registered, the requested code was sent via email.", "login.code.text.email": "Jeśli Twój adres email jest zarejestrowany, żądany kod został wysłany na Twoją skrzynkę.",
"login.email.login.body": "Hi {user.nameOrEmail},\n\nYou recently requested a login code for the Kirby Panel.\nThe following login code will be valid for {timeout} minutes:\n\n{code}\n\nIf you did not request a login code, please ignore this email or contact your administrator if you have questions.\nFor security, please DO NOT forward this email.", "login.email.login.body": "Witaj {user.nameOrEmail},\n\nNiedawno poprosiłeś/-aś o kod logowania do panelu Kirby.\nPoniższy kod resetowania hasła będzie ważny przez {timeout} minut:\n\n{code}\n\nJeżeli nie zażądałeś/-aś kodu logowania, zignoruj tę wiadomość e-mail lub skontaktuj się z administratorem, jeśli masz pytania.\nZe względów bezpieczeństwa NIE przesyłaj dalej tego emaila. ",
"login.email.login.subject": "Your login code", "login.email.login.subject": "Twój kod logowania się",
"login.email.password-reset.body": "Hi {user.nameOrEmail},\n\nYou recently requested a password reset code for the Kirby Panel.\nThe following password reset code will be valid for {timeout} minutes:\n\n{code}\n\nIf you did not request a password reset code, please ignore this email or contact your administrator if you have questions.\nFor security, please DO NOT forward this email.", "login.email.password-reset.body": "Witaj {user.nameOrEmail},\n\nNiedawno poprosiłeś/-aś o kod resetowania hasła do panelu Kirby.\nPoniższy kod resetowania hasła będzie ważny przez {timeout} minut:\n\n{code}\n\nJeżeli nie zażądałeś/-aś kodu resetowania hasła, zignoruj tę wiadomość email lub skontaktuj się z administratorem, jeśli masz pytania.\nZe względów bezpieczeństwa NIE przesyłaj dalej tego emaila.",
"login.email.password-reset.subject": "Your password reset code", "login.email.password-reset.subject": "Twój kod resetujący hasło",
"login.remember": "Nie wylogowuj mnie", "login.remember": "Nie wylogowuj mnie",
"login.reset": "Reset password", "login.reset": "Zresetuj hasło",
"login.toggleText.code.email": "Login via email", "login.toggleText.code.email": "Zaloguj się za pomocą adresu email",
"login.toggleText.code.email-password": "Login with password", "login.toggleText.code.email-password": "Zaloguj się za pomocą hasła",
"login.toggleText.password-reset.email": "Forgot your password?", "login.toggleText.password-reset.email": "Zapomniałeś/-aś hasła?",
"login.toggleText.password-reset.email-password": "← Back to login", "login.toggleText.password-reset.email-password": "← Powrót do logowania",
"logout": "Wyloguj", "logout": "Wyloguj",
@@ -372,20 +372,20 @@
"more": "Więcej", "more": "Więcej",
"name": "Nazwa", "name": "Nazwa",
"next": "Następne", "next": "Następne",
"no": "no", "no": "nie",
"off": "wyłączone", "off": "wyłączone",
"on": "włączone", "on": "włączone",
"open": "Otwórz", "open": "Otwórz",
"open.newWindow": "Open in new window", "open.newWindow": "Otwórz w nowym oknie",
"options": "Opcje", "options": "Opcje",
"options.none": "No options", "options.none": "Brak opcji",
"orientation": "Orientacja", "orientation": "Orientacja",
"orientation.landscape": "Pozioma", "orientation.landscape": "Pozioma",
"orientation.portrait": "Pionowa", "orientation.portrait": "Pionowa",
"orientation.square": "Kwadrat", "orientation.square": "Kwadrat",
"page.blueprint": "This page has no blueprint yet. You can define the setup in <strong>/site/blueprints/{template}.yml</strong>", "page.blueprint": "Ta strona nie ma jeszcze wzorca. Możesz go zdefiniować w <strong>/site/blueprints/{template}.yml</strong>",
"page.changeSlug": "Zmie\u0144 URL", "page.changeSlug": "Zmie\u0144 URL",
"page.changeSlug.fromTitle": "Utw\u00f3rz na podstawie tytu\u0142u", "page.changeSlug.fromTitle": "Utw\u00f3rz na podstawie tytu\u0142u",
"page.changeStatus": "Zmień status", "page.changeStatus": "Zmień status",
@@ -399,7 +399,7 @@
"page.duplicate.appendix": "Kopiuj", "page.duplicate.appendix": "Kopiuj",
"page.duplicate.files": "Kopiuj pliki", "page.duplicate.files": "Kopiuj pliki",
"page.duplicate.pages": "Kopiuj strony", "page.duplicate.pages": "Kopiuj strony",
"page.sort": "Change position", "page.sort": "Zmień pozycję",
"page.status": "Status", "page.status": "Status",
"page.status.draft": "Szkic", "page.status.draft": "Szkic",
"page.status.draft.description": "Strona jest w trybie roboczym i widoczna tylko dla zalogowanych redaktorów lub pod sekretnym linkiem", "page.status.draft.description": "Strona jest w trybie roboczym i widoczna tylko dla zalogowanych redaktorów lub pod sekretnym linkiem",
@@ -419,7 +419,7 @@
"password": "Has\u0142o", "password": "Has\u0142o",
"pixel": "Piksel", "pixel": "Piksel",
"prev": "Poprzednie", "prev": "Poprzednie",
"preview": "Preview", "preview": "Podgląd",
"remove": "Usuń", "remove": "Usuń",
"rename": "Zmień nazwę", "rename": "Zmień nazwę",
"replace": "Zamie\u0144", "replace": "Zamie\u0144",
@@ -438,15 +438,15 @@
"save": "Zapisz", "save": "Zapisz",
"search": "Szukaj", "search": "Szukaj",
"search.min": "Enter {min} characters to search", "search.min": "Aby wyszukać, wprowadź co najmniej {min} znaków",
"search.all": "Show all", "search.all": "Pokaż wzystkie",
"search.results.none": "No results", "search.results.none": "Brak wyników",
"section.required": "Sekcja jest wymagana", "section.required": "Sekcja jest wymagana",
"select": "Wybierz", "select": "Wybierz",
"settings": "Ustawienia", "settings": "Ustawienia",
"show": "Show", "show": "Pokaż",
"size": "Rozmiar", "size": "Rozmiar",
"slug": "Końcówka URL", "slug": "Końcówka URL",
"sort": "Sortuj", "sort": "Sortuj",
@@ -454,7 +454,7 @@
"template": "Szablon", "template": "Szablon",
"today": "Dzisiaj", "today": "Dzisiaj",
"site.blueprint": "The site has no blueprint yet. You can define the setup in <strong>/site/blueprints/site.yml</strong>", "site.blueprint": "Ta strona nie ma jeszcze wzorca. Możesz go zdefiniować w <strong>/site/blueprints/site.yml</strong>",
"toolbar.button.code": "Kod", "toolbar.button.code": "Kod",
"toolbar.button.bold": "Pogrubienie", "toolbar.button.bold": "Pogrubienie",
@@ -468,9 +468,9 @@
"toolbar.button.file.select": "Wybierz plik", "toolbar.button.file.select": "Wybierz plik",
"toolbar.button.file.upload": "Prześlij plik", "toolbar.button.file.upload": "Prześlij plik",
"toolbar.button.link": "Link", "toolbar.button.link": "Link",
"toolbar.button.strike": "Strike-through", "toolbar.button.strike": "Przekreślenie",
"toolbar.button.ol": "Lista numerowana", "toolbar.button.ol": "Lista numerowana",
"toolbar.button.underline": "Underline", "toolbar.button.underline": "Podkreślenie",
"toolbar.button.ul": "Lista wypunktowana", "toolbar.button.ul": "Lista wypunktowana",
"translation.author": "Zespół Kirby", "translation.author": "Zespół Kirby",
@@ -516,12 +516,12 @@
"view.account": "Twoje konto", "view.account": "Twoje konto",
"view.installation": "Instalacja", "view.installation": "Instalacja",
"view.resetPassword": "Reset password", "view.resetPassword": "Zresetuj hasło",
"view.settings": "Ustawienia", "view.settings": "Ustawienia",
"view.site": "Strona", "view.site": "Strona",
"view.users": "U\u017cytkownicy", "view.users": "U\u017cytkownicy",
"welcome": "Witaj", "welcome": "Witaj",
"year": "Rok", "year": "Rok",
"yes": "yes" "yes": "tak"
} }

View File

@@ -118,7 +118,7 @@
"error.page.duplicate.permission": "Du har inte behörighet att duplicera \"{slug}\"", "error.page.duplicate.permission": "Du har inte behörighet att duplicera \"{slug}\"",
"error.page.notFound": "Sidan \"{slug}\" kan inte hittas", "error.page.notFound": "Sidan \"{slug}\" kan inte hittas",
"error.page.num.invalid": "Ange ett giltigt nummer för sortering. Numret får inte vara negativt.", "error.page.num.invalid": "Ange ett giltigt nummer för sortering. Numret får inte vara negativt.",
"error.page.slug.invalid": "Please enter a valid URL appendix", "error.page.slug.invalid": "Ange en giltig URL-appendix",
"error.page.slug.maxlength": "Permalänkens längd måste vara kortare än \"{length}\" tecken", "error.page.slug.maxlength": "Permalänkens längd måste vara kortare än \"{length}\" tecken",
"error.page.sort.permission": "Sidan \"{slug}\" kan inte sorteras", "error.page.sort.permission": "Sidan \"{slug}\" kan inte sorteras",
"error.page.status.invalid": "Sätt en giltig status för sidan", "error.page.status.invalid": "Sätt en giltig status för sidan",
@@ -163,7 +163,7 @@
"error.user.password.invalid": "Ange ett giltigt lösenord. Lösenordet måste vara minst 8 tecken långt.", "error.user.password.invalid": "Ange ett giltigt lösenord. Lösenordet måste vara minst 8 tecken långt.",
"error.user.password.notSame": "Lösenorden matchar inte", "error.user.password.notSame": "Lösenorden matchar inte",
"error.user.password.undefined": "Användaren har inget lösenord", "error.user.password.undefined": "Användaren har inget lösenord",
"error.user.password.wrong": "Wrong password", "error.user.password.wrong": "Fel lösenord",
"error.user.role.invalid": "Ange en giltig roll", "error.user.role.invalid": "Ange en giltig roll",
"error.user.update.permission": "Du har inte behörighet att uppdatera användaren \"{name}\"", "error.user.update.permission": "Du har inte behörighet att uppdatera användaren \"{name}\"",
@@ -372,11 +372,11 @@
"more": "Mer", "more": "Mer",
"name": "Namn", "name": "Namn",
"next": "Nästa", "next": "Nästa",
"no": "no", "no": "nej",
"off": "av", "off": "av",
"on": "på", "on": "på",
"open": "Öppna", "open": "Öppna",
"open.newWindow": "Open in new window", "open.newWindow": "Öppna i nytt fönster",
"options": "Alternativ", "options": "Alternativ",
"options.none": "Inga alternativ", "options.none": "Inga alternativ",
@@ -468,9 +468,9 @@
"toolbar.button.file.select": "Välj en fil", "toolbar.button.file.select": "Välj en fil",
"toolbar.button.file.upload": "Ladda upp en fil", "toolbar.button.file.upload": "Ladda upp en fil",
"toolbar.button.link": "L\u00e4nk", "toolbar.button.link": "L\u00e4nk",
"toolbar.button.strike": "Strike-through", "toolbar.button.strike": "Genomstruken",
"toolbar.button.ol": "Sorterad lista", "toolbar.button.ol": "Sorterad lista",
"toolbar.button.underline": "Underline", "toolbar.button.underline": "Understruken",
"toolbar.button.ul": "Punktlista", "toolbar.button.ul": "Punktlista",
"translation.author": "Kirby-teamet, Ola Christensson", "translation.author": "Kirby-teamet, Ola Christensson",
@@ -523,5 +523,5 @@
"welcome": "Välkommen", "welcome": "Välkommen",
"year": "År", "year": "År",
"yes": "yes" "yes": "ja"
} }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -4,6 +4,7 @@ namespace Kirby\Cms;
use Kirby\Image\Image; use Kirby\Image\Image;
use Kirby\Toolkit\A; use Kirby\Toolkit\A;
use Kirby\Toolkit\Escape;
use Kirby\Toolkit\F; use Kirby\Toolkit\F;
use Throwable; use Throwable;
@@ -561,6 +562,14 @@ class File extends ModelWithContent
$absolute = $this->parent() !== $params['model']; $absolute = $this->parent() !== $params['model'];
} }
// escape the default text
// TODO: no longer needed in 3.6
$textQuery = $params['text'] ?? '{{ file.filename }}';
$text = $this->toString($textQuery);
if ($textQuery === '{{ file.filename }}') {
$text = Escape::html($text);
}
return [ return [
'filename' => $this->filename(), 'filename' => $this->filename(),
'dragText' => $this->dragText('auto', $absolute ?? false), 'dragText' => $this->dragText('auto', $absolute ?? false),
@@ -569,7 +578,7 @@ class File extends ModelWithContent
'image' => $image, 'image' => $image,
'info' => $this->toString($params['info'] ?? false), 'info' => $this->toString($params['info'] ?? false),
'link' => $this->panelUrl(true), 'link' => $this->panelUrl(true),
'text' => $this->toString($params['text'] ?? '{{ file.filename }}'), 'text' => $text,
'type' => $this->type(), 'type' => $this->type(),
'url' => $this->url(), 'url' => $this->url(),
'uuid' => $uuid, 'uuid' => $uuid,

View File

@@ -7,6 +7,7 @@ use Kirby\Exception\InvalidArgumentException;
use Kirby\Exception\NotFoundException; use Kirby\Exception\NotFoundException;
use Kirby\Http\Uri; use Kirby\Http\Uri;
use Kirby\Toolkit\A; use Kirby\Toolkit\A;
use Kirby\Toolkit\Escape;
use Kirby\Toolkit\F; use Kirby\Toolkit\F;
/** /**
@@ -995,6 +996,14 @@ class Page extends ModelWithContent
$image = $this->panelImage($params['image'] ?? []); $image = $this->panelImage($params['image'] ?? []);
$icon = $this->panelIcon($image); $icon = $this->panelIcon($image);
// escape the default text
// TODO: no longer needed in 3.6
$textQuery = $params['text'] ?? '{{ page.title }}';
$text = $this->toString($textQuery);
if ($textQuery === '{{ page.title }}') {
$text = Escape::html($text);
}
return [ return [
'dragText' => $this->dragText(), 'dragText' => $this->dragText(),
'hasChildren' => $this->hasChildren(), 'hasChildren' => $this->hasChildren(),
@@ -1003,7 +1012,7 @@ class Page extends ModelWithContent
'image' => $image, 'image' => $image,
'info' => $this->toString($params['info'] ?? false), 'info' => $this->toString($params['info'] ?? false),
'link' => $this->panelUrl(true), 'link' => $this->panelUrl(true),
'text' => $this->toString($params['text'] ?? '{{ page.title }}'), 'text' => $text,
'url' => $this->url(), 'url' => $this->url(),
]; ];
} }

View File

@@ -5,6 +5,7 @@ namespace Kirby\Cms;
use Exception; use Exception;
use Kirby\Exception\InvalidArgumentException; use Kirby\Exception\InvalidArgumentException;
use Kirby\Exception\NotFoundException; use Kirby\Exception\NotFoundException;
use Kirby\Toolkit\Escape;
use Kirby\Toolkit\F; use Kirby\Toolkit\F;
use Kirby\Toolkit\Str; use Kirby\Toolkit\Str;
@@ -628,6 +629,14 @@ class User extends ModelWithContent
$image = $this->panelImage($params['image'] ?? []); $image = $this->panelImage($params['image'] ?? []);
$icon = $this->panelIcon($image); $icon = $this->panelIcon($image);
// escape the default text
// TODO: no longer needed in 3.6
$textQuery = $params['text'] ?? '{{ user.username }}';
$text = $this->toString($textQuery);
if ($textQuery === '{{ user.username }}') {
$text = Escape::html($text);
}
return [ return [
'icon' => $icon, 'icon' => $icon,
'id' => $this->id(), 'id' => $this->id(),
@@ -635,7 +644,7 @@ class User extends ModelWithContent
'email' => $this->email(), 'email' => $this->email(),
'info' => $this->toString($params['info'] ?? false), 'info' => $this->toString($params['info'] ?? false),
'link' => $this->panelUrl(true), 'link' => $this->panelUrl(true),
'text' => $this->toString($params['text'] ?? '{{ user.username }}'), 'text' => $text,
'username' => $this->username(), 'username' => $this->username(),
]; ];
} }

View File

@@ -181,6 +181,13 @@ class BlocksField extends FieldClass
public function store($value) public function store($value)
{ {
$blocks = $this->blocksToValues((array)$value, 'content'); $blocks = $this->blocksToValues((array)$value, 'content');
// returns empty string to avoid storing empty array as string `[]`
// and to consistency work with `$field->isEmpty()`
if (empty($blocks) === true) {
return '';
}
return $this->valueToJson($blocks, $this->pretty()); return $this->valueToJson($blocks, $this->pretty());
} }

View File

@@ -146,6 +146,12 @@ class LayoutField extends BlocksField
{ {
$value = Layouts::factory($value, ['parent' => $this->model])->toArray(); $value = Layouts::factory($value, ['parent' => $this->model])->toArray();
// returns empty string to avoid storing empty array as string `[]`
// and to consistency work with `$field->isEmpty()`
if (empty($value) === true) {
return '';
}
foreach ($value as $layoutIndex => $layout) { foreach ($value as $layoutIndex => $layout) {
if ($this->settings !== null) { if ($this->settings !== null) {
$value[$layoutIndex]['attrs'] = $this->attrsForm($layout['attrs'])->content(); $value[$layoutIndex]['attrs'] = $this->attrsForm($layout['attrs'])->content();

View File

@@ -7,6 +7,7 @@ use Kirby\Exception\Exception;
use Kirby\Exception\InvalidArgumentException; use Kirby\Exception\InvalidArgumentException;
use Kirby\Http\Remote; use Kirby\Http\Remote;
use Kirby\Http\Url; use Kirby\Http\Url;
use Kirby\Toolkit\Escape;
use Kirby\Toolkit\Properties; use Kirby\Toolkit\Properties;
use Kirby\Toolkit\Query; use Kirby\Toolkit\Query;
use Kirby\Toolkit\Str; use Kirby\Toolkit\Str;
@@ -86,10 +87,14 @@ class OptionsApi
* @param array $data * @param array $data
* @return string * @return string
*/ */
protected function field(string $field, array $data) protected function field(string $field, array $data): string
{ {
$value = $this->$field(); $value = $this->$field();
return Str::template($value, $data); return Str::template($value, $data, [
'callback' => function ($result) {
return Escape::html($result);
}
]);
} }
/** /**

View File

@@ -6,6 +6,7 @@ use Kirby\Cms\Field;
use Kirby\Exception\InvalidArgumentException; use Kirby\Exception\InvalidArgumentException;
use Kirby\Exception\NotFoundException; use Kirby\Exception\NotFoundException;
use Kirby\Toolkit\Collection; use Kirby\Toolkit\Collection;
use Kirby\Toolkit\Escape;
use Kirby\Toolkit\Obj; use Kirby\Toolkit\Obj;
use Kirby\Toolkit\Properties; use Kirby\Toolkit\Properties;
use Kirby\Toolkit\Query; use Kirby\Toolkit\Query;
@@ -102,7 +103,26 @@ class OptionsQuery
$value = $value[$object]; $value = $value[$object];
} }
return Str::template($value, $data); $result = Str::template($value, $data);
// escape the default queries for the `text` field
// TODO: remove after default escape implemented for query templates in 3.6
if ($field === 'text') {
$defaults = [
'arrayItem' => '{{ arrayItem.value }}',
'block' => '{{ block.type }}: {{ block.id }}',
'file' => '{{ file.filename }}',
'page' => '{{ page.title }}',
'structureItem' => '{{ structureItem.title }}',
'user' => '{{ user.username }}',
];
if (isset($defaults[$object]) && $value === $defaults[$object]) {
$result = Escape::html($result);
}
}
return $result;
} }
/** /**

View File

@@ -286,7 +286,7 @@ class Svg extends Xml
'feTurbulence', 'feTurbulence',
]; ];
protected static $allowedNamespaces = [ public static $allowedNamespaces = [
'xmlns' => 'http://www.w3.org/2000/svg', 'xmlns' => 'http://www.w3.org/2000/svg',
'xmlns:svg' => 'http://www.w3.org/2000/svg', 'xmlns:svg' => 'http://www.w3.org/2000/svg',
'xmlns:xlink' => 'http://www.w3.org/1999/xlink' 'xmlns:xlink' => 'http://www.w3.org/1999/xlink'

View File

@@ -221,6 +221,7 @@ class Dir
* @param string $dir The path for the new directory * @param string $dir The path for the new directory
* @param bool $recursive Create all parent directories, which don't exist * @param bool $recursive Create all parent directories, which don't exist
* @return bool True: the dir has been created, false: creating failed * @return bool True: the dir has been created, false: creating failed
* @throws \Exception If a file with the provided path already exists or the parent directory is not writable
*/ */
public static function make(string $dir, bool $recursive = true): bool public static function make(string $dir, bool $recursive = true): bool
{ {
@@ -232,6 +233,10 @@ class Dir
return true; return true;
} }
if (is_file($dir) === true) {
throw new Exception(sprintf('A file with the name "%s" already exists', $dir));
}
$parent = dirname($dir); $parent = dirname($dir);
if ($recursive === true) { if ($recursive === true) {

View File

@@ -250,7 +250,7 @@ class Str
*/ */
public static function contains(string $string = null, string $needle, bool $caseInsensitive = false): bool public static function contains(string $string = null, string $needle, bool $caseInsensitive = false): bool
{ {
return call_user_func($caseInsensitive === true ? 'stristr' : 'strstr', $string, $needle) !== false; return call_user_func($caseInsensitive === true ? 'stripos' : 'strpos', $string, $needle) !== false;
} }
/** /**
@@ -962,17 +962,32 @@ class Str
* *
* </code> * </code>
* *
* @param string $string The string with placeholders * @param string|null $string The string with placeholders
* @param array $data Associative array with placeholders as * @param array $data Associative array with placeholders as
* keys and replacements as values * keys and replacements as values
* @param string $fallback A fallback if a token does not have any matches * @param string|array|null $fallback An options array that contains:
* - fallback: if a token does not have any matches
* - callback: to be able to handle each matching result
* - start: start placeholder
* - end: end placeholder
* A simple fallback string is supported for compatibility (but deprecated).
* @param string $start Placeholder start characters * @param string $start Placeholder start characters
* @param string $end Placeholder end characters * @param string $end Placeholder end characters
*
* @todo Deprecate `string $fallback` and `$start`/`$end` arguments with warning in 3.6.0
* @todo Remove `$start` and `$end` parameters, rename `$fallback` to `$options` and only support `array` type for `$options` in 3.7.0
*
* @return string The filled-in string * @return string The filled-in string
*/ */
public static function template(string $string = null, array $data = [], string $fallback = null, string $start = '{{', string $end = '}}'): string public static function template(string $string = null, array $data = [], $fallback = null, string $start = '{{', string $end = '}}'): string
{ {
return preg_replace_callback('!' . $start . '(.*?)' . $end . '!', function ($match) use ($data, $fallback) { $options = $fallback;
$fallback = is_string($options) === true ? $options : ($options['fallback'] ?? null);
$callback = is_a(($options['callback'] ?? null), 'Closure') === true ? $options['callback'] : null;
$start = (string)($options['start'] ?? $start);
$end = (string)($options['end'] ?? $end);
return preg_replace_callback('!' . $start . '(.*?)' . $end . '!', function ($match) use ($data, $fallback, $callback) {
$query = trim($match[1]); $query = trim($match[1]);
// if the placeholder contains a dot, it is a query // if the placeholder contains a dot, it is a query
@@ -991,6 +1006,11 @@ class Str
$result = $fallback; $result = $fallback;
} }
// callback on result if given
if ($callback !== null) {
$result = $callback((string)$result, $query, $data);
}
// if we still don't have a result, keep the original placeholder // if we still don't have a result, keep the original placeholder
return $result ?? $match[0]; return $result ?? $match[0];
}, $string); }, $string);

View File

@@ -463,6 +463,12 @@ V::$validators = [
* Checks that the value has the given size * Checks that the value has the given size
*/ */
'size' => function ($value, $size, $operator = '=='): bool { 'size' => function ($value, $size, $operator = '=='): bool {
// if value is field object, first convert it to a readable value
// it is important to check at the beginning as the value can be string or numeric
if (is_a($value, '\Kirby\Cms\Field') === true) {
$value = $value->value();
}
if (is_numeric($value) === true) { if (is_numeric($value) === true) {
$count = $value; $count = $value;
} elseif (is_string($value) === true) { } elseif (is_string($value) === true) {

View File

@@ -27,8 +27,8 @@ class InstalledVersions
private static $installed = array ( private static $installed = array (
'root' => 'root' =>
array ( array (
'pretty_version' => '3.5.6', 'pretty_version' => '3.5.7',
'version' => '3.5.6.0', 'version' => '3.5.7.0',
'aliases' => 'aliases' =>
array ( array (
), ),
@@ -57,8 +57,8 @@ private static $installed = array (
), ),
'getkirby/cms' => 'getkirby/cms' =>
array ( array (
'pretty_version' => '3.5.6', 'pretty_version' => '3.5.7',
'version' => '3.5.6.0', 'version' => '3.5.7.0',
'aliases' => 'aliases' =>
array ( array (
), ),
@@ -84,12 +84,12 @@ private static $installed = array (
), ),
'laminas/laminas-zendframework-bridge' => 'laminas/laminas-zendframework-bridge' =>
array ( array (
'pretty_version' => '1.2.0', 'pretty_version' => '1.3.0',
'version' => '1.2.0.0', 'version' => '1.3.0.0',
'aliases' => 'aliases' =>
array ( array (
), ),
'reference' => '6cccbddfcfc742eb02158d6137ca5687d92cee32', 'reference' => '13af2502d9bb6f7d33be2de4b51fb68c6cdb476e',
), ),
'league/color-extractor' => 'league/color-extractor' =>
array ( array (
@@ -127,12 +127,12 @@ private static $installed = array (
), ),
'phpmailer/phpmailer' => 'phpmailer/phpmailer' =>
array ( array (
'pretty_version' => 'v6.4.1', 'pretty_version' => 'v6.5.0',
'version' => '6.4.1.0', 'version' => '6.5.0.0',
'aliases' => 'aliases' =>
array ( array (
), ),
'reference' => '9256f12d8fb0cd0500f93b19e18c356906cbed3d', 'reference' => 'a5b5c43e50b7fba655f793ad27303cd74c57363c',
), ),
'psr/log' => 'psr/log' =>
array ( array (

View File

@@ -6,8 +6,8 @@ $vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir); $baseDir = dirname($vendorDir);
return array( return array(
'7e9bd612cc444b3eed788ebbe46263a0' => $vendorDir . '/laminas/laminas-zendframework-bridge/src/autoload.php',
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
'7e9bd612cc444b3eed788ebbe46263a0' => $vendorDir . '/laminas/laminas-zendframework-bridge/src/autoload.php',
'04c6c5c2f7095ccf6c481d3e53e1776f' => $vendorDir . '/mustangostang/spyc/Spyc.php', '04c6c5c2f7095ccf6c481d3e53e1776f' => $vendorDir . '/mustangostang/spyc/Spyc.php',
'f864ae44e8154e5ff6f4eec32f46d37f' => $baseDir . '/config/setup.php', 'f864ae44e8154e5ff6f4eec32f46d37f' => $baseDir . '/config/setup.php',
'87988fc7b1c1f093da22a1a3de972f3a' => $baseDir . '/config/helpers.php', '87988fc7b1c1f093da22a1a3de972f3a' => $baseDir . '/config/helpers.php',

View File

@@ -7,8 +7,8 @@ namespace Composer\Autoload;
class ComposerStaticInitc26333d865e0329b638bdc17afd29896 class ComposerStaticInitc26333d865e0329b638bdc17afd29896
{ {
public static $files = array ( public static $files = array (
'7e9bd612cc444b3eed788ebbe46263a0' => __DIR__ . '/..' . '/laminas/laminas-zendframework-bridge/src/autoload.php',
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
'7e9bd612cc444b3eed788ebbe46263a0' => __DIR__ . '/..' . '/laminas/laminas-zendframework-bridge/src/autoload.php',
'04c6c5c2f7095ccf6c481d3e53e1776f' => __DIR__ . '/..' . '/mustangostang/spyc/Spyc.php', '04c6c5c2f7095ccf6c481d3e53e1776f' => __DIR__ . '/..' . '/mustangostang/spyc/Spyc.php',
'f864ae44e8154e5ff6f4eec32f46d37f' => __DIR__ . '/../..' . '/config/setup.php', 'f864ae44e8154e5ff6f4eec32f46d37f' => __DIR__ . '/../..' . '/config/setup.php',
'87988fc7b1c1f093da22a1a3de972f3a' => __DIR__ . '/../..' . '/config/helpers.php', '87988fc7b1c1f093da22a1a3de972f3a' => __DIR__ . '/../..' . '/config/helpers.php',

View File

@@ -244,17 +244,17 @@
}, },
{ {
"name": "laminas/laminas-zendframework-bridge", "name": "laminas/laminas-zendframework-bridge",
"version": "1.2.0", "version": "1.3.0",
"version_normalized": "1.2.0.0", "version_normalized": "1.3.0.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/laminas/laminas-zendframework-bridge.git", "url": "https://github.com/laminas/laminas-zendframework-bridge.git",
"reference": "6cccbddfcfc742eb02158d6137ca5687d92cee32" "reference": "13af2502d9bb6f7d33be2de4b51fb68c6cdb476e"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/laminas/laminas-zendframework-bridge/zipball/6cccbddfcfc742eb02158d6137ca5687d92cee32", "url": "https://api.github.com/repos/laminas/laminas-zendframework-bridge/zipball/13af2502d9bb6f7d33be2de4b51fb68c6cdb476e",
"reference": "6cccbddfcfc742eb02158d6137ca5687d92cee32", "reference": "13af2502d9bb6f7d33be2de4b51fb68c6cdb476e",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -266,7 +266,7 @@
"squizlabs/php_codesniffer": "^3.5", "squizlabs/php_codesniffer": "^3.5",
"vimeo/psalm": "^4.6" "vimeo/psalm": "^4.6"
}, },
"time": "2021-02-25T21:54:58+00:00", "time": "2021-06-24T12:49:22+00:00",
"type": "library", "type": "library",
"extra": { "extra": {
"laminas": { "laminas": {
@@ -480,17 +480,17 @@
}, },
{ {
"name": "phpmailer/phpmailer", "name": "phpmailer/phpmailer",
"version": "v6.4.1", "version": "v6.5.0",
"version_normalized": "6.4.1.0", "version_normalized": "6.5.0.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/PHPMailer/PHPMailer.git", "url": "https://github.com/PHPMailer/PHPMailer.git",
"reference": "9256f12d8fb0cd0500f93b19e18c356906cbed3d" "reference": "a5b5c43e50b7fba655f793ad27303cd74c57363c"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/9256f12d8fb0cd0500f93b19e18c356906cbed3d", "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/a5b5c43e50b7fba655f793ad27303cd74c57363c",
"reference": "9256f12d8fb0cd0500f93b19e18c356906cbed3d", "reference": "a5b5c43e50b7fba655f793ad27303cd74c57363c",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -515,7 +515,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": "2021-04-29T12:25:04+00:00", "time": "2021-06-16T14:33:43+00:00",
"type": "library", "type": "library",
"installation-source": "dist", "installation-source": "dist",
"autoload": { "autoload": {
@@ -547,7 +547,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.4.1" "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.5.0"
}, },
"funding": [ "funding": [
{ {

View File

@@ -1,8 +1,8 @@
<?php return array ( <?php return array (
'root' => 'root' =>
array ( array (
'pretty_version' => '3.5.6', 'pretty_version' => '3.5.7',
'version' => '3.5.6.0', 'version' => '3.5.7.0',
'aliases' => 'aliases' =>
array ( array (
), ),
@@ -31,8 +31,8 @@
), ),
'getkirby/cms' => 'getkirby/cms' =>
array ( array (
'pretty_version' => '3.5.6', 'pretty_version' => '3.5.7',
'version' => '3.5.6.0', 'version' => '3.5.7.0',
'aliases' => 'aliases' =>
array ( array (
), ),
@@ -58,12 +58,12 @@
), ),
'laminas/laminas-zendframework-bridge' => 'laminas/laminas-zendframework-bridge' =>
array ( array (
'pretty_version' => '1.2.0', 'pretty_version' => '1.3.0',
'version' => '1.2.0.0', 'version' => '1.3.0.0',
'aliases' => 'aliases' =>
array ( array (
), ),
'reference' => '6cccbddfcfc742eb02158d6137ca5687d92cee32', 'reference' => '13af2502d9bb6f7d33be2de4b51fb68c6cdb476e',
), ),
'league/color-extractor' => 'league/color-extractor' =>
array ( array (
@@ -101,12 +101,12 @@
), ),
'phpmailer/phpmailer' => 'phpmailer/phpmailer' =>
array ( array (
'pretty_version' => 'v6.4.1', 'pretty_version' => 'v6.5.0',
'version' => '6.4.1.0', 'version' => '6.5.0.0',
'aliases' => 'aliases' =>
array ( array (
), ),
'reference' => '9256f12d8fb0cd0500f93b19e18c356906cbed3d', 'reference' => 'a5b5c43e50b7fba655f793ad27303cd74c57363c',
), ),
'psr/log' => 'psr/log' =>
array ( array (

View File

@@ -1,11 +1,5 @@
<?php <?php
/**
* @see https://github.com/laminas/laminas-zendframework-bridge for the canonical source repository
* @copyright https://github.com/laminas/laminas-zendframework-bridge/blob/master/COPYRIGHT.md
* @license https://github.com/laminas/laminas-zendframework-bridge/blob/master/LICENSE.md New BSD License
*/
namespace Laminas\ZendFrameworkBridge; namespace Laminas\ZendFrameworkBridge;
use ArrayObject; use ArrayObject;

View File

@@ -1,18 +1,10 @@
<?php <?php
/**
* @see https://github.com/laminas/laminas-zendframework-bridge for the canonical source repository
* @copyright https://github.com/laminas/laminas-zendframework-bridge/blob/master/COPYRIGHT.md
* @license https://github.com/laminas/laminas-zendframework-bridge/blob/master/LICENSE.md New BSD License
*/
namespace Laminas\ZendFrameworkBridge; namespace Laminas\ZendFrameworkBridge;
use function array_intersect_key; use function array_intersect_key;
use function array_key_exists; use function array_key_exists;
use function array_pop; use function array_pop;
use function array_push;
use function count;
use function in_array; use function in_array;
use function is_array; use function is_array;
use function is_callable; use function is_callable;
@@ -76,7 +68,7 @@ class ConfigPostProcessor
function ($value, array $keys) { function ($value, array $keys) {
$key = array_pop($keys); $key = array_pop($keys);
// Only worried about a top-level "router" key. // Only worried about a top-level "router" key.
return $key === 'router' && count($keys) === 0 && is_array($value) return $key === 'router' && $keys === [] && is_array($value)
? [$this, 'noopReplacement'] ? [$this, 'noopReplacement']
: null; : null;
}, },
@@ -90,7 +82,7 @@ class ConfigPostProcessor
// Array values // Array values
function ($value, array $keys) { function ($value, array $keys) {
return 0 !== count($keys) && is_array($value) return $keys !== [] && is_array($value)
? [$this, '__invoke'] ? [$this, '__invoke']
: null; : null;
}, },
@@ -159,7 +151,7 @@ class ConfigPostProcessor
{ {
// Add new key to the list of keys. // Add new key to the list of keys.
// We do not need to remove it later, as we are working on a copy of the array. // We do not need to remove it later, as we are working on a copy of the array.
array_push($keys, $key); $keys[] = $key;
// Identify rewrite strategy and perform replacements // Identify rewrite strategy and perform replacements
$rewriteRule = $this->replacementRuleMatch($value, $keys); $rewriteRule = $this->replacementRuleMatch($value, $keys);

View File

@@ -1,11 +1,5 @@
<?php <?php
/**
* @see https://github.com/laminas/laminas-zendframework-bridge for the canonical source repository
* @copyright https://github.com/laminas/laminas-zendframework-bridge/blob/master/COPYRIGHT.md
* @license https://github.com/laminas/laminas-zendframework-bridge/blob/master/LICENSE.md New BSD License
*/
namespace Laminas\ZendFrameworkBridge; namespace Laminas\ZendFrameworkBridge;
use Laminas\ModuleManager\Listener\ConfigMergerInterface; use Laminas\ModuleManager\Listener\ConfigMergerInterface;

View File

@@ -1,11 +1,5 @@
<?php <?php
/**
* @see https://github.com/laminas/laminas-zendframework-bridge for the canonical source repository
* @copyright https://github.com/laminas/laminas-zendframework-bridge/blob/master/COPYRIGHT.md
* @license https://github.com/laminas/laminas-zendframework-bridge/blob/master/LICENSE.md New BSD License
*/
namespace Laminas\ZendFrameworkBridge; namespace Laminas\ZendFrameworkBridge;
use function array_merge; use function array_merge;

View File

@@ -1,11 +1,5 @@
<?php <?php
/**
* @see https://github.com/laminas/laminas-zendframework-bridge for the canonical source repository
* @copyright https://github.com/laminas/laminas-zendframework-bridge/blob/master/COPYRIGHT.md
* @license https://github.com/laminas/laminas-zendframework-bridge/blob/master/LICENSE.md New BSD License
*/
namespace Laminas\ZendFrameworkBridge; namespace Laminas\ZendFrameworkBridge;
class RewriteRules class RewriteRules

View File

@@ -1,9 +1,3 @@
<?php <?php
/**
* @see https://github.com/laminas/laminas-zendframework-bridge for the canonical source repository
* @copyright https://github.com/laminas/laminas-zendframework-bridge/blob/master/COPYRIGHT.md
* @license https://github.com/laminas/laminas-zendframework-bridge/blob/master/LICENSE.md New BSD License
*/
Laminas\ZendFrameworkBridge\Autoloader::load(); Laminas\ZendFrameworkBridge\Autoloader::load();

View File

@@ -19,8 +19,7 @@ $PHPMAILER_LANG['instantiate'] = 'لا يمكن توفير خدمة ا
$PHPMAILER_LANG['invalid_address'] = 'الإرسال غير ممكن لأن عنوان البريد الإلكتروني غير صالح: '; $PHPMAILER_LANG['invalid_address'] = 'الإرسال غير ممكن لأن عنوان البريد الإلكتروني غير صالح: ';
$PHPMAILER_LANG['mailer_not_supported'] = ' برنامج الإرسال غير مدعوم.'; $PHPMAILER_LANG['mailer_not_supported'] = ' برنامج الإرسال غير مدعوم.';
$PHPMAILER_LANG['provide_address'] = 'يجب توفير عنوان البريد الإلكتروني لمستلم واحد على الأقل.'; $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 Connect() غير ممكن.'; $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() غير ممكن.';
$PHPMAILER_LANG['smtp_error'] = 'خطأ على مستوى الخادم SMTP: '; $PHPMAILER_LANG['smtp_error'] = 'خطأ على مستوى الخادم SMTP: ';

View File

@@ -428,9 +428,11 @@ class PHPMailer
public $Debugoutput = 'echo'; public $Debugoutput = 'echo';
/** /**
* Whether to keep SMTP connection open after each message. * Whether to keep the SMTP connection open after each message.
* If this is set to true then to close the connection * If this is set to true then the connection will remain open after a send,
* requires an explicit call to smtpClose(). * and closing the connection will require an explicit call to smtpClose().
* It's a good idea to use this if you are sending multiple messages as it reduces overhead.
* See the mailing list example for how to use it.
* *
* @var bool * @var bool
*/ */
@@ -748,7 +750,7 @@ class PHPMailer
* *
* @var string * @var string
*/ */
const VERSION = '6.4.1'; const VERSION = '6.5.0';
/** /**
* Error severity: message only, continue processing. * Error severity: message only, continue processing.
@@ -1335,7 +1337,8 @@ class PHPMailer
if (null === $patternselect) { if (null === $patternselect) {
$patternselect = static::$validator; $patternselect = static::$validator;
} }
if (is_callable($patternselect)) { //Don't allow strings as callables, see SECURITY.md and CVE-2021-3603
if (is_callable($patternselect) && !is_string($patternselect)) {
return call_user_func($patternselect, $address); return call_user_func($patternselect, $address);
} }
//Reject line breaks in addresses; it's valid RFC5322, but not RFC5321 //Reject line breaks in addresses; it's valid RFC5322, but not RFC5321
@@ -2182,7 +2185,8 @@ class PHPMailer
* The default language is English. * The default language is English.
* *
* @param string $langcode ISO 639-1 2-character language code (e.g. French is "fr") * @param string $langcode ISO 639-1 2-character language code (e.g. French is "fr")
* @param string $lang_path Path to the language file directory, with trailing separator (slash) * @param string $lang_path Path to the language file directory, with trailing separator (slash).D
* Do not set this from user input!
* *
* @return bool * @return bool
*/ */
@@ -2244,14 +2248,32 @@ class PHPMailer
if (!static::fileIsAccessible($lang_file)) { if (!static::fileIsAccessible($lang_file)) {
$foundlang = false; $foundlang = false;
} else { } else {
//Overwrite language-specific strings. //$foundlang = include $lang_file;
//This way we'll never have missing translation keys. $lines = file($lang_file);
$foundlang = include $lang_file; foreach ($lines as $line) {
//Translation file lines look like this:
//$PHPMAILER_LANG['authenticate'] = 'SMTP-Fehler: Authentifizierung fehlgeschlagen.';
//These files are parsed as text and not PHP so as to avoid the possibility of code injection
//See https://blog.stevenlevithan.com/archives/match-quoted-string
$matches = [];
if (
preg_match(
'/^\$PHPMAILER_LANG\[\'([a-z\d_]+)\'\]\s*=\s*(["\'])(.+)*?\2;/',
$line,
$matches
) &&
//Ignore unknown translation keys
array_key_exists($matches[1], $PHPMAILER_LANG)
) {
//Overwrite language-specific strings so we'll never have missing translation keys.
$PHPMAILER_LANG[$matches[1]] = (string)$matches[3];
}
}
} }
} }
$this->language = $PHPMAILER_LANG; $this->language = $PHPMAILER_LANG;
return (bool) $foundlang; //Returns false if language not found return $foundlang; //Returns false if language not found
} }
/** /**

View File

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

View File

@@ -35,7 +35,7 @@ class SMTP
* *
* @var string * @var string
*/ */
const VERSION = '6.4.1'; const VERSION = '6.5.0';
/** /**
* SMTP line break constant. * SMTP line break constant.
@@ -186,6 +186,7 @@ class SMTP
'Amazon_SES' => '/[\d]{3} Ok (.*)/', 'Amazon_SES' => '/[\d]{3} Ok (.*)/',
'SendGrid' => '/[\d]{3} Ok: queued as (.*)/', 'SendGrid' => '/[\d]{3} Ok: queued as (.*)/',
'CampaignMonitor' => '/[\d]{3} 2.0.0 OK:([a-zA-Z\d]{48})/', 'CampaignMonitor' => '/[\d]{3} 2.0.0 OK:([a-zA-Z\d]{48})/',
'Haraka' => '/[\d]{3} Message Queued \((.*)\)/',
]; ];
/** /**