From 2fb6dd6d47879df33bf9f1a90bd7de97dc1e7cc1 Mon Sep 17 00:00:00 2001 From: trendschau Date: Sun, 12 Jun 2022 22:34:06 +0200 Subject: [PATCH] Version 1.5.3.3: Fix language files and editable file upload size --- composer.lock | 56 +++++++++---------- .../Controllers/ControllerAuthorMediaApi.php | 6 +- system/Controllers/ControllerSettings.php | 1 + system/Settings.php | 2 + system/author/js/vue-blox.js | 3 +- system/author/js/vue-shared.js | 2 +- system/author/languages/fr.yaml | 2 +- system/author/languages/it.yaml | 4 +- system/author/languages/nl.yaml | 4 +- system/author/languages/ru.yaml | 2 +- system/author/layouts/layout.twig | 1 + system/author/layouts/layoutBlox.twig | 1 + system/author/settings/system.twig | 10 +++- 13 files changed, 54 insertions(+), 40 deletions(-) diff --git a/composer.lock b/composer.lock index ac5964c..5d0cf24 100644 --- a/composer.lock +++ b/composer.lock @@ -1130,16 +1130,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.25.0", + "version": "v1.26.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "30885182c981ab175d4d034db0f6f469898070ab" + "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab", - "reference": "30885182c981ab175d4d034db0f6f469898070ab", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4", + "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4", "shasum": "" }, "require": { @@ -1154,7 +1154,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.26-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1192,7 +1192,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.25.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.26.0" }, "funding": [ { @@ -1208,20 +1208,20 @@ "type": "tidelift" } ], - "time": "2021-10-20T20:35:02+00:00" + "time": "2022-05-24T11:49:31+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.25.0", + "version": "v1.26.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825" + "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0abb51d2f102e00a4eefcf46ba7fec406d245825", - "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", + "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", "shasum": "" }, "require": { @@ -1236,7 +1236,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.26-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1275,7 +1275,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.25.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0" }, "funding": [ { @@ -1291,20 +1291,20 @@ "type": "tidelift" } ], - "time": "2021-11-30T18:21:41+00:00" + "time": "2022-05-24T11:49:31+00:00" }, { "name": "symfony/polyfill-php72", - "version": "v1.25.0", + "version": "v1.26.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "9a142215a36a3888e30d0a9eeea9766764e96976" + "reference": "bf44a9fd41feaac72b074de600314a93e2ae78e2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/9a142215a36a3888e30d0a9eeea9766764e96976", - "reference": "9a142215a36a3888e30d0a9eeea9766764e96976", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/bf44a9fd41feaac72b074de600314a93e2ae78e2", + "reference": "bf44a9fd41feaac72b074de600314a93e2ae78e2", "shasum": "" }, "require": { @@ -1313,7 +1313,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.26-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1351,7 +1351,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.25.0" + "source": "https://github.com/symfony/polyfill-php72/tree/v1.26.0" }, "funding": [ { @@ -1367,20 +1367,20 @@ "type": "tidelift" } ], - "time": "2021-05-27T09:17:38+00:00" + "time": "2022-05-24T11:49:31+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.25.0", + "version": "v1.26.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c" + "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/4407588e0d3f1f52efb65fbe92babe41f37fe50c", - "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/cfa0ae98841b9e461207c13ab093d76b0fa7bace", + "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace", "shasum": "" }, "require": { @@ -1389,7 +1389,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.23-dev" + "dev-main": "1.26-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1434,7 +1434,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.25.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.26.0" }, "funding": [ { @@ -1450,7 +1450,7 @@ "type": "tidelift" } ], - "time": "2022-03-04T08:16:47+00:00" + "time": "2022-05-10T07:21:04+00:00" }, { "name": "symfony/yaml", diff --git a/system/Controllers/ControllerAuthorMediaApi.php b/system/Controllers/ControllerAuthorMediaApi.php index c8c26ea..3ef8590 100644 --- a/system/Controllers/ControllerAuthorMediaApi.php +++ b/system/Controllers/ControllerAuthorMediaApi.php @@ -237,10 +237,12 @@ class ControllerAuthorMediaApi extends ControllerAuthor return $response->withJson(['errors' => 'File is empty.'],422); } + $maxUploadSize = (isset($this->settings['maxuploadsize']) && is_numeric($this->settings['maxuploadsize']) ) ? ( $this->settings['maxuploadsize'] * 1024 * 1024) : 20971520; + # 20 MB (1 byte * 1024 * 1024 * 20 (for 20 MB)) - if ($size > 20971520) + if ($size > $maxUploadSize) { - return $response->withJson(['errors' => 'File is bigger than 20MB.'],422); + return $response->withJson(['errors' => 'File is bigger than '. ($maxUploadSize / 1024 / 1024) .'MB.'],422); } # check extension first diff --git a/system/Controllers/ControllerSettings.php b/system/Controllers/ControllerSettings.php index 73873c9..2f1764d 100644 --- a/system/Controllers/ControllerSettings.php +++ b/system/Controllers/ControllerSettings.php @@ -121,6 +121,7 @@ class ControllerSettings extends ControllerShared 'oldslug' => isset($newSettings['oldslug']) ? true : null, 'refreshcache' => isset($newSettings['refreshcache']) ? true : null, 'pingsitemap' => isset($newSettings['pingsitemap']) ? true : null, + 'maxuploadsize' => $newSettings['maxuploadsize'], ); # https://www.slimframework.com/docs/v3/cookbook/uploading-files.html; diff --git a/system/Settings.php b/system/Settings.php index 16c2ce6..271df44 100644 --- a/system/Settings.php +++ b/system/Settings.php @@ -87,6 +87,7 @@ class Settings 'version' => '1.5.3.2', 'setup' => true, 'welcome' => true, + 'maxuploadsize' => 20, 'images' => ['live' => ['width' => 820], 'thumbs' => ['width' => 250, 'height' => 150]], ]; } @@ -194,6 +195,7 @@ class Settings 'oldslug' => true, 'refreshcache' => true, 'pingsitemap' => true, + 'maxuploadsize' => true, ]; # cleanup the existing usersettings diff --git a/system/author/js/vue-blox.js b/system/author/js/vue-blox.js index 766a9e7..322c607 100644 --- a/system/author/js/vue-blox.js +++ b/system/author/js/vue-blox.js @@ -2002,7 +2002,7 @@ const fileComponent = Vue.component('file-component', { '', data: function(){ return { - maxsize: 20, // megabyte + maxsize: maxuploadsize, // megabyte showmedialib: false, load: false, filemeta: false, @@ -2015,7 +2015,6 @@ const fileComponent = Vue.component('file-component', { } }, mounted: function(){ - this.$refs.markdown.focus(); if(this.compmarkdown) diff --git a/system/author/js/vue-shared.js b/system/author/js/vue-shared.js index eed8e0d..28fd0af 100644 --- a/system/author/js/vue-shared.js +++ b/system/author/js/vue-shared.js @@ -708,7 +708,7 @@ Vue.component('component-file', { '', data: function(){ return { - maxsize: 20, // megabyte + maxsize: maxuploadsize, // megabyte showmedialib: false, fileid: '', load: false, diff --git a/system/author/languages/fr.yaml b/system/author/languages/fr.yaml index 70138fa..195e1fd 100644 --- a/system/author/languages/fr.yaml +++ b/system/author/languages/fr.yaml @@ -249,7 +249,7 @@ WEBSITE_RESTRICTION: Restriction sur le site WRAP_THE_RESTRICTION_NOTICE_ABOVE_INTO_A_NOTICE_4_ELEMENT_(WHICH_CAN_BE_DESIGNED_AS_SPECIAL_BOX): Insérer l'avis de restriction ci-dessus dans un élément notice-4 (qui peut être conçu comme special box) ACTIVATE_CACHE_FOR_TWIG_TEMPLATES: Activer le cache pour les templates Twig -ADD_MORE_URL_SCHEMES_FOR_EXTERNAL_LINKS_E_G__LIKE_DICT://_(COMMA_SEPARATED_LIST): Ajouter d'autres schémas d'url pour les liens externes. ex: dict:// (liste séparée par des virgules) +ADD_MORE_URL_SCHEMES_FOR_EXTERNAL_LINKS_E_G__LIKE_DICT://_(COMMA_SEPARATED_LIST): "Ajouter d'autres schémas d'url pour les liens externes. ex: dict:// (liste séparée par des virgules)" CLEAR_CACHE: Vider le cache DELETE_ALL_CACHE_FILES: Vider tous les fichiers de cache DEVELOPER: Développeur diff --git a/system/author/languages/it.yaml b/system/author/languages/it.yaml index 70a34a9..f20005e 100644 --- a/system/author/languages/it.yaml +++ b/system/author/languages/it.yaml @@ -133,7 +133,7 @@ NO_SETTINGS: Nessuna impostazione NUMBERED_LIST: Elenco numerato OLIST: Elenchi ordinati ONLINE: in linea -ONLY_THE_FOLLOWING_SPECIAL_CHARACTERS_ARE_ALLOWED: Sono ammessi solo i seguenti caratteri speciali: +ONLY_THE_FOLLOWING_SPECIAL_CHARACTERS_ARE_ALLOWED: "Sono ammessi solo i seguenti caratteri speciali:" OWNER_(USERNAME): owner (username) PARAGRAPH: Paragrafo PASSWORD: Parola d'ordine @@ -239,7 +239,7 @@ IF_YOU_ADD_A_VALUE_FOR_THE_HEIGHT__THEN_THE_IMAGE_WILL_BE_CROPPED_: Se aggiungi PROXY: Proxy STANDARD_HEIGHT_FOR_IMAGES: Altezza standard per le immagini STANDARD_WIDTH_FOR_IMAGES: Larghezza standard per le immagini -THE_FOLLOWING_OPTIONS_ARE_ONLY_FOR_DEVELOPERS: Le seguenti opzioni sono solo per sviluppatori e amministratori esperti. Cambia le opzioni solo se le capisci davvero. Ad esempio: non attivare mai la segnalazione degli errori per un sito Web live, utilizzare questa opzione solo per la correzione dei bug. +THE_FOLLOWING_OPTIONS_ARE_ONLY_FOR_DEVELOPERS: "Le seguenti opzioni sono solo per sviluppatori e amministratori esperti. Cambia le opzioni solo se le capisci davvero. Ad esempio: non attivare mai la segnalazione degli errori per un sito Web live, utilizzare questa opzione solo per la correzione dei bug." THIS_APPLIES_ONLY_FOR_FUTURE_IMAGES_IN_THE_CONTENT_AREA_: Questo vale solo per le immagini future nell'area del contenuto. TRUSTED_IPS_FOR_PROXY_(COMMA_SEPARATED): IP affidabili per proxy (separati da virgole) TWIG_CACHE: Twig Cache diff --git a/system/author/languages/nl.yaml b/system/author/languages/nl.yaml index 551b995..30942e6 100644 --- a/system/author/languages/nl.yaml +++ b/system/author/languages/nl.yaml @@ -133,7 +133,7 @@ NO_SETTINGS: Geen instellingen NUMBERED_LIST: Genummerde lijst OLIST: olist ONLINE: online -ONLY_THE_FOLLOWING_SPECIAL_CHARACTERS_ARE_ALLOWED: alleen de volgende speciale tekens zijn toegestaan: +ONLY_THE_FOLLOWING_SPECIAL_CHARACTERS_ARE_ALLOWED: "alleen de volgende speciale tekens zijn toegestaan:" OWNER_(USERNAME): owner (username) PARAGRAPH: Paragraaf PASSWORD: Wachtwoord @@ -261,7 +261,7 @@ IF_YOU_ADD_A_VALUE_FOR_THE_HEIGHT__THEN_THE_IMAGE_WILL_BE_CROPPED_: Als u een wa PROXY: Proxy STANDARD_HEIGHT_FOR_IMAGES: Standaard hoogte voor afbeeldingen STANDARD_WIDTH_FOR_IMAGES: Standaardbreedte voor afbeeldingen -THE_FOLLOWING_OPTIONS_ARE_ONLY_FOR_DEVELOPERS: De volgende opties zijn alleen voor ontwikkelaars en ervaren beheerders. Wijzig de opties alleen als u ze echt begrijpt. Bijvoorbeeld: Activeer nooit de foutrapportage voor een live website, gebruik deze optie alleen voor het oplossen van fouten. +THE_FOLLOWING_OPTIONS_ARE_ONLY_FOR_DEVELOPERS: "De volgende opties zijn alleen voor ontwikkelaars en ervaren beheerders. Wijzig de opties alleen als u ze echt begrijpt. Bijvoorbeeld: Activeer nooit de foutrapportage voor een live website, gebruik deze optie alleen voor het oplossen van fouten." THIS_APPLIES_ONLY_FOR_FUTURE_IMAGES_IN_THE_CONTENT_AREA_: Dit geldt alleen voor toekomstige afbeeldingen in het inhoudsgebied. TRUSTED_IPS_FOR_PROXY_(COMMA_SEPARATED): Vertrouwde IP's voor proxy (gescheiden door komma's) TWIG_CACHE: Twig Cache diff --git a/system/author/languages/ru.yaml b/system/author/languages/ru.yaml index eb24f80..40cabcb 100644 --- a/system/author/languages/ru.yaml +++ b/system/author/languages/ru.yaml @@ -261,7 +261,7 @@ IF_YOU_ADD_A_VALUE_FOR_THE_HEIGHT__THEN_THE_IMAGE_WILL_BE_CROPPED_: Если в PROXY: Прокси STANDARD_HEIGHT_FOR_IMAGES: Стандартная высота для изображений STANDARD_WIDTH_FOR_IMAGES: Стандартная ширина для изображений -THE_FOLLOWING_OPTIONS_ARE_ONLY_FOR_DEVELOPERS: Следующие параметры предназначены только для разработчиков и опытных администраторов. Изменяйте параметры только в том случае, если вы действительно их понимаете. Например: никогда не активируйте отчет об ошибках для действующего сайта, используйте эту опцию только для исправления ошибок. +THE_FOLLOWING_OPTIONS_ARE_ONLY_FOR_DEVELOPERS: "Следующие параметры предназначены только для разработчиков и опытных администраторов. Изменяйте параметры только в том случае, если вы действительно их понимаете. Например: никогда не активируйте отчет об ошибках для действующего сайта, используйте эту опцию только для исправления ошибок." THIS_APPLIES_ONLY_FOR_FUTURE_IMAGES_IN_THE_CONTENT_AREA_: Это относится только к будущим изображениям в области содержимого. TRUSTED_IPS_FOR_PROXY_(COMMA_SEPARATED): Список надежных IP-адресов для прокси (список, разделенный запятыми) TWIG_CACHE: Twig кэш diff --git a/system/author/layouts/layout.twig b/system/author/layouts/layout.twig index f9e576f..a1910b2 100644 --- a/system/author/layouts/layout.twig +++ b/system/author/layouts/layout.twig @@ -48,6 +48,7 @@ diff --git a/system/author/layouts/layoutBlox.twig b/system/author/layouts/layoutBlox.twig index f20438a..3ebdf62 100644 --- a/system/author/layouts/layoutBlox.twig +++ b/system/author/layouts/layoutBlox.twig @@ -57,6 +57,7 @@