From d402fe364e6f8a5580e41fe022e6abf8eb3ed92e Mon Sep 17 00:00:00 2001 From: Marek Bachmann Date: Fri, 25 Nov 2022 19:44:09 +0100 Subject: [PATCH 01/43] Show image size limit in Frio as "usagemessage" for photo_upload --- mod/photos.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mod/photos.php b/mod/photos.php index e5a24d22a9..eff5daceb4 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -914,7 +914,9 @@ function photos_content(App $a) '$submit' => DI::l10n()->t('Submit'), ]); - $usage_message = ''; + $maximagesize_bytes = DI::config()->get('system', 'maximagesize'); + $maximagesize_Mbytes = ($maximagesize_bytes / (10**6)); + $usage_message = DI::l10n()->t('The maximum accepted image size is: ') . $maximagesize_Mbytes . ' MB'; $tpl = Renderer::getMarkupTemplate('photos_upload.tpl'); From c11e2b0795c34c6196d7bacba7ee9101639e139b Mon Sep 17 00:00:00 2001 From: Marek Bachmann Date: Fri, 25 Nov 2022 19:55:43 +0100 Subject: [PATCH 02/43] updated messages.po --- view/lang/C/messages.po | 114 +++++++++++++++++++++------------------- 1 file changed, 59 insertions(+), 55 deletions(-) diff --git a/view/lang/C/messages.po b/view/lang/C/messages.po index 14ac264f17..4085e57e13 100644 --- a/view/lang/C/messages.po +++ b/view/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 2022.12-dev\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-23 18:16+0100\n" +"POT-Creation-Date: 2022-11-25 19:54+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -23,8 +23,8 @@ msgstr "" msgid "Photos" msgstr "" -#: mod/fbrowser.php:119 mod/fbrowser.php:146 mod/photos.php:997 -#: mod/photos.php:1098 src/Content/Conversation.php:389 +#: mod/fbrowser.php:119 mod/fbrowser.php:146 mod/photos.php:999 +#: mod/photos.php:1100 src/Content/Conversation.php:389 #: src/Module/Contact/Follow.php:173 src/Module/Contact/Revoke.php:109 #: src/Module/Contact/Unfollow.php:126 src/Module/Post/Edit.php:164 #: src/Module/Post/Tag/Remove.php:109 src/Module/Profile/RemoteFollow.php:134 @@ -45,7 +45,7 @@ msgstr "" msgid "Unable to locate original post." msgstr "" -#: mod/item.php:179 mod/item.php:184 mod/item.php:853 mod/message.php:69 +#: mod/item.php:179 mod/item.php:184 mod/item.php:855 mod/message.php:69 #: mod/message.php:114 mod/notes.php:44 mod/photos.php:159 mod/photos.php:884 #: src/Module/Attach.php:56 src/Module/BaseApi.php:94 #: src/Module/BaseNotifications.php:98 src/Module/BaseSettings.php:52 @@ -84,23 +84,23 @@ msgstr "" msgid "Permission denied." msgstr "" -#: mod/item.php:328 mod/item.php:333 +#: mod/item.php:330 mod/item.php:335 msgid "Empty post discarded." msgstr "" -#: mod/item.php:671 +#: mod/item.php:673 msgid "Post updated." msgstr "" -#: mod/item.php:681 mod/item.php:686 +#: mod/item.php:683 mod/item.php:688 msgid "Item wasn't stored." msgstr "" -#: mod/item.php:697 +#: mod/item.php:699 msgid "Item couldn't be fetched." msgstr "" -#: mod/item.php:829 src/Module/Admin/Themes/Details.php:39 +#: mod/item.php:831 src/Module/Admin/Themes/Details.php:39 #: src/Module/Admin/Themes/Index.php:59 src/Module/Debug/ItemBody.php:42 #: src/Module/Debug/ItemBody.php:57 src/Module/Item/Feed.php:80 msgid "Item not found." @@ -316,7 +316,7 @@ msgstr "" msgid "Insert web link" msgstr "" -#: mod/message.php:203 mod/message.php:360 mod/photos.php:1484 +#: mod/message.php:203 mod/message.php:360 mod/photos.php:1486 #: src/Content/Conversation.php:371 src/Content/Conversation.php:717 #: src/Module/Item/Compose.php:204 src/Module/Post/Edit.php:142 #: src/Module/Profile/UnkMail.php:155 src/Object/Post.php:537 @@ -324,8 +324,8 @@ msgid "Please wait" msgstr "" #: mod/message.php:204 mod/message.php:359 mod/photos.php:914 -#: mod/photos.php:1018 mod/photos.php:1290 mod/photos.php:1331 -#: mod/photos.php:1387 mod/photos.php:1461 +#: mod/photos.php:1020 mod/photos.php:1292 mod/photos.php:1333 +#: mod/photos.php:1389 mod/photos.php:1463 #: src/Module/Calendar/Event/Form.php:250 src/Module/Contact/Advanced.php:132 #: src/Module/Contact/Profile.php:327 #: src/Module/Debug/ActivityPubConversion.php:140 @@ -431,7 +431,7 @@ msgstr "" msgid "Recent Photos" msgstr "" -#: mod/photos.php:110 mod/photos.php:1066 +#: mod/photos.php:110 mod/photos.php:1068 #: src/Module/Profile/Photos/Index.php:172 #: src/Module/Profile/Photos/Index.php:189 msgid "Upload New Photos" @@ -521,159 +521,163 @@ msgstr "" msgid "Access to this item is restricted." msgstr "" -#: mod/photos.php:924 +#: mod/photos.php:919 +msgid "The maximum accepted image size is: " +msgstr "" + +#: mod/photos.php:926 msgid "Upload Photos" msgstr "" -#: mod/photos.php:928 mod/photos.php:1014 +#: mod/photos.php:930 mod/photos.php:1016 msgid "New album name: " msgstr "" -#: mod/photos.php:929 +#: mod/photos.php:931 msgid "or select existing album:" msgstr "" -#: mod/photos.php:930 +#: mod/photos.php:932 msgid "Do not show a status post for this upload" msgstr "" -#: mod/photos.php:932 mod/photos.php:1286 src/Content/Conversation.php:373 +#: mod/photos.php:934 mod/photos.php:1288 src/Content/Conversation.php:373 #: src/Module/Calendar/Event/Form.php:253 src/Module/Post/Edit.php:179 msgid "Permissions" msgstr "" -#: mod/photos.php:995 +#: mod/photos.php:997 msgid "Do you really want to delete this photo album and all its photos?" msgstr "" -#: mod/photos.php:996 mod/photos.php:1019 +#: mod/photos.php:998 mod/photos.php:1021 msgid "Delete Album" msgstr "" -#: mod/photos.php:1023 +#: mod/photos.php:1025 msgid "Edit Album" msgstr "" -#: mod/photos.php:1024 +#: mod/photos.php:1026 msgid "Drop Album" msgstr "" -#: mod/photos.php:1028 +#: mod/photos.php:1030 msgid "Show Newest First" msgstr "" -#: mod/photos.php:1030 +#: mod/photos.php:1032 msgid "Show Oldest First" msgstr "" -#: mod/photos.php:1051 src/Module/Profile/Photos/Index.php:140 +#: mod/photos.php:1053 src/Module/Profile/Photos/Index.php:140 msgid "View Photo" msgstr "" -#: mod/photos.php:1084 +#: mod/photos.php:1086 msgid "Permission denied. Access to this item may be restricted." msgstr "" -#: mod/photos.php:1086 +#: mod/photos.php:1088 msgid "Photo not available" msgstr "" -#: mod/photos.php:1096 +#: mod/photos.php:1098 msgid "Do you really want to delete this photo?" msgstr "" -#: mod/photos.php:1097 mod/photos.php:1291 +#: mod/photos.php:1099 mod/photos.php:1293 msgid "Delete Photo" msgstr "" -#: mod/photos.php:1189 +#: mod/photos.php:1191 msgid "View photo" msgstr "" -#: mod/photos.php:1191 +#: mod/photos.php:1193 msgid "Edit photo" msgstr "" -#: mod/photos.php:1192 +#: mod/photos.php:1194 msgid "Delete photo" msgstr "" -#: mod/photos.php:1193 +#: mod/photos.php:1195 msgid "Use as profile photo" msgstr "" -#: mod/photos.php:1200 +#: mod/photos.php:1202 msgid "Private Photo" msgstr "" -#: mod/photos.php:1206 +#: mod/photos.php:1208 msgid "View Full Size" msgstr "" -#: mod/photos.php:1259 +#: mod/photos.php:1261 msgid "Tags: " msgstr "" -#: mod/photos.php:1262 +#: mod/photos.php:1264 msgid "[Select tags to remove]" msgstr "" -#: mod/photos.php:1277 +#: mod/photos.php:1279 msgid "New album name" msgstr "" -#: mod/photos.php:1278 +#: mod/photos.php:1280 msgid "Caption" msgstr "" -#: mod/photos.php:1279 +#: mod/photos.php:1281 msgid "Add a Tag" msgstr "" -#: mod/photos.php:1279 +#: mod/photos.php:1281 msgid "Example: @bob, @Barbara_Jensen, @jim@example.com, #California, #camping" msgstr "" -#: mod/photos.php:1280 +#: mod/photos.php:1282 msgid "Do not rotate" msgstr "" -#: mod/photos.php:1281 +#: mod/photos.php:1283 msgid "Rotate CW (right)" msgstr "" -#: mod/photos.php:1282 +#: mod/photos.php:1284 msgid "Rotate CCW (left)" msgstr "" -#: mod/photos.php:1328 mod/photos.php:1384 mod/photos.php:1458 +#: mod/photos.php:1330 mod/photos.php:1386 mod/photos.php:1460 #: src/Module/Contact.php:547 src/Module/Item/Compose.php:188 #: src/Object/Post.php:983 msgid "This is you" msgstr "" -#: mod/photos.php:1330 mod/photos.php:1386 mod/photos.php:1460 +#: mod/photos.php:1332 mod/photos.php:1388 mod/photos.php:1462 #: src/Object/Post.php:531 src/Object/Post.php:985 msgid "Comment" msgstr "" -#: mod/photos.php:1332 mod/photos.php:1388 mod/photos.php:1462 +#: mod/photos.php:1334 mod/photos.php:1390 mod/photos.php:1464 #: src/Content/Conversation.php:386 src/Module/Calendar/Event/Form.php:248 #: src/Module/Item/Compose.php:199 src/Module/Post/Edit.php:162 #: src/Object/Post.php:997 msgid "Preview" msgstr "" -#: mod/photos.php:1333 src/Content/Conversation.php:341 +#: mod/photos.php:1335 src/Content/Conversation.php:341 #: src/Module/Post/Edit.php:127 src/Object/Post.php:987 msgid "Loading..." msgstr "" -#: mod/photos.php:1419 src/Content/Conversation.php:633 src/Object/Post.php:255 +#: mod/photos.php:1421 src/Content/Conversation.php:633 src/Object/Post.php:255 msgid "Select" msgstr "" -#: mod/photos.php:1420 src/Content/Conversation.php:634 +#: mod/photos.php:1422 src/Content/Conversation.php:634 #: src/Module/Moderation/Users/Active.php:136 #: src/Module/Moderation/Users/Blocked.php:136 #: src/Module/Moderation/Users/Index.php:151 @@ -681,23 +685,23 @@ msgstr "" msgid "Delete" msgstr "" -#: mod/photos.php:1481 src/Object/Post.php:378 +#: mod/photos.php:1483 src/Object/Post.php:378 msgid "Like" msgstr "" -#: mod/photos.php:1482 src/Object/Post.php:378 +#: mod/photos.php:1484 src/Object/Post.php:378 msgid "I like this (toggle)" msgstr "" -#: mod/photos.php:1483 src/Object/Post.php:379 +#: mod/photos.php:1485 src/Object/Post.php:379 msgid "Dislike" msgstr "" -#: mod/photos.php:1485 src/Object/Post.php:379 +#: mod/photos.php:1487 src/Object/Post.php:379 msgid "I don't like this (toggle)" msgstr "" -#: mod/photos.php:1507 +#: mod/photos.php:1509 msgid "Map" msgstr "" From 9dd1cf831630b805187ca1a3341153ff2dcfda59 Mon Sep 17 00:00:00 2001 From: MarekBenjamin <117765478+MarekBenjamin@users.noreply.github.com> Date: Fri, 25 Nov 2022 21:53:32 +0100 Subject: [PATCH 03/43] Update mod/photos.php Co-authored-by: Hypolite Petovan --- mod/photos.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/photos.php b/mod/photos.php index eff5daceb4..a78f8d1012 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -916,7 +916,7 @@ function photos_content(App $a) $maximagesize_bytes = DI::config()->get('system', 'maximagesize'); $maximagesize_Mbytes = ($maximagesize_bytes / (10**6)); - $usage_message = DI::l10n()->t('The maximum accepted image size is: ') . $maximagesize_Mbytes . ' MB'; + $usage_message = DI::l10n()->t('The maximum accepted image size is %.3g MB', $maximagesize_Mbytes); $tpl = Renderer::getMarkupTemplate('photos_upload.tpl'); From bb67f6e2195a03b99d3d0e53c62e81b791af7377 Mon Sep 17 00:00:00 2001 From: Marek Bachmann Date: Fri, 25 Nov 2022 22:57:06 +0100 Subject: [PATCH 04/43] Added check if upload_max_filesize (php.ini) or friendica option 'maxfilesize' is dominant for the actual image upload limit and print out the lower (relevant) one. --- mod/photos.php | 42 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/mod/photos.php b/mod/photos.php index a78f8d1012..f6ed55793b 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -914,9 +914,47 @@ function photos_content(App $a) '$submit' => DI::l10n()->t('Submit'), ]); - $maximagesize_bytes = DI::config()->get('system', 'maximagesize'); - $maximagesize_Mbytes = ($maximagesize_bytes / (10**6)); + /* This block determines which setting actually limits upload size of images: + * limit of Friendica ('maximagesize') or upload_max_filesize + * and outputs the lower one. + */ + // init output var in case no number value could be retrieved. + $maximagesize_Mbytes = 0; + $dom_limitedby = ''; + { + // Get the relevant size limits for uploads. Abbreviated var names: MaxImageSize -> mis; upload_max_filesize -> umf + $mis_bytes = DI::config()->get('system', 'maximagesize'); + // get_cfg_var('upload_max_filesize') outputs a string in the shorthand notation, need to convert it to bytes + $umf_string = get_cfg_var('upload_max_filesize'); + $umf_bytes = filter_var($umf_string, FILTER_SANITIZE_NUMBER_INT); + switch (substr($umf_string, -1)) { + // According to https://www.php.net/manual/en/faq.using.php#faq.using.shorthandbytes only K, M, and G is used. + case 'M': + $umf_bytes *= 10**6; + break; + case 'K': + $umf_bytes *= 10**3; + break; + case 'G': + $umf_bytes *= 10**9; + break; + } + if (is_numeric($mis_bytes) && is_numeric($umf_bytes)) { + // When PHP is configured with upload_max_filesize less than maximagesize provide this lower limit. + if ($umf_bytes < $mis_bytes) { + $maximagesize_Mbytes = ($umf_bytes / (10 ** 6)); + $dom_limitedby = 'PHP.ini'; + } else { + $maximagesize_Mbytes = ($mis_bytes / (10 ** 6)); + + } + } + } $usage_message = DI::l10n()->t('The maximum accepted image size is %.3g MB', $maximagesize_Mbytes); + // Do we want to bother the end user with this information? If yes uncomment + // if (strlen($dom_limitedby) > 0) { + // $usage_message .= ' ('. $dom_limitedby . ')'; + // } $tpl = Renderer::getMarkupTemplate('photos_upload.tpl'); From 74bab60989fb4d09bdcef5bc7589b8a2503b0bf5 Mon Sep 17 00:00:00 2001 From: Marek Bachmann Date: Fri, 25 Nov 2022 23:01:25 +0100 Subject: [PATCH 05/43] message.po once more --- view/lang/C/messages.po | 102 ++++++++++++++++++++-------------------- 1 file changed, 51 insertions(+), 51 deletions(-) diff --git a/view/lang/C/messages.po b/view/lang/C/messages.po index 4085e57e13..f00a0814a0 100644 --- a/view/lang/C/messages.po +++ b/view/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 2022.12-dev\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-25 19:54+0100\n" +"POT-Creation-Date: 2022-11-25 23:01+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -23,8 +23,8 @@ msgstr "" msgid "Photos" msgstr "" -#: mod/fbrowser.php:119 mod/fbrowser.php:146 mod/photos.php:999 -#: mod/photos.php:1100 src/Content/Conversation.php:389 +#: mod/fbrowser.php:119 mod/fbrowser.php:146 mod/photos.php:1037 +#: mod/photos.php:1138 src/Content/Conversation.php:389 #: src/Module/Contact/Follow.php:173 src/Module/Contact/Revoke.php:109 #: src/Module/Contact/Unfollow.php:126 src/Module/Post/Edit.php:164 #: src/Module/Post/Tag/Remove.php:109 src/Module/Profile/RemoteFollow.php:134 @@ -316,7 +316,7 @@ msgstr "" msgid "Insert web link" msgstr "" -#: mod/message.php:203 mod/message.php:360 mod/photos.php:1486 +#: mod/message.php:203 mod/message.php:360 mod/photos.php:1524 #: src/Content/Conversation.php:371 src/Content/Conversation.php:717 #: src/Module/Item/Compose.php:204 src/Module/Post/Edit.php:142 #: src/Module/Profile/UnkMail.php:155 src/Object/Post.php:537 @@ -324,8 +324,8 @@ msgid "Please wait" msgstr "" #: mod/message.php:204 mod/message.php:359 mod/photos.php:914 -#: mod/photos.php:1020 mod/photos.php:1292 mod/photos.php:1333 -#: mod/photos.php:1389 mod/photos.php:1463 +#: mod/photos.php:1058 mod/photos.php:1330 mod/photos.php:1371 +#: mod/photos.php:1427 mod/photos.php:1501 #: src/Module/Calendar/Event/Form.php:250 src/Module/Contact/Advanced.php:132 #: src/Module/Contact/Profile.php:327 #: src/Module/Debug/ActivityPubConversion.php:140 @@ -431,7 +431,7 @@ msgstr "" msgid "Recent Photos" msgstr "" -#: mod/photos.php:110 mod/photos.php:1068 +#: mod/photos.php:110 mod/photos.php:1106 #: src/Module/Profile/Photos/Index.php:172 #: src/Module/Profile/Photos/Index.php:189 msgid "Upload New Photos" @@ -521,163 +521,163 @@ msgstr "" msgid "Access to this item is restricted." msgstr "" -#: mod/photos.php:919 -msgid "The maximum accepted image size is: " +#: mod/photos.php:953 +msgid "The maximum accepted image size is %.3g MB" msgstr "" -#: mod/photos.php:926 +#: mod/photos.php:964 msgid "Upload Photos" msgstr "" -#: mod/photos.php:930 mod/photos.php:1016 +#: mod/photos.php:968 mod/photos.php:1054 msgid "New album name: " msgstr "" -#: mod/photos.php:931 +#: mod/photos.php:969 msgid "or select existing album:" msgstr "" -#: mod/photos.php:932 +#: mod/photos.php:970 msgid "Do not show a status post for this upload" msgstr "" -#: mod/photos.php:934 mod/photos.php:1288 src/Content/Conversation.php:373 +#: mod/photos.php:972 mod/photos.php:1326 src/Content/Conversation.php:373 #: src/Module/Calendar/Event/Form.php:253 src/Module/Post/Edit.php:179 msgid "Permissions" msgstr "" -#: mod/photos.php:997 +#: mod/photos.php:1035 msgid "Do you really want to delete this photo album and all its photos?" msgstr "" -#: mod/photos.php:998 mod/photos.php:1021 +#: mod/photos.php:1036 mod/photos.php:1059 msgid "Delete Album" msgstr "" -#: mod/photos.php:1025 +#: mod/photos.php:1063 msgid "Edit Album" msgstr "" -#: mod/photos.php:1026 +#: mod/photos.php:1064 msgid "Drop Album" msgstr "" -#: mod/photos.php:1030 +#: mod/photos.php:1068 msgid "Show Newest First" msgstr "" -#: mod/photos.php:1032 +#: mod/photos.php:1070 msgid "Show Oldest First" msgstr "" -#: mod/photos.php:1053 src/Module/Profile/Photos/Index.php:140 +#: mod/photos.php:1091 src/Module/Profile/Photos/Index.php:140 msgid "View Photo" msgstr "" -#: mod/photos.php:1086 +#: mod/photos.php:1124 msgid "Permission denied. Access to this item may be restricted." msgstr "" -#: mod/photos.php:1088 +#: mod/photos.php:1126 msgid "Photo not available" msgstr "" -#: mod/photos.php:1098 +#: mod/photos.php:1136 msgid "Do you really want to delete this photo?" msgstr "" -#: mod/photos.php:1099 mod/photos.php:1293 +#: mod/photos.php:1137 mod/photos.php:1331 msgid "Delete Photo" msgstr "" -#: mod/photos.php:1191 +#: mod/photos.php:1229 msgid "View photo" msgstr "" -#: mod/photos.php:1193 +#: mod/photos.php:1231 msgid "Edit photo" msgstr "" -#: mod/photos.php:1194 +#: mod/photos.php:1232 msgid "Delete photo" msgstr "" -#: mod/photos.php:1195 +#: mod/photos.php:1233 msgid "Use as profile photo" msgstr "" -#: mod/photos.php:1202 +#: mod/photos.php:1240 msgid "Private Photo" msgstr "" -#: mod/photos.php:1208 +#: mod/photos.php:1246 msgid "View Full Size" msgstr "" -#: mod/photos.php:1261 +#: mod/photos.php:1299 msgid "Tags: " msgstr "" -#: mod/photos.php:1264 +#: mod/photos.php:1302 msgid "[Select tags to remove]" msgstr "" -#: mod/photos.php:1279 +#: mod/photos.php:1317 msgid "New album name" msgstr "" -#: mod/photos.php:1280 +#: mod/photos.php:1318 msgid "Caption" msgstr "" -#: mod/photos.php:1281 +#: mod/photos.php:1319 msgid "Add a Tag" msgstr "" -#: mod/photos.php:1281 +#: mod/photos.php:1319 msgid "Example: @bob, @Barbara_Jensen, @jim@example.com, #California, #camping" msgstr "" -#: mod/photos.php:1282 +#: mod/photos.php:1320 msgid "Do not rotate" msgstr "" -#: mod/photos.php:1283 +#: mod/photos.php:1321 msgid "Rotate CW (right)" msgstr "" -#: mod/photos.php:1284 +#: mod/photos.php:1322 msgid "Rotate CCW (left)" msgstr "" -#: mod/photos.php:1330 mod/photos.php:1386 mod/photos.php:1460 +#: mod/photos.php:1368 mod/photos.php:1424 mod/photos.php:1498 #: src/Module/Contact.php:547 src/Module/Item/Compose.php:188 #: src/Object/Post.php:983 msgid "This is you" msgstr "" -#: mod/photos.php:1332 mod/photos.php:1388 mod/photos.php:1462 +#: mod/photos.php:1370 mod/photos.php:1426 mod/photos.php:1500 #: src/Object/Post.php:531 src/Object/Post.php:985 msgid "Comment" msgstr "" -#: mod/photos.php:1334 mod/photos.php:1390 mod/photos.php:1464 +#: mod/photos.php:1372 mod/photos.php:1428 mod/photos.php:1502 #: src/Content/Conversation.php:386 src/Module/Calendar/Event/Form.php:248 #: src/Module/Item/Compose.php:199 src/Module/Post/Edit.php:162 #: src/Object/Post.php:997 msgid "Preview" msgstr "" -#: mod/photos.php:1335 src/Content/Conversation.php:341 +#: mod/photos.php:1373 src/Content/Conversation.php:341 #: src/Module/Post/Edit.php:127 src/Object/Post.php:987 msgid "Loading..." msgstr "" -#: mod/photos.php:1421 src/Content/Conversation.php:633 src/Object/Post.php:255 +#: mod/photos.php:1459 src/Content/Conversation.php:633 src/Object/Post.php:255 msgid "Select" msgstr "" -#: mod/photos.php:1422 src/Content/Conversation.php:634 +#: mod/photos.php:1460 src/Content/Conversation.php:634 #: src/Module/Moderation/Users/Active.php:136 #: src/Module/Moderation/Users/Blocked.php:136 #: src/Module/Moderation/Users/Index.php:151 @@ -685,23 +685,23 @@ msgstr "" msgid "Delete" msgstr "" -#: mod/photos.php:1483 src/Object/Post.php:378 +#: mod/photos.php:1521 src/Object/Post.php:378 msgid "Like" msgstr "" -#: mod/photos.php:1484 src/Object/Post.php:378 +#: mod/photos.php:1522 src/Object/Post.php:378 msgid "I like this (toggle)" msgstr "" -#: mod/photos.php:1485 src/Object/Post.php:379 +#: mod/photos.php:1523 src/Object/Post.php:379 msgid "Dislike" msgstr "" -#: mod/photos.php:1487 src/Object/Post.php:379 +#: mod/photos.php:1525 src/Object/Post.php:379 msgid "I don't like this (toggle)" msgstr "" -#: mod/photos.php:1509 +#: mod/photos.php:1547 msgid "Map" msgstr "" From c4c1bd2908ff62441e0dfe16cc3ce8e9d76ab662 Mon Sep 17 00:00:00 2001 From: Marek Bachmann Date: Fri, 25 Nov 2022 23:36:28 +0100 Subject: [PATCH 06/43] changed var name --- mod/photos.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mod/photos.php b/mod/photos.php index f6ed55793b..9fdddfca44 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -920,7 +920,7 @@ function photos_content(App $a) */ // init output var in case no number value could be retrieved. $maximagesize_Mbytes = 0; - $dom_limitedby = ''; + $sizelimitedby = ''; { // Get the relevant size limits for uploads. Abbreviated var names: MaxImageSize -> mis; upload_max_filesize -> umf $mis_bytes = DI::config()->get('system', 'maximagesize'); @@ -943,7 +943,7 @@ function photos_content(App $a) // When PHP is configured with upload_max_filesize less than maximagesize provide this lower limit. if ($umf_bytes < $mis_bytes) { $maximagesize_Mbytes = ($umf_bytes / (10 ** 6)); - $dom_limitedby = 'PHP.ini'; + $sizelimitedby = 'PHP.ini'; } else { $maximagesize_Mbytes = ($mis_bytes / (10 ** 6)); @@ -952,9 +952,9 @@ function photos_content(App $a) } $usage_message = DI::l10n()->t('The maximum accepted image size is %.3g MB', $maximagesize_Mbytes); // Do we want to bother the end user with this information? If yes uncomment - // if (strlen($dom_limitedby) > 0) { - // $usage_message .= ' ('. $dom_limitedby . ')'; - // } + //if (strlen($sizelimitedby) > 0) { + // $usage_message .= ' ('. $sizelimitedby . ')'; + //} $tpl = Renderer::getMarkupTemplate('photos_upload.tpl'); From 907deed52306d03fc6a243335a337e902bd016f8 Mon Sep 17 00:00:00 2001 From: Marek Bachmann Date: Sat, 26 Nov 2022 21:43:31 +0100 Subject: [PATCH 07/43] introduced getBytesFromShorthand function to covert from shorthand notation to int --- mod/photos.php | 36 ++++++------------------------------ src/Util/Strings.php | 31 +++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 30 deletions(-) diff --git a/mod/photos.php b/mod/photos.php index 9fdddfca44..1738235276 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -918,43 +918,19 @@ function photos_content(App $a) * limit of Friendica ('maximagesize') or upload_max_filesize * and outputs the lower one. */ - // init output var in case no number value could be retrieved. $maximagesize_Mbytes = 0; - $sizelimitedby = ''; { // Get the relevant size limits for uploads. Abbreviated var names: MaxImageSize -> mis; upload_max_filesize -> umf $mis_bytes = DI::config()->get('system', 'maximagesize'); - // get_cfg_var('upload_max_filesize') outputs a string in the shorthand notation, need to convert it to bytes - $umf_string = get_cfg_var('upload_max_filesize'); - $umf_bytes = filter_var($umf_string, FILTER_SANITIZE_NUMBER_INT); - switch (substr($umf_string, -1)) { - // According to https://www.php.net/manual/en/faq.using.php#faq.using.shorthandbytes only K, M, and G is used. - case 'M': - $umf_bytes *= 10**6; - break; - case 'K': - $umf_bytes *= 10**3; - break; - case 'G': - $umf_bytes *= 10**9; - break; - } - if (is_numeric($mis_bytes) && is_numeric($umf_bytes)) { - // When PHP is configured with upload_max_filesize less than maximagesize provide this lower limit. - if ($umf_bytes < $mis_bytes) { - $maximagesize_Mbytes = ($umf_bytes / (10 ** 6)); - $sizelimitedby = 'PHP.ini'; - } else { - $maximagesize_Mbytes = ($mis_bytes / (10 ** 6)); + $umf_bytes = Strings::getBytesFromShorthand(get_cfg_var('upload_max_filesize')); - } + if (is_numeric($mis_bytes)) { + // When PHP is configured with upload_max_filesize less than maximagesize provide this lower limit. + ($umf_bytes < $mis_bytes) ? + ($maximagesize_Mbytes = ($umf_bytes / (10 ** 6))) : ($maximagesize_Mbytes = ($mis_bytes / (10 ** 6))); } } - $usage_message = DI::l10n()->t('The maximum accepted image size is %.3g MB', $maximagesize_Mbytes); - // Do we want to bother the end user with this information? If yes uncomment - //if (strlen($sizelimitedby) > 0) { - // $usage_message .= ' ('. $sizelimitedby . ')'; - //} + $usage_message = DI::l10n()->t('The maximum accepted image size is %.3g MB', Strings::getBytesFromShorthand(get_cfg_var('upload_max_filesize'))); $tpl = Renderer::getMarkupTemplate('photos_upload.tpl'); diff --git a/src/Util/Strings.php b/src/Util/Strings.php index 84a8b6727a..8c22c321df 100644 --- a/src/Util/Strings.php +++ b/src/Util/Strings.php @@ -515,4 +515,35 @@ class Strings return $text; } + + /** + * This function converts a PHP's shorhand notation string for file sizes in to an integer number of total bytes. + * For example: The string for shorthand notation of '2M' (which is 2,097,152 Bytes) is converted to 2097152 + * For more information about file size shorhand notation see: + * https://www.php.net/manual/en/faq.using.php#faq.using.shorthandbytes + * @param string $shorthand + * @return int + */ + public static function getBytesFromShorthand(string $shorthand): int + { + $shorthand = trim($shorthand); + + if (is_numeric($shorthand)) + return $shorthand; + + $last = strtolower($shorthand[strlen($shorthand)-1]); + $shorthand = substr($shorthand, 0, -1); // necessary since PHP 7.1; otherwise optional + + switch($last) { + // The 'G' modifier is available since PHP 5.1.0 + case 'g': + $shorthand *= 1024; + case 'm': + $shorthand *= 1024; + case 'k': + $shorthand *= 1024; + } + + return $shorthand; + } } From f4d49e561c0d74e74f310c0eebc3a4d15a9ac13f Mon Sep 17 00:00:00 2001 From: Marek Bachmann Date: Sat, 26 Nov 2022 21:44:41 +0100 Subject: [PATCH 08/43] fixed a forgotten debug output --- mod/photos.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/photos.php b/mod/photos.php index 1738235276..c2f0b6291e 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -930,7 +930,7 @@ function photos_content(App $a) ($maximagesize_Mbytes = ($umf_bytes / (10 ** 6))) : ($maximagesize_Mbytes = ($mis_bytes / (10 ** 6))); } } - $usage_message = DI::l10n()->t('The maximum accepted image size is %.3g MB', Strings::getBytesFromShorthand(get_cfg_var('upload_max_filesize'))); + $usage_message = DI::l10n()->t('The maximum accepted image size is %.3g MB', $maximagesize_Mbytes); $tpl = Renderer::getMarkupTemplate('photos_upload.tpl'); From f88722bf7f00048a0b6222c677120da548668020 Mon Sep 17 00:00:00 2001 From: Marek Bachmann Date: Sat, 26 Nov 2022 21:47:55 +0100 Subject: [PATCH 09/43] Better formatting --- mod/photos.php | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/mod/photos.php b/mod/photos.php index c2f0b6291e..d5689f5fd5 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -914,22 +914,18 @@ function photos_content(App $a) '$submit' => DI::l10n()->t('Submit'), ]); - /* This block determines which setting actually limits upload size of images: - * limit of Friendica ('maximagesize') or upload_max_filesize - * and outputs the lower one. - */ + // Determine which setting actually limits upload size of images: limit of Friendica ('maximagesize') or upload_max_filesize $maximagesize_Mbytes = 0; - { - // Get the relevant size limits for uploads. Abbreviated var names: MaxImageSize -> mis; upload_max_filesize -> umf - $mis_bytes = DI::config()->get('system', 'maximagesize'); - $umf_bytes = Strings::getBytesFromShorthand(get_cfg_var('upload_max_filesize')); + // Get the relevant size limits for uploads. Abbreviated var names: MaxImageSize -> mis; upload_max_filesize -> umf + $mis_bytes = DI::config()->get('system', 'maximagesize'); + $umf_bytes = Strings::getBytesFromShorthand(get_cfg_var('upload_max_filesize')); - if (is_numeric($mis_bytes)) { - // When PHP is configured with upload_max_filesize less than maximagesize provide this lower limit. - ($umf_bytes < $mis_bytes) ? - ($maximagesize_Mbytes = ($umf_bytes / (10 ** 6))) : ($maximagesize_Mbytes = ($mis_bytes / (10 ** 6))); - } + if (is_numeric($mis_bytes)) { + // When PHP is configured with upload_max_filesize less than maximagesize provide this lower limit. + ($umf_bytes < $mis_bytes) ? + ($maximagesize_Mbytes = ($umf_bytes / (10 ** 6))) : ($maximagesize_Mbytes = ($mis_bytes / (10 ** 6))); } + $usage_message = DI::l10n()->t('The maximum accepted image size is %.3g MB', $maximagesize_Mbytes); $tpl = Renderer::getMarkupTemplate('photos_upload.tpl'); From 6c73077bbcd803d28be2673a2b0524fd87968076 Mon Sep 17 00:00:00 2001 From: Marek Bachmann Date: Sat, 26 Nov 2022 21:53:12 +0100 Subject: [PATCH 10/43] whitespaces --- mod/photos.php | 2 +- src/Util/Strings.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/mod/photos.php b/mod/photos.php index d5689f5fd5..7b703d818b 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -925,7 +925,7 @@ function photos_content(App $a) ($umf_bytes < $mis_bytes) ? ($maximagesize_Mbytes = ($umf_bytes / (10 ** 6))) : ($maximagesize_Mbytes = ($mis_bytes / (10 ** 6))); } - + $usage_message = DI::l10n()->t('The maximum accepted image size is %.3g MB', $maximagesize_Mbytes); $tpl = Renderer::getMarkupTemplate('photos_upload.tpl'); diff --git a/src/Util/Strings.php b/src/Util/Strings.php index 8c22c321df..ac903cd3f7 100644 --- a/src/Util/Strings.php +++ b/src/Util/Strings.php @@ -546,4 +546,5 @@ class Strings return $shorthand; } + } From ce56cabd9f986c28f48c5af6eb74763453f1aa6c Mon Sep 17 00:00:00 2001 From: MarekBenjamin <117765478+MarekBenjamin@users.noreply.github.com> Date: Sat, 26 Nov 2022 23:12:46 +0100 Subject: [PATCH 11/43] Update src/Util/Strings.php Co-authored-by: Hypolite Petovan --- src/Util/Strings.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Util/Strings.php b/src/Util/Strings.php index ac903cd3f7..7b8d999d3a 100644 --- a/src/Util/Strings.php +++ b/src/Util/Strings.php @@ -519,8 +519,7 @@ class Strings /** * This function converts a PHP's shorhand notation string for file sizes in to an integer number of total bytes. * For example: The string for shorthand notation of '2M' (which is 2,097,152 Bytes) is converted to 2097152 - * For more information about file size shorhand notation see: - * https://www.php.net/manual/en/faq.using.php#faq.using.shorthandbytes + * @see https://www.php.net/manual/en/faq.using.php#faq.using.shorthandbytes * @param string $shorthand * @return int */ From 765b50bde8cd2cb9e4f89fd67d81c1c1509b5261 Mon Sep 17 00:00:00 2001 From: MarekBenjamin <117765478+MarekBenjamin@users.noreply.github.com> Date: Sat, 26 Nov 2022 23:14:21 +0100 Subject: [PATCH 12/43] Update src/Util/Strings.php Co-authored-by: Hypolite Petovan --- src/Util/Strings.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Util/Strings.php b/src/Util/Strings.php index 7b8d999d3a..0972e44486 100644 --- a/src/Util/Strings.php +++ b/src/Util/Strings.php @@ -525,16 +525,16 @@ class Strings */ public static function getBytesFromShorthand(string $shorthand): int { - $shorthand = trim($shorthand); + $shorthand = trim($shorthand); - if (is_numeric($shorthand)) + if (is_numeric($shorthand)) { return $shorthand; + } - $last = strtolower($shorthand[strlen($shorthand)-1]); - $shorthand = substr($shorthand, 0, -1); // necessary since PHP 7.1; otherwise optional + $last = strtolower($shorthand[strlen($shorthand)-1]); + $shorthand = substr($shorthand, 0, -1); switch($last) { - // The 'G' modifier is available since PHP 5.1.0 case 'g': $shorthand *= 1024; case 'm': From 54289b2d0849cfab54bbbf288a0615f4be3d4dbe Mon Sep 17 00:00:00 2001 From: Marek Bachmann Date: Sat, 26 Nov 2022 23:25:11 +0100 Subject: [PATCH 13/43] Integrated isnumeric check to limit comparison condition --- mod/photos.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/mod/photos.php b/mod/photos.php index 7b703d818b..8bbfc590a7 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -914,17 +914,15 @@ function photos_content(App $a) '$submit' => DI::l10n()->t('Submit'), ]); - // Determine which setting actually limits upload size of images: limit of Friendica ('maximagesize') or upload_max_filesize $maximagesize_Mbytes = 0; // Get the relevant size limits for uploads. Abbreviated var names: MaxImageSize -> mis; upload_max_filesize -> umf $mis_bytes = DI::config()->get('system', 'maximagesize'); - $umf_bytes = Strings::getBytesFromShorthand(get_cfg_var('upload_max_filesize')); + $umf_bytes = Strings::getBytesFromShorthand(ini_get('upload_max_filesize')); + + // When PHP is configured with upload_max_filesize less than maximagesize provide this lower limit. + (($umf_bytes < $mis_bytes) || ! is_numeric($mis_bytes)) ? + ($maximagesize_Mbytes = ($umf_bytes / (10 ** 6))) : ($maximagesize_Mbytes = ($mis_bytes / (10 ** 6))); - if (is_numeric($mis_bytes)) { - // When PHP is configured with upload_max_filesize less than maximagesize provide this lower limit. - ($umf_bytes < $mis_bytes) ? - ($maximagesize_Mbytes = ($umf_bytes / (10 ** 6))) : ($maximagesize_Mbytes = ($mis_bytes / (10 ** 6))); - } $usage_message = DI::l10n()->t('The maximum accepted image size is %.3g MB', $maximagesize_Mbytes); From 597f1ba9e3d8c0de14d111e18dc7b844ad99abc5 Mon Sep 17 00:00:00 2001 From: Marek Bachmann Date: Sat, 26 Nov 2022 23:33:51 +0100 Subject: [PATCH 14/43] using constant value for calculation of MiB output, really no need to cluclate 2**20 for just deviding the bytes by one constant divisor. --- mod/photos.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/photos.php b/mod/photos.php index 8bbfc590a7..2aa2302a50 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -921,7 +921,7 @@ function photos_content(App $a) // When PHP is configured with upload_max_filesize less than maximagesize provide this lower limit. (($umf_bytes < $mis_bytes) || ! is_numeric($mis_bytes)) ? - ($maximagesize_Mbytes = ($umf_bytes / (10 ** 6))) : ($maximagesize_Mbytes = ($mis_bytes / (10 ** 6))); + ($maximagesize_Mbytes = ($umf_bytes / 1048576)) : ($maximagesize_Mbytes = ($mis_bytes / 1048576)); $usage_message = DI::l10n()->t('The maximum accepted image size is %.3g MB', $maximagesize_Mbytes); From f45b3583932728bc4a04964d0bcab94334797e94 Mon Sep 17 00:00:00 2001 From: Marek Bachmann Date: Sat, 26 Nov 2022 23:44:23 +0100 Subject: [PATCH 15/43] using constant value for calculation of MiB output, really no need to calculate 2**20 for just dividing the bytes by one constant divisor. --- mod/photos.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mod/photos.php b/mod/photos.php index 2aa2302a50..4bca8275e3 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -920,9 +920,7 @@ function photos_content(App $a) $umf_bytes = Strings::getBytesFromShorthand(ini_get('upload_max_filesize')); // When PHP is configured with upload_max_filesize less than maximagesize provide this lower limit. - (($umf_bytes < $mis_bytes) || ! is_numeric($mis_bytes)) ? - ($maximagesize_Mbytes = ($umf_bytes / 1048576)) : ($maximagesize_Mbytes = ($mis_bytes / 1048576)); - + $maximagesize_Mbytes = (is_numeric($mis_bytes) && ($mis_bytes < $umf_bytes) ? $mis_bytes : $umf_bytes) / (1048576); $usage_message = DI::l10n()->t('The maximum accepted image size is %.3g MB', $maximagesize_Mbytes); From 719c294fb535c8aa2639d627b97298d0e9f8cbec Mon Sep 17 00:00:00 2001 From: Marek Bachmann Date: Sat, 26 Nov 2022 23:45:58 +0100 Subject: [PATCH 16/43] Added info about upload_max_filesize to admin page --- src/Module/Admin/Site.php | 6 +- view/lang/C/messages.po | 512 +++++++++++++++++++------------------- 2 files changed, 266 insertions(+), 252 deletions(-) diff --git a/src/Module/Admin/Site.php b/src/Module/Admin/Site.php index f7fc9d7934..7943984333 100644 --- a/src/Module/Admin/Site.php +++ b/src/Module/Admin/Site.php @@ -37,6 +37,7 @@ use Friendica\Module\Register; use Friendica\Protocol\Relay; use Friendica\Util\BasePath; use Friendica\Util\EMailer\MailBuilder; +use Friendica\Util\Strings; class Site extends BaseAdmin { @@ -467,7 +468,10 @@ class Site extends BaseAdmin '$show_help' => ['show_help', DI::l10n()->t('Show help entry from navigation menu'), !DI::config()->get('system', 'hide_help'), DI::l10n()->t('Displays the menu entry for the Help pages from the navigation menu. It is always accessible by calling /help directly.')], '$singleuser' => ['singleuser', DI::l10n()->t('Single user instance'), DI::config()->get('system', 'singleuser', '---'), DI::l10n()->t('Make this instance multi-user or single-user for the named user'), $user_names], - '$maximagesize' => ['maximagesize', DI::l10n()->t('Maximum image size'), DI::config()->get('system', 'maximagesize'), DI::l10n()->t('Maximum size in bytes of uploaded images. Default is 0, which means no limits. Be aware that this setting does not affect server-side upload limits.')], + '$maximagesize' => ['maximagesize', DI::l10n()->t('Maximum image size'), DI::config()->get('system', 'maximagesize'), DI::l10n()->t('Maximum size in bytes of uploaded images. Default is 0, which means no limits.') . + DI::l10n()->t('The value of upload_max_filesize in your PHP.ini needs be set to at least the desired limit. ') . + DI::l10n()->t('Currently upload_max_filesize is set to ' . Strings::getBytesFromShorthand(ini_get('upload_max_filesize')) . ' (' . ini_get('upload_max_filesize') . 'B). '), + '1 kB = 1 KiB = 1024 Bytes'], '$maximagelength' => ['maximagelength', DI::l10n()->t('Maximum image length'), DI::config()->get('system', 'max_image_length'), DI::l10n()->t('Maximum length in pixels of the longest side of uploaded images. Default is -1, which means no limits.')], '$jpegimagequality' => ['jpegimagequality', DI::l10n()->t('JPEG image quality'), DI::config()->get('system', 'jpeg_quality'), DI::l10n()->t('Uploaded JPEGS will be saved at this quality setting [0-100]. Default is 100, which is full quality.')], diff --git a/view/lang/C/messages.po b/view/lang/C/messages.po index f00a0814a0..f60cb384d6 100644 --- a/view/lang/C/messages.po +++ b/view/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 2022.12-dev\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-25 23:01+0100\n" +"POT-Creation-Date: 2022-11-26 23:37+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -23,8 +23,8 @@ msgstr "" msgid "Photos" msgstr "" -#: mod/fbrowser.php:119 mod/fbrowser.php:146 mod/photos.php:1037 -#: mod/photos.php:1138 src/Content/Conversation.php:389 +#: mod/fbrowser.php:119 mod/fbrowser.php:146 mod/photos.php:1007 +#: mod/photos.php:1108 src/Content/Conversation.php:389 #: src/Module/Contact/Follow.php:173 src/Module/Contact/Revoke.php:109 #: src/Module/Contact/Unfollow.php:126 src/Module/Post/Edit.php:164 #: src/Module/Post/Tag/Remove.php:109 src/Module/Profile/RemoteFollow.php:134 @@ -316,7 +316,7 @@ msgstr "" msgid "Insert web link" msgstr "" -#: mod/message.php:203 mod/message.php:360 mod/photos.php:1524 +#: mod/message.php:203 mod/message.php:360 mod/photos.php:1494 #: src/Content/Conversation.php:371 src/Content/Conversation.php:717 #: src/Module/Item/Compose.php:204 src/Module/Post/Edit.php:142 #: src/Module/Profile/UnkMail.php:155 src/Object/Post.php:537 @@ -324,8 +324,8 @@ msgid "Please wait" msgstr "" #: mod/message.php:204 mod/message.php:359 mod/photos.php:914 -#: mod/photos.php:1058 mod/photos.php:1330 mod/photos.php:1371 -#: mod/photos.php:1427 mod/photos.php:1501 +#: mod/photos.php:1028 mod/photos.php:1300 mod/photos.php:1341 +#: mod/photos.php:1397 mod/photos.php:1471 #: src/Module/Calendar/Event/Form.php:250 src/Module/Contact/Advanced.php:132 #: src/Module/Contact/Profile.php:327 #: src/Module/Debug/ActivityPubConversion.php:140 @@ -431,7 +431,7 @@ msgstr "" msgid "Recent Photos" msgstr "" -#: mod/photos.php:110 mod/photos.php:1106 +#: mod/photos.php:110 mod/photos.php:1076 #: src/Module/Profile/Photos/Index.php:172 #: src/Module/Profile/Photos/Index.php:189 msgid "Upload New Photos" @@ -521,163 +521,163 @@ msgstr "" msgid "Access to this item is restricted." msgstr "" -#: mod/photos.php:953 +#: mod/photos.php:927 msgid "The maximum accepted image size is %.3g MB" msgstr "" -#: mod/photos.php:964 +#: mod/photos.php:934 msgid "Upload Photos" msgstr "" -#: mod/photos.php:968 mod/photos.php:1054 +#: mod/photos.php:938 mod/photos.php:1024 msgid "New album name: " msgstr "" -#: mod/photos.php:969 +#: mod/photos.php:939 msgid "or select existing album:" msgstr "" -#: mod/photos.php:970 +#: mod/photos.php:940 msgid "Do not show a status post for this upload" msgstr "" -#: mod/photos.php:972 mod/photos.php:1326 src/Content/Conversation.php:373 +#: mod/photos.php:942 mod/photos.php:1296 src/Content/Conversation.php:373 #: src/Module/Calendar/Event/Form.php:253 src/Module/Post/Edit.php:179 msgid "Permissions" msgstr "" -#: mod/photos.php:1035 +#: mod/photos.php:1005 msgid "Do you really want to delete this photo album and all its photos?" msgstr "" -#: mod/photos.php:1036 mod/photos.php:1059 +#: mod/photos.php:1006 mod/photos.php:1029 msgid "Delete Album" msgstr "" -#: mod/photos.php:1063 +#: mod/photos.php:1033 msgid "Edit Album" msgstr "" -#: mod/photos.php:1064 +#: mod/photos.php:1034 msgid "Drop Album" msgstr "" -#: mod/photos.php:1068 +#: mod/photos.php:1038 msgid "Show Newest First" msgstr "" -#: mod/photos.php:1070 +#: mod/photos.php:1040 msgid "Show Oldest First" msgstr "" -#: mod/photos.php:1091 src/Module/Profile/Photos/Index.php:140 +#: mod/photos.php:1061 src/Module/Profile/Photos/Index.php:140 msgid "View Photo" msgstr "" -#: mod/photos.php:1124 +#: mod/photos.php:1094 msgid "Permission denied. Access to this item may be restricted." msgstr "" -#: mod/photos.php:1126 +#: mod/photos.php:1096 msgid "Photo not available" msgstr "" -#: mod/photos.php:1136 +#: mod/photos.php:1106 msgid "Do you really want to delete this photo?" msgstr "" -#: mod/photos.php:1137 mod/photos.php:1331 +#: mod/photos.php:1107 mod/photos.php:1301 msgid "Delete Photo" msgstr "" -#: mod/photos.php:1229 +#: mod/photos.php:1199 msgid "View photo" msgstr "" -#: mod/photos.php:1231 +#: mod/photos.php:1201 msgid "Edit photo" msgstr "" -#: mod/photos.php:1232 +#: mod/photos.php:1202 msgid "Delete photo" msgstr "" -#: mod/photos.php:1233 +#: mod/photos.php:1203 msgid "Use as profile photo" msgstr "" -#: mod/photos.php:1240 +#: mod/photos.php:1210 msgid "Private Photo" msgstr "" -#: mod/photos.php:1246 +#: mod/photos.php:1216 msgid "View Full Size" msgstr "" -#: mod/photos.php:1299 +#: mod/photos.php:1269 msgid "Tags: " msgstr "" -#: mod/photos.php:1302 +#: mod/photos.php:1272 msgid "[Select tags to remove]" msgstr "" -#: mod/photos.php:1317 +#: mod/photos.php:1287 msgid "New album name" msgstr "" -#: mod/photos.php:1318 +#: mod/photos.php:1288 msgid "Caption" msgstr "" -#: mod/photos.php:1319 +#: mod/photos.php:1289 msgid "Add a Tag" msgstr "" -#: mod/photos.php:1319 +#: mod/photos.php:1289 msgid "Example: @bob, @Barbara_Jensen, @jim@example.com, #California, #camping" msgstr "" -#: mod/photos.php:1320 +#: mod/photos.php:1290 msgid "Do not rotate" msgstr "" -#: mod/photos.php:1321 +#: mod/photos.php:1291 msgid "Rotate CW (right)" msgstr "" -#: mod/photos.php:1322 +#: mod/photos.php:1292 msgid "Rotate CCW (left)" msgstr "" -#: mod/photos.php:1368 mod/photos.php:1424 mod/photos.php:1498 +#: mod/photos.php:1338 mod/photos.php:1394 mod/photos.php:1468 #: src/Module/Contact.php:547 src/Module/Item/Compose.php:188 #: src/Object/Post.php:983 msgid "This is you" msgstr "" -#: mod/photos.php:1370 mod/photos.php:1426 mod/photos.php:1500 +#: mod/photos.php:1340 mod/photos.php:1396 mod/photos.php:1470 #: src/Object/Post.php:531 src/Object/Post.php:985 msgid "Comment" msgstr "" -#: mod/photos.php:1372 mod/photos.php:1428 mod/photos.php:1502 +#: mod/photos.php:1342 mod/photos.php:1398 mod/photos.php:1472 #: src/Content/Conversation.php:386 src/Module/Calendar/Event/Form.php:248 #: src/Module/Item/Compose.php:199 src/Module/Post/Edit.php:162 #: src/Object/Post.php:997 msgid "Preview" msgstr "" -#: mod/photos.php:1373 src/Content/Conversation.php:341 +#: mod/photos.php:1343 src/Content/Conversation.php:341 #: src/Module/Post/Edit.php:127 src/Object/Post.php:987 msgid "Loading..." msgstr "" -#: mod/photos.php:1459 src/Content/Conversation.php:633 src/Object/Post.php:255 +#: mod/photos.php:1429 src/Content/Conversation.php:633 src/Object/Post.php:255 msgid "Select" msgstr "" -#: mod/photos.php:1460 src/Content/Conversation.php:634 +#: mod/photos.php:1430 src/Content/Conversation.php:634 #: src/Module/Moderation/Users/Active.php:136 #: src/Module/Moderation/Users/Blocked.php:136 #: src/Module/Moderation/Users/Index.php:151 @@ -685,23 +685,23 @@ msgstr "" msgid "Delete" msgstr "" -#: mod/photos.php:1521 src/Object/Post.php:378 +#: mod/photos.php:1491 src/Object/Post.php:378 msgid "Like" msgstr "" -#: mod/photos.php:1522 src/Object/Post.php:378 +#: mod/photos.php:1492 src/Object/Post.php:378 msgid "I like this (toggle)" msgstr "" -#: mod/photos.php:1523 src/Object/Post.php:379 +#: mod/photos.php:1493 src/Object/Post.php:379 msgid "Dislike" msgstr "" -#: mod/photos.php:1525 src/Object/Post.php:379 +#: mod/photos.php:1495 src/Object/Post.php:379 msgid "I don't like this (toggle)" msgstr "" -#: mod/photos.php:1547 +#: mod/photos.php:1517 msgid "Map" msgstr "" @@ -3619,7 +3619,7 @@ msgstr "" #: src/Module/Admin/Addons/Details.php:111 src/Module/Admin/Addons/Index.php:67 #: src/Module/Admin/Federation.php:202 src/Module/Admin/Logs/Settings.php:79 #: src/Module/Admin/Logs/View.php:84 src/Module/Admin/Queue.php:72 -#: src/Module/Admin/Site.php:431 src/Module/Admin/Storage.php:138 +#: src/Module/Admin/Site.php:432 src/Module/Admin/Storage.php:138 #: src/Module/Admin/Summary.php:216 src/Module/Admin/Themes/Details.php:90 #: src/Module/Admin/Themes/Index.php:111 src/Module/Admin/Tos.php:75 #: src/Module/Moderation/Users/Create.php:61 @@ -3657,7 +3657,7 @@ msgid "Addon %s failed to install." msgstr "" #: src/Module/Admin/Addons/Index.php:69 src/Module/Admin/Features.php:87 -#: src/Module/Admin/Logs/Settings.php:81 src/Module/Admin/Site.php:434 +#: src/Module/Admin/Logs/Settings.php:81 src/Module/Admin/Site.php:435 #: src/Module/Admin/Themes/Index.php:113 src/Module/Admin/Tos.php:83 #: src/Module/Settings/Account.php:560 src/Module/Settings/Addons.php:81 #: src/Module/Settings/Connectors.php:159 @@ -4009,475 +4009,485 @@ msgstr "" msgid "Priority" msgstr "" -#: src/Module/Admin/Site.php:336 src/Module/Settings/Display.php:137 +#: src/Module/Admin/Site.php:337 src/Module/Settings/Display.php:137 msgid "No special theme for mobile devices" msgstr "" -#: src/Module/Admin/Site.php:353 src/Module/Settings/Display.php:147 +#: src/Module/Admin/Site.php:354 src/Module/Settings/Display.php:147 #, php-format msgid "%s - (Experimental)" msgstr "" -#: src/Module/Admin/Site.php:365 +#: src/Module/Admin/Site.php:366 msgid "No community page" msgstr "" -#: src/Module/Admin/Site.php:366 +#: src/Module/Admin/Site.php:367 msgid "No community page for visitors" msgstr "" -#: src/Module/Admin/Site.php:367 +#: src/Module/Admin/Site.php:368 msgid "Public postings from users of this site" msgstr "" -#: src/Module/Admin/Site.php:368 +#: src/Module/Admin/Site.php:369 msgid "Public postings from the federated network" msgstr "" -#: src/Module/Admin/Site.php:369 +#: src/Module/Admin/Site.php:370 msgid "Public postings from local users and the federated network" msgstr "" -#: src/Module/Admin/Site.php:375 +#: src/Module/Admin/Site.php:376 msgid "Multi user instance" msgstr "" -#: src/Module/Admin/Site.php:402 +#: src/Module/Admin/Site.php:403 msgid "Closed" msgstr "" -#: src/Module/Admin/Site.php:403 +#: src/Module/Admin/Site.php:404 msgid "Requires approval" msgstr "" -#: src/Module/Admin/Site.php:404 +#: src/Module/Admin/Site.php:405 msgid "Open" msgstr "" -#: src/Module/Admin/Site.php:408 src/Module/Install.php:222 +#: src/Module/Admin/Site.php:409 src/Module/Install.php:222 msgid "No SSL policy, links will track page SSL state" msgstr "" -#: src/Module/Admin/Site.php:409 src/Module/Install.php:223 +#: src/Module/Admin/Site.php:410 src/Module/Install.php:223 msgid "Force all links to use SSL" msgstr "" -#: src/Module/Admin/Site.php:410 src/Module/Install.php:224 +#: src/Module/Admin/Site.php:411 src/Module/Install.php:224 msgid "Self-signed certificate, use SSL for local links only (discouraged)" msgstr "" -#: src/Module/Admin/Site.php:414 +#: src/Module/Admin/Site.php:415 msgid "Don't check" msgstr "" -#: src/Module/Admin/Site.php:415 +#: src/Module/Admin/Site.php:416 msgid "check the stable version" msgstr "" -#: src/Module/Admin/Site.php:416 +#: src/Module/Admin/Site.php:417 msgid "check the development version" msgstr "" -#: src/Module/Admin/Site.php:420 +#: src/Module/Admin/Site.php:421 msgid "none" msgstr "" -#: src/Module/Admin/Site.php:421 +#: src/Module/Admin/Site.php:422 msgid "Local contacts" msgstr "" -#: src/Module/Admin/Site.php:422 +#: src/Module/Admin/Site.php:423 msgid "Interactors" msgstr "" -#: src/Module/Admin/Site.php:432 src/Module/BaseAdmin.php:90 +#: src/Module/Admin/Site.php:433 src/Module/BaseAdmin.php:90 msgid "Site" msgstr "" -#: src/Module/Admin/Site.php:433 +#: src/Module/Admin/Site.php:434 msgid "General Information" msgstr "" -#: src/Module/Admin/Site.php:435 +#: src/Module/Admin/Site.php:436 msgid "Republish users to directory" msgstr "" -#: src/Module/Admin/Site.php:436 src/Module/Register.php:152 +#: src/Module/Admin/Site.php:437 src/Module/Register.php:152 msgid "Registration" msgstr "" -#: src/Module/Admin/Site.php:437 +#: src/Module/Admin/Site.php:438 msgid "File upload" msgstr "" -#: src/Module/Admin/Site.php:438 +#: src/Module/Admin/Site.php:439 msgid "Policies" msgstr "" -#: src/Module/Admin/Site.php:439 src/Module/Calendar/Event/Form.php:252 +#: src/Module/Admin/Site.php:440 src/Module/Calendar/Event/Form.php:252 #: src/Module/Contact.php:477 src/Module/Profile/Profile.php:248 msgid "Advanced" msgstr "" -#: src/Module/Admin/Site.php:440 +#: src/Module/Admin/Site.php:441 msgid "Auto Discovered Contact Directory" msgstr "" -#: src/Module/Admin/Site.php:441 +#: src/Module/Admin/Site.php:442 msgid "Performance" msgstr "" -#: src/Module/Admin/Site.php:442 +#: src/Module/Admin/Site.php:443 msgid "Worker" msgstr "" -#: src/Module/Admin/Site.php:443 +#: src/Module/Admin/Site.php:444 msgid "Message Relay" msgstr "" -#: src/Module/Admin/Site.php:444 +#: src/Module/Admin/Site.php:445 msgid "" "Use the command \"console relay\" in the command line to add or remove " "relays." msgstr "" -#: src/Module/Admin/Site.php:445 +#: src/Module/Admin/Site.php:446 msgid "The system is not subscribed to any relays at the moment." msgstr "" -#: src/Module/Admin/Site.php:446 +#: src/Module/Admin/Site.php:447 msgid "The system is currently subscribed to the following relays:" msgstr "" -#: src/Module/Admin/Site.php:448 +#: src/Module/Admin/Site.php:449 msgid "Relocate Node" msgstr "" -#: src/Module/Admin/Site.php:449 +#: src/Module/Admin/Site.php:450 msgid "" "Relocating your node enables you to change the DNS domain of this node and " "keep all the existing users and posts. This process takes a while and can " "only be started from the relocate console command like this:" msgstr "" -#: src/Module/Admin/Site.php:450 +#: src/Module/Admin/Site.php:451 msgid "(Friendica directory)# bin/console relocate https://newdomain.com" msgstr "" -#: src/Module/Admin/Site.php:454 +#: src/Module/Admin/Site.php:455 msgid "Site name" msgstr "" -#: src/Module/Admin/Site.php:455 +#: src/Module/Admin/Site.php:456 msgid "Sender Email" msgstr "" -#: src/Module/Admin/Site.php:455 +#: src/Module/Admin/Site.php:456 msgid "" "The email address your server shall use to send notification emails from." msgstr "" -#: src/Module/Admin/Site.php:456 +#: src/Module/Admin/Site.php:457 msgid "Name of the system actor" msgstr "" -#: src/Module/Admin/Site.php:456 +#: src/Module/Admin/Site.php:457 msgid "" "Name of the internal system account that is used to perform ActivityPub " "requests. This must be an unused username. If set, this can't be changed " "again." msgstr "" -#: src/Module/Admin/Site.php:457 +#: src/Module/Admin/Site.php:458 msgid "Banner/Logo" msgstr "" -#: src/Module/Admin/Site.php:458 +#: src/Module/Admin/Site.php:459 msgid "Email Banner/Logo" msgstr "" -#: src/Module/Admin/Site.php:459 +#: src/Module/Admin/Site.php:460 msgid "Shortcut icon" msgstr "" -#: src/Module/Admin/Site.php:459 +#: src/Module/Admin/Site.php:460 msgid "Link to an icon that will be used for browsers." msgstr "" -#: src/Module/Admin/Site.php:460 +#: src/Module/Admin/Site.php:461 msgid "Touch icon" msgstr "" -#: src/Module/Admin/Site.php:460 +#: src/Module/Admin/Site.php:461 msgid "Link to an icon that will be used for tablets and mobiles." msgstr "" -#: src/Module/Admin/Site.php:461 +#: src/Module/Admin/Site.php:462 msgid "Additional Info" msgstr "" -#: src/Module/Admin/Site.php:461 +#: src/Module/Admin/Site.php:462 #, php-format msgid "" "For public servers: you can add additional information here that will be " "listed at %s/servers." msgstr "" -#: src/Module/Admin/Site.php:462 +#: src/Module/Admin/Site.php:463 msgid "System language" msgstr "" -#: src/Module/Admin/Site.php:463 +#: src/Module/Admin/Site.php:464 msgid "System theme" msgstr "" -#: src/Module/Admin/Site.php:463 +#: src/Module/Admin/Site.php:464 #, php-format msgid "" "Default system theme - may be over-ridden by user profiles - Change default theme settings" msgstr "" -#: src/Module/Admin/Site.php:464 +#: src/Module/Admin/Site.php:465 msgid "Mobile system theme" msgstr "" -#: src/Module/Admin/Site.php:464 +#: src/Module/Admin/Site.php:465 msgid "Theme for mobile devices" msgstr "" -#: src/Module/Admin/Site.php:465 src/Module/Install.php:232 +#: src/Module/Admin/Site.php:466 src/Module/Install.php:232 msgid "SSL link policy" msgstr "" -#: src/Module/Admin/Site.php:465 src/Module/Install.php:234 +#: src/Module/Admin/Site.php:466 src/Module/Install.php:234 msgid "Determines whether generated links should be forced to use SSL" msgstr "" -#: src/Module/Admin/Site.php:466 +#: src/Module/Admin/Site.php:467 msgid "Force SSL" msgstr "" -#: src/Module/Admin/Site.php:466 +#: src/Module/Admin/Site.php:467 msgid "" "Force all Non-SSL requests to SSL - Attention: on some systems it could lead " "to endless loops." msgstr "" -#: src/Module/Admin/Site.php:467 +#: src/Module/Admin/Site.php:468 msgid "Show help entry from navigation menu" msgstr "" -#: src/Module/Admin/Site.php:467 +#: src/Module/Admin/Site.php:468 msgid "" "Displays the menu entry for the Help pages from the navigation menu. It is " "always accessible by calling /help directly." msgstr "" -#: src/Module/Admin/Site.php:468 +#: src/Module/Admin/Site.php:469 msgid "Single user instance" msgstr "" -#: src/Module/Admin/Site.php:468 +#: src/Module/Admin/Site.php:469 msgid "Make this instance multi-user or single-user for the named user" msgstr "" -#: src/Module/Admin/Site.php:470 +#: src/Module/Admin/Site.php:471 msgid "Maximum image size" msgstr "" -#: src/Module/Admin/Site.php:470 +#: src/Module/Admin/Site.php:471 msgid "" "Maximum size in bytes of uploaded images. Default is 0, which means no " -"limits. Be aware that this setting does not affect server-side upload limits." +"limits." msgstr "" -#: src/Module/Admin/Site.php:471 +#: src/Module/Admin/Site.php:472 +msgid "" +"The value of upload_max_filesize in your PHP.ini " +"needs be set to at least the desired limit. " +msgstr "" + +#: src/Module/Admin/Site.php:473 +msgid "Currently upload_max_filesize is set to " +msgstr "" + +#: src/Module/Admin/Site.php:475 msgid "Maximum image length" msgstr "" -#: src/Module/Admin/Site.php:471 +#: src/Module/Admin/Site.php:475 msgid "" "Maximum length in pixels of the longest side of uploaded images. Default is " "-1, which means no limits." msgstr "" -#: src/Module/Admin/Site.php:472 +#: src/Module/Admin/Site.php:476 msgid "JPEG image quality" msgstr "" -#: src/Module/Admin/Site.php:472 +#: src/Module/Admin/Site.php:476 msgid "" "Uploaded JPEGS will be saved at this quality setting [0-100]. Default is " "100, which is full quality." msgstr "" -#: src/Module/Admin/Site.php:474 +#: src/Module/Admin/Site.php:478 msgid "Register policy" msgstr "" -#: src/Module/Admin/Site.php:475 +#: src/Module/Admin/Site.php:479 msgid "Maximum Daily Registrations" msgstr "" -#: src/Module/Admin/Site.php:475 +#: src/Module/Admin/Site.php:479 msgid "" "If registration is permitted above, this sets the maximum number of new user " "registrations to accept per day. If register is set to closed, this setting " "has no effect." msgstr "" -#: src/Module/Admin/Site.php:476 +#: src/Module/Admin/Site.php:480 msgid "Register text" msgstr "" -#: src/Module/Admin/Site.php:476 +#: src/Module/Admin/Site.php:480 msgid "" "Will be displayed prominently on the registration page. You can use BBCode " "here." msgstr "" -#: src/Module/Admin/Site.php:477 +#: src/Module/Admin/Site.php:481 msgid "Forbidden Nicknames" msgstr "" -#: src/Module/Admin/Site.php:477 +#: src/Module/Admin/Site.php:481 msgid "" "Comma separated list of nicknames that are forbidden from registration. " "Preset is a list of role names according RFC 2142." msgstr "" -#: src/Module/Admin/Site.php:478 +#: src/Module/Admin/Site.php:482 msgid "Accounts abandoned after x days" msgstr "" -#: src/Module/Admin/Site.php:478 +#: src/Module/Admin/Site.php:482 msgid "" "Will not waste system resources polling external sites for abandonded " "accounts. Enter 0 for no time limit." msgstr "" -#: src/Module/Admin/Site.php:479 +#: src/Module/Admin/Site.php:483 msgid "Allowed friend domains" msgstr "" -#: src/Module/Admin/Site.php:479 +#: src/Module/Admin/Site.php:483 msgid "" "Comma separated list of domains which are allowed to establish friendships " "with this site. Wildcards are accepted. Empty to allow any domains" msgstr "" -#: src/Module/Admin/Site.php:480 +#: src/Module/Admin/Site.php:484 msgid "Allowed email domains" msgstr "" -#: src/Module/Admin/Site.php:480 +#: src/Module/Admin/Site.php:484 msgid "" "Comma separated list of domains which are allowed in email addresses for " "registrations to this site. Wildcards are accepted. Empty to allow any " "domains" msgstr "" -#: src/Module/Admin/Site.php:481 +#: src/Module/Admin/Site.php:485 msgid "No OEmbed rich content" msgstr "" -#: src/Module/Admin/Site.php:481 +#: src/Module/Admin/Site.php:485 msgid "" "Don't show the rich content (e.g. embedded PDF), except from the domains " "listed below." msgstr "" -#: src/Module/Admin/Site.php:482 +#: src/Module/Admin/Site.php:486 msgid "Trusted third-party domains" msgstr "" -#: src/Module/Admin/Site.php:482 +#: src/Module/Admin/Site.php:486 msgid "" "Comma separated list of domains from which content is allowed to be embedded " "in posts like with OEmbed. All sub-domains of the listed domains are allowed " "as well." msgstr "" -#: src/Module/Admin/Site.php:483 +#: src/Module/Admin/Site.php:487 msgid "Block public" msgstr "" -#: src/Module/Admin/Site.php:483 +#: src/Module/Admin/Site.php:487 msgid "" "Check to block public access to all otherwise public personal pages on this " "site unless you are currently logged in." msgstr "" -#: src/Module/Admin/Site.php:484 +#: src/Module/Admin/Site.php:488 msgid "Force publish" msgstr "" -#: src/Module/Admin/Site.php:484 +#: src/Module/Admin/Site.php:488 msgid "" "Check to force all profiles on this site to be listed in the site directory." msgstr "" -#: src/Module/Admin/Site.php:484 +#: src/Module/Admin/Site.php:488 msgid "Enabling this may violate privacy laws like the GDPR" msgstr "" -#: src/Module/Admin/Site.php:485 +#: src/Module/Admin/Site.php:489 msgid "Global directory URL" msgstr "" -#: src/Module/Admin/Site.php:485 +#: src/Module/Admin/Site.php:489 msgid "" "URL to the global directory. If this is not set, the global directory is " "completely unavailable to the application." msgstr "" -#: src/Module/Admin/Site.php:486 +#: src/Module/Admin/Site.php:490 msgid "Private posts by default for new users" msgstr "" -#: src/Module/Admin/Site.php:486 +#: src/Module/Admin/Site.php:490 msgid "" "Set default post permissions for all new members to the default privacy " "group rather than public." msgstr "" -#: src/Module/Admin/Site.php:487 +#: src/Module/Admin/Site.php:491 msgid "Don't include post content in email notifications" msgstr "" -#: src/Module/Admin/Site.php:487 +#: src/Module/Admin/Site.php:491 msgid "" "Don't include the content of a post/comment/private message/etc. in the " "email notifications that are sent out from this site, as a privacy measure." msgstr "" -#: src/Module/Admin/Site.php:488 +#: src/Module/Admin/Site.php:492 msgid "Disallow public access to addons listed in the apps menu." msgstr "" -#: src/Module/Admin/Site.php:488 +#: src/Module/Admin/Site.php:492 msgid "" "Checking this box will restrict addons listed in the apps menu to members " "only." msgstr "" -#: src/Module/Admin/Site.php:489 +#: src/Module/Admin/Site.php:493 msgid "Don't embed private images in posts" msgstr "" -#: src/Module/Admin/Site.php:489 +#: src/Module/Admin/Site.php:493 msgid "" "Don't replace locally-hosted private photos in posts with an embedded copy " "of the image. This means that contacts who receive posts containing private " "photos will have to authenticate and load each image, which may take a while." msgstr "" -#: src/Module/Admin/Site.php:490 +#: src/Module/Admin/Site.php:494 msgid "Explicit Content" msgstr "" -#: src/Module/Admin/Site.php:490 +#: src/Module/Admin/Site.php:494 msgid "" "Set this to announce that your node is used mostly for explicit content that " "might not be suited for minors. This information will be published in the " @@ -4486,267 +4496,267 @@ msgid "" "will be shown at the user registration page." msgstr "" -#: src/Module/Admin/Site.php:491 +#: src/Module/Admin/Site.php:495 msgid "Proxify external content" msgstr "" -#: src/Module/Admin/Site.php:491 +#: src/Module/Admin/Site.php:495 msgid "" "Route external content via the proxy functionality. This is used for example " "for some OEmbed accesses and in some other rare cases." msgstr "" -#: src/Module/Admin/Site.php:492 +#: src/Module/Admin/Site.php:496 msgid "Cache contact avatars" msgstr "" -#: src/Module/Admin/Site.php:492 +#: src/Module/Admin/Site.php:496 msgid "" "Locally store the avatar pictures of the contacts. This uses a lot of " "storage space but it increases the performance." msgstr "" -#: src/Module/Admin/Site.php:493 +#: src/Module/Admin/Site.php:497 msgid "Allow Users to set remote_self" msgstr "" -#: src/Module/Admin/Site.php:493 +#: src/Module/Admin/Site.php:497 msgid "" "With checking this, every user is allowed to mark every contact as a " "remote_self in the repair contact dialog. Setting this flag on a contact " "causes mirroring every posting of that contact in the users stream." msgstr "" -#: src/Module/Admin/Site.php:494 +#: src/Module/Admin/Site.php:498 msgid "Enable multiple registrations" msgstr "" -#: src/Module/Admin/Site.php:494 +#: src/Module/Admin/Site.php:498 msgid "Enable users to register additional accounts for use as pages." msgstr "" -#: src/Module/Admin/Site.php:495 +#: src/Module/Admin/Site.php:499 msgid "Enable OpenID" msgstr "" -#: src/Module/Admin/Site.php:495 +#: src/Module/Admin/Site.php:499 msgid "Enable OpenID support for registration and logins." msgstr "" -#: src/Module/Admin/Site.php:496 +#: src/Module/Admin/Site.php:500 msgid "Enable Fullname check" msgstr "" -#: src/Module/Admin/Site.php:496 +#: src/Module/Admin/Site.php:500 msgid "" "Enable check to only allow users to register with a space between the first " "name and the last name in their full name." msgstr "" -#: src/Module/Admin/Site.php:497 +#: src/Module/Admin/Site.php:501 msgid "Email administrators on new registration" msgstr "" -#: src/Module/Admin/Site.php:497 +#: src/Module/Admin/Site.php:501 msgid "" "If enabled and the system is set to an open registration, an email for each " "new registration is sent to the administrators." msgstr "" -#: src/Module/Admin/Site.php:498 +#: src/Module/Admin/Site.php:502 msgid "Community pages for visitors" msgstr "" -#: src/Module/Admin/Site.php:498 +#: src/Module/Admin/Site.php:502 msgid "" "Which community pages should be available for visitors. Local users always " "see both pages." msgstr "" -#: src/Module/Admin/Site.php:499 +#: src/Module/Admin/Site.php:503 msgid "Posts per user on community page" msgstr "" -#: src/Module/Admin/Site.php:499 +#: src/Module/Admin/Site.php:503 msgid "" "The maximum number of posts per user on the community page. (Not valid for " "\"Global Community\")" msgstr "" -#: src/Module/Admin/Site.php:501 +#: src/Module/Admin/Site.php:505 msgid "Enable Mail support" msgstr "" -#: src/Module/Admin/Site.php:501 +#: src/Module/Admin/Site.php:505 msgid "" "Enable built-in mail support to poll IMAP folders and to reply via mail." msgstr "" -#: src/Module/Admin/Site.php:502 +#: src/Module/Admin/Site.php:506 msgid "" "Mail support can't be enabled because the PHP IMAP module is not installed." msgstr "" -#: src/Module/Admin/Site.php:503 +#: src/Module/Admin/Site.php:507 msgid "Enable OStatus support" msgstr "" -#: src/Module/Admin/Site.php:503 +#: src/Module/Admin/Site.php:507 msgid "" "Enable built-in OStatus (StatusNet, GNU Social etc.) compatibility. All " "communications in OStatus are public." msgstr "" -#: src/Module/Admin/Site.php:505 +#: src/Module/Admin/Site.php:509 msgid "" "Diaspora support can't be enabled because Friendica was installed into a sub " "directory." msgstr "" -#: src/Module/Admin/Site.php:506 +#: src/Module/Admin/Site.php:510 msgid "Enable Diaspora support" msgstr "" -#: src/Module/Admin/Site.php:506 +#: src/Module/Admin/Site.php:510 msgid "" "Enable built-in Diaspora network compatibility for communicating with " "diaspora servers." msgstr "" -#: src/Module/Admin/Site.php:507 +#: src/Module/Admin/Site.php:511 msgid "Verify SSL" msgstr "" -#: src/Module/Admin/Site.php:507 +#: src/Module/Admin/Site.php:511 msgid "" "If you wish, you can turn on strict certificate checking. This will mean you " "cannot connect (at all) to self-signed SSL sites." msgstr "" -#: src/Module/Admin/Site.php:508 +#: src/Module/Admin/Site.php:512 msgid "Proxy user" msgstr "" -#: src/Module/Admin/Site.php:508 +#: src/Module/Admin/Site.php:512 msgid "User name for the proxy server." msgstr "" -#: src/Module/Admin/Site.php:509 +#: src/Module/Admin/Site.php:513 msgid "Proxy URL" msgstr "" -#: src/Module/Admin/Site.php:509 +#: src/Module/Admin/Site.php:513 msgid "" "If you want to use a proxy server that Friendica should use to connect to " "the network, put the URL of the proxy here." msgstr "" -#: src/Module/Admin/Site.php:510 +#: src/Module/Admin/Site.php:514 msgid "Network timeout" msgstr "" -#: src/Module/Admin/Site.php:510 +#: src/Module/Admin/Site.php:514 msgid "Value is in seconds. Set to 0 for unlimited (not recommended)." msgstr "" -#: src/Module/Admin/Site.php:511 +#: src/Module/Admin/Site.php:515 msgid "Maximum Load Average" msgstr "" -#: src/Module/Admin/Site.php:511 +#: src/Module/Admin/Site.php:515 #, php-format msgid "" "Maximum system load before delivery and poll processes are deferred - " "default %d." msgstr "" -#: src/Module/Admin/Site.php:512 +#: src/Module/Admin/Site.php:516 msgid "Minimal Memory" msgstr "" -#: src/Module/Admin/Site.php:512 +#: src/Module/Admin/Site.php:516 msgid "" "Minimal free memory in MB for the worker. Needs access to /proc/meminfo - " "default 0 (deactivated)." msgstr "" -#: src/Module/Admin/Site.php:513 +#: src/Module/Admin/Site.php:517 msgid "Periodically optimize tables" msgstr "" -#: src/Module/Admin/Site.php:513 +#: src/Module/Admin/Site.php:517 msgid "Periodically optimize tables like the cache and the workerqueue" msgstr "" -#: src/Module/Admin/Site.php:515 +#: src/Module/Admin/Site.php:519 msgid "Discover followers/followings from contacts" msgstr "" -#: src/Module/Admin/Site.php:515 +#: src/Module/Admin/Site.php:519 msgid "" "If enabled, contacts are checked for their followers and following contacts." msgstr "" -#: src/Module/Admin/Site.php:516 +#: src/Module/Admin/Site.php:520 msgid "None - deactivated" msgstr "" -#: src/Module/Admin/Site.php:517 +#: src/Module/Admin/Site.php:521 msgid "" "Local contacts - contacts of our local contacts are discovered for their " "followers/followings." msgstr "" -#: src/Module/Admin/Site.php:518 +#: src/Module/Admin/Site.php:522 msgid "" "Interactors - contacts of our local contacts and contacts who interacted on " "locally visible postings are discovered for their followers/followings." msgstr "" -#: src/Module/Admin/Site.php:520 +#: src/Module/Admin/Site.php:524 msgid "Synchronize the contacts with the directory server" msgstr "" -#: src/Module/Admin/Site.php:520 +#: src/Module/Admin/Site.php:524 msgid "" "if enabled, the system will check periodically for new contacts on the " "defined directory server." msgstr "" -#: src/Module/Admin/Site.php:522 +#: src/Module/Admin/Site.php:526 msgid "Days between requery" msgstr "" -#: src/Module/Admin/Site.php:522 +#: src/Module/Admin/Site.php:526 msgid "Number of days after which a server is requeried for his contacts." msgstr "" -#: src/Module/Admin/Site.php:523 +#: src/Module/Admin/Site.php:527 msgid "Discover contacts from other servers" msgstr "" -#: src/Module/Admin/Site.php:523 +#: src/Module/Admin/Site.php:527 msgid "" "Periodically query other servers for contacts. The system queries Friendica, " "Mastodon and Hubzilla servers." msgstr "" -#: src/Module/Admin/Site.php:524 +#: src/Module/Admin/Site.php:528 msgid "Search the local directory" msgstr "" -#: src/Module/Admin/Site.php:524 +#: src/Module/Admin/Site.php:528 msgid "" "Search the local directory instead of the global directory. When searching " "locally, every search will be executed on the global directory in the " "background. This improves the search results when the search is repeated." msgstr "" -#: src/Module/Admin/Site.php:526 +#: src/Module/Admin/Site.php:530 msgid "Publish server information" msgstr "" -#: src/Module/Admin/Site.php:526 +#: src/Module/Admin/Site.php:530 msgid "" "If enabled, general server and usage data will be published. The data " "contains the name and version of the server, number of users with public " @@ -4754,50 +4764,50 @@ msgid "" "href=\"http://the-federation.info/\">the-federation.info for details." msgstr "" -#: src/Module/Admin/Site.php:528 +#: src/Module/Admin/Site.php:532 msgid "Check upstream version" msgstr "" -#: src/Module/Admin/Site.php:528 +#: src/Module/Admin/Site.php:532 msgid "" "Enables checking for new Friendica versions at github. If there is a new " "version, you will be informed in the admin panel overview." msgstr "" -#: src/Module/Admin/Site.php:529 +#: src/Module/Admin/Site.php:533 msgid "Suppress Tags" msgstr "" -#: src/Module/Admin/Site.php:529 +#: src/Module/Admin/Site.php:533 msgid "Suppress showing a list of hashtags at the end of the posting." msgstr "" -#: src/Module/Admin/Site.php:530 +#: src/Module/Admin/Site.php:534 msgid "Clean database" msgstr "" -#: src/Module/Admin/Site.php:530 +#: src/Module/Admin/Site.php:534 msgid "" "Remove old remote items, orphaned database records and old content from some " "other helper tables." msgstr "" -#: src/Module/Admin/Site.php:531 +#: src/Module/Admin/Site.php:535 msgid "Lifespan of remote items" msgstr "" -#: src/Module/Admin/Site.php:531 +#: src/Module/Admin/Site.php:535 msgid "" "When the database cleanup is enabled, this defines the days after which " "remote items will be deleted. Own items, and marked or filed items are " "always kept. 0 disables this behaviour." msgstr "" -#: src/Module/Admin/Site.php:532 +#: src/Module/Admin/Site.php:536 msgid "Lifespan of unclaimed items" msgstr "" -#: src/Module/Admin/Site.php:532 +#: src/Module/Admin/Site.php:536 msgid "" "When the database cleanup is enabled, this defines the days after which " "unclaimed remote items (mostly content from the relay) will be deleted. " @@ -4805,144 +4815,144 @@ msgid "" "items if set to 0." msgstr "" -#: src/Module/Admin/Site.php:533 +#: src/Module/Admin/Site.php:537 msgid "Lifespan of raw conversation data" msgstr "" -#: src/Module/Admin/Site.php:533 +#: src/Module/Admin/Site.php:537 msgid "" "The conversation data is used for ActivityPub and OStatus, as well as for " "debug purposes. It should be safe to remove it after 14 days, default is 90 " "days." msgstr "" -#: src/Module/Admin/Site.php:534 +#: src/Module/Admin/Site.php:538 msgid "Maximum numbers of comments per post" msgstr "" -#: src/Module/Admin/Site.php:534 +#: src/Module/Admin/Site.php:538 msgid "How much comments should be shown for each post? Default value is 100." msgstr "" -#: src/Module/Admin/Site.php:535 +#: src/Module/Admin/Site.php:539 msgid "Maximum numbers of comments per post on the display page" msgstr "" -#: src/Module/Admin/Site.php:535 +#: src/Module/Admin/Site.php:539 msgid "" "How many comments should be shown on the single view for each post? Default " "value is 1000." msgstr "" -#: src/Module/Admin/Site.php:536 +#: src/Module/Admin/Site.php:540 msgid "Temp path" msgstr "" -#: src/Module/Admin/Site.php:536 +#: src/Module/Admin/Site.php:540 msgid "" "If you have a restricted system where the webserver can't access the system " "temp path, enter another path here." msgstr "" -#: src/Module/Admin/Site.php:537 +#: src/Module/Admin/Site.php:541 msgid "Only search in tags" msgstr "" -#: src/Module/Admin/Site.php:537 +#: src/Module/Admin/Site.php:541 msgid "On large systems the text search can slow down the system extremely." msgstr "" -#: src/Module/Admin/Site.php:538 +#: src/Module/Admin/Site.php:542 msgid "Generate counts per contact group when calculating network count" msgstr "" -#: src/Module/Admin/Site.php:538 +#: src/Module/Admin/Site.php:542 msgid "" "On systems with users that heavily use contact groups the query can be very " "expensive." msgstr "" -#: src/Module/Admin/Site.php:540 +#: src/Module/Admin/Site.php:544 msgid "Maximum number of parallel workers" msgstr "" -#: src/Module/Admin/Site.php:540 +#: src/Module/Admin/Site.php:544 #, php-format msgid "" "On shared hosters set this to %d. On larger systems, values of %d are great. " "Default value is %d." msgstr "" -#: src/Module/Admin/Site.php:541 +#: src/Module/Admin/Site.php:545 msgid "Enable fastlane" msgstr "" -#: src/Module/Admin/Site.php:541 +#: src/Module/Admin/Site.php:545 msgid "" "When enabed, the fastlane mechanism starts an additional worker if processes " "with higher priority are blocked by processes of lower priority." msgstr "" -#: src/Module/Admin/Site.php:543 +#: src/Module/Admin/Site.php:547 msgid "Direct relay transfer" msgstr "" -#: src/Module/Admin/Site.php:543 +#: src/Module/Admin/Site.php:547 msgid "" "Enables the direct transfer to other servers without using the relay servers" msgstr "" -#: src/Module/Admin/Site.php:544 +#: src/Module/Admin/Site.php:548 msgid "Relay scope" msgstr "" -#: src/Module/Admin/Site.php:544 +#: src/Module/Admin/Site.php:548 msgid "" "Can be \"all\" or \"tags\". \"all\" means that every public post should be " "received. \"tags\" means that only posts with selected tags should be " "received." msgstr "" -#: src/Module/Admin/Site.php:544 src/Module/Contact/Profile.php:274 +#: src/Module/Admin/Site.php:548 src/Module/Contact/Profile.php:274 #: src/Module/Settings/TwoFactor/Index.php:125 msgid "Disabled" msgstr "" -#: src/Module/Admin/Site.php:544 +#: src/Module/Admin/Site.php:548 msgid "all" msgstr "" -#: src/Module/Admin/Site.php:544 +#: src/Module/Admin/Site.php:548 msgid "tags" msgstr "" -#: src/Module/Admin/Site.php:545 +#: src/Module/Admin/Site.php:549 msgid "Server tags" msgstr "" -#: src/Module/Admin/Site.php:545 +#: src/Module/Admin/Site.php:549 msgid "Comma separated list of tags for the \"tags\" subscription." msgstr "" -#: src/Module/Admin/Site.php:546 +#: src/Module/Admin/Site.php:550 msgid "Deny Server tags" msgstr "" -#: src/Module/Admin/Site.php:546 +#: src/Module/Admin/Site.php:550 msgid "Comma separated list of tags that are rejected." msgstr "" -#: src/Module/Admin/Site.php:547 +#: src/Module/Admin/Site.php:551 msgid "Allow user tags" msgstr "" -#: src/Module/Admin/Site.php:547 +#: src/Module/Admin/Site.php:551 msgid "" "If enabled, the tags from the saved searches will used for the \"tags\" " "subscription in addition to the \"relay_server_tags\"." msgstr "" -#: src/Module/Admin/Site.php:550 +#: src/Module/Admin/Site.php:554 msgid "Start Relocation" msgstr "" From 6ebf0f860b58b3b41fba438fae98ac840e16b578 Mon Sep 17 00:00:00 2001 From: Marek Bachmann Date: Sun, 27 Nov 2022 23:53:34 +0100 Subject: [PATCH 17/43] messages.po --- view/lang/C/messages.po | 156 ++++++++++++++++++++-------------------- 1 file changed, 78 insertions(+), 78 deletions(-) diff --git a/view/lang/C/messages.po b/view/lang/C/messages.po index fc9256dd25..362af94b93 100644 --- a/view/lang/C/messages.po +++ b/view/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 2022.12-dev\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-27 00:36+0000\n" +"POT-Creation-Date: 2022-11-27 23:52+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -292,7 +292,7 @@ msgstr "" msgid "Insert web link" msgstr "" -#: mod/message.php:203 mod/message.php:360 mod/photos.php:1494 +#: mod/message.php:203 mod/message.php:360 mod/photos.php:1492 #: src/Content/Conversation.php:371 src/Content/Conversation.php:717 #: src/Module/Item/Compose.php:204 src/Module/Post/Edit.php:142 #: src/Module/Profile/UnkMail.php:155 src/Object/Post.php:537 @@ -300,8 +300,8 @@ msgid "Please wait" msgstr "" #: mod/message.php:204 mod/message.php:359 mod/photos.php:914 -#: mod/photos.php:1028 mod/photos.php:1300 mod/photos.php:1341 -#: mod/photos.php:1397 mod/photos.php:1471 +#: mod/photos.php:1026 mod/photos.php:1298 mod/photos.php:1339 +#: mod/photos.php:1395 mod/photos.php:1469 #: src/Module/Calendar/Event/Form.php:250 src/Module/Contact/Advanced.php:132 #: src/Module/Contact/Profile.php:327 #: src/Module/Debug/ActivityPubConversion.php:140 @@ -405,7 +405,7 @@ msgstr "" msgid "Recent Photos" msgstr "" -#: mod/photos.php:110 mod/photos.php:1066 src/Module/Profile/Photos.php:172 +#: mod/photos.php:110 mod/photos.php:1074 src/Module/Profile/Photos.php:172 #: src/Module/Profile/Photos.php:189 msgid "Upload New Photos" msgstr "" @@ -494,173 +494,173 @@ msgstr "" msgid "Access to this item is restricted." msgstr "" -#: mod/photos.php:927 +#: mod/photos.php:925 msgid "The maximum accepted image size is %.3g MB" msgstr "" -#: mod/photos.php:934 +#: mod/photos.php:932 msgid "Upload Photos" msgstr "" -#: mod/photos.php:938 mod/photos.php:1024 +#: mod/photos.php:936 mod/photos.php:1022 msgid "New album name: " msgstr "" -#: mod/photos.php:939 +#: mod/photos.php:937 msgid "or select existing album:" msgstr "" -#: mod/photos.php:940 +#: mod/photos.php:938 msgid "Do not show a status post for this upload" msgstr "" -#: mod/photos.php:942 mod/photos.php:1296 src/Content/Conversation.php:373 +#: mod/photos.php:940 mod/photos.php:1294 src/Content/Conversation.php:373 #: src/Module/Calendar/Event/Form.php:253 src/Module/Post/Edit.php:179 msgid "Permissions" msgstr "" -#: mod/photos.php:1005 +#: mod/photos.php:1003 msgid "Do you really want to delete this photo album and all its photos?" msgstr "" -#: mod/photos.php:1006 mod/photos.php:1029 +#: mod/photos.php:1004 mod/photos.php:1027 msgid "Delete Album" msgstr "" -#: mod/photos.php:997 mod/photos.php:1098 src/Content/Conversation.php:389 +#: mod/photos.php:1005 mod/photos.php:1106 src/Content/Conversation.php:389 #: src/Module/Contact/Follow.php:173 src/Module/Contact/Revoke.php:109 #: src/Module/Contact/Unfollow.php:126 -#: src/Module/Media/Attachment/Browser.php:78 +#: src/Module/Media/Attachment/Browser.php:77 #: src/Module/Media/Photo/Browser.php:88 src/Module/Post/Edit.php:164 #: src/Module/Post/Tag/Remove.php:109 src/Module/Profile/RemoteFollow.php:134 #: src/Module/Security/TwoFactor/SignOut.php:125 msgid "Cancel" msgstr "" -#: mod/photos.php:1023 +#: mod/photos.php:1031 msgid "Edit Album" msgstr "" -#: mod/photos.php:1034 +#: mod/photos.php:1032 msgid "Drop Album" msgstr "" -#: mod/photos.php:1038 +#: mod/photos.php:1036 msgid "Show Newest First" msgstr "" -#: mod/photos.php:1040 +#: mod/photos.php:1038 msgid "Show Oldest First" msgstr "" -#: mod/photos.php:1051 src/Module/Profile/Photos.php:140 +#: mod/photos.php:1059 src/Module/Profile/Photos.php:140 msgid "View Photo" msgstr "" -#: mod/photos.php:1094 +#: mod/photos.php:1092 msgid "Permission denied. Access to this item may be restricted." msgstr "" -#: mod/photos.php:1096 +#: mod/photos.php:1094 msgid "Photo not available" msgstr "" -#: mod/photos.php:1106 +#: mod/photos.php:1104 msgid "Do you really want to delete this photo?" msgstr "" -#: mod/photos.php:1107 mod/photos.php:1301 +#: mod/photos.php:1105 mod/photos.php:1299 msgid "Delete Photo" msgstr "" -#: mod/photos.php:1199 +#: mod/photos.php:1197 msgid "View photo" msgstr "" -#: mod/photos.php:1201 +#: mod/photos.php:1199 msgid "Edit photo" msgstr "" -#: mod/photos.php:1202 +#: mod/photos.php:1200 msgid "Delete photo" msgstr "" -#: mod/photos.php:1203 +#: mod/photos.php:1201 msgid "Use as profile photo" msgstr "" -#: mod/photos.php:1210 +#: mod/photos.php:1208 msgid "Private Photo" msgstr "" -#: mod/photos.php:1216 +#: mod/photos.php:1214 msgid "View Full Size" msgstr "" -#: mod/photos.php:1269 +#: mod/photos.php:1267 msgid "Tags: " msgstr "" -#: mod/photos.php:1272 +#: mod/photos.php:1270 msgid "[Select tags to remove]" msgstr "" -#: mod/photos.php:1287 +#: mod/photos.php:1285 msgid "New album name" msgstr "" -#: mod/photos.php:1288 +#: mod/photos.php:1286 msgid "Caption" msgstr "" -#: mod/photos.php:1289 +#: mod/photos.php:1287 msgid "Add a Tag" msgstr "" -#: mod/photos.php:1289 +#: mod/photos.php:1287 msgid "Example: @bob, @Barbara_Jensen, @jim@example.com, #California, #camping" msgstr "" -#: mod/photos.php:1290 +#: mod/photos.php:1288 msgid "Do not rotate" msgstr "" -#: mod/photos.php:1291 +#: mod/photos.php:1289 msgid "Rotate CW (right)" msgstr "" -#: mod/photos.php:1292 +#: mod/photos.php:1290 msgid "Rotate CCW (left)" msgstr "" -#: mod/photos.php:1338 mod/photos.php:1394 mod/photos.php:1468 +#: mod/photos.php:1336 mod/photos.php:1392 mod/photos.php:1466 #: src/Module/Contact.php:547 src/Module/Item/Compose.php:188 #: src/Object/Post.php:983 msgid "This is you" msgstr "" -#: mod/photos.php:1340 mod/photos.php:1396 mod/photos.php:1470 +#: mod/photos.php:1338 mod/photos.php:1394 mod/photos.php:1468 #: src/Object/Post.php:531 src/Object/Post.php:985 msgid "Comment" msgstr "" -#: mod/photos.php:1342 mod/photos.php:1398 mod/photos.php:1472 +#: mod/photos.php:1340 mod/photos.php:1396 mod/photos.php:1470 #: src/Content/Conversation.php:386 src/Module/Calendar/Event/Form.php:248 #: src/Module/Item/Compose.php:199 src/Module/Post/Edit.php:162 #: src/Object/Post.php:997 msgid "Preview" msgstr "" -#: mod/photos.php:1343 src/Content/Conversation.php:341 +#: mod/photos.php:1341 src/Content/Conversation.php:341 #: src/Module/Post/Edit.php:127 src/Object/Post.php:987 msgid "Loading..." msgstr "" -#: mod/photos.php:1429 src/Content/Conversation.php:633 src/Object/Post.php:255 +#: mod/photos.php:1427 src/Content/Conversation.php:633 src/Object/Post.php:255 msgid "Select" msgstr "" -#: mod/photos.php:1430 src/Content/Conversation.php:634 +#: mod/photos.php:1428 src/Content/Conversation.php:634 #: src/Module/Moderation/Users/Active.php:136 #: src/Module/Moderation/Users/Blocked.php:136 #: src/Module/Moderation/Users/Index.php:151 @@ -668,23 +668,23 @@ msgstr "" msgid "Delete" msgstr "" -#: mod/photos.php:1491 src/Object/Post.php:378 +#: mod/photos.php:1489 src/Object/Post.php:378 msgid "Like" msgstr "" -#: mod/photos.php:1492 src/Object/Post.php:378 +#: mod/photos.php:1490 src/Object/Post.php:378 msgid "I like this (toggle)" msgstr "" -#: mod/photos.php:1493 src/Object/Post.php:379 +#: mod/photos.php:1491 src/Object/Post.php:379 msgid "Dislike" msgstr "" -#: mod/photos.php:1495 src/Object/Post.php:379 +#: mod/photos.php:1493 src/Object/Post.php:379 msgid "I don't like this (toggle)" msgstr "" -#: mod/photos.php:1517 +#: mod/photos.php:1515 msgid "Map" msgstr "" @@ -710,16 +710,16 @@ msgstr "" msgid "toggle mobile" msgstr "" -#: src/App/Router.php:288 +#: src/App/Router.php:310 #, php-format msgid "Method not allowed for this module. Allowed method(s): %s" msgstr "" -#: src/App/Router.php:290 src/Module/HTTPException/PageNotFound.php:49 +#: src/App/Router.php:312 src/Module/HTTPException/PageNotFound.php:49 msgid "Page not found." msgstr "" -#: src/App/Router.php:318 +#: src/App/Router.php:338 msgid "You must be logged in to use addons. " msgstr "" @@ -1541,7 +1541,7 @@ msgstr "" msgid "show more" msgstr "" -#: src/Content/Item.php:294 src/Model/Item.php:2911 +#: src/Content/Item.php:294 src/Model/Item.php:2914 msgid "event" msgstr "" @@ -1550,7 +1550,7 @@ msgstr "" msgid "status" msgstr "" -#: src/Content/Item.php:303 src/Model/Item.php:2913 +#: src/Content/Item.php:303 src/Model/Item.php:2916 #: src/Module/Post/Tag/Add.php:123 msgid "photo" msgstr "" @@ -1945,8 +1945,8 @@ msgid "" "%2$s %3$s" msgstr "" -#: src/Content/Text/BBCode.php:1245 src/Model/Item.php:3533 -#: src/Model/Item.php:3539 src/Model/Item.php:3540 +#: src/Content/Text/BBCode.php:1245 src/Model/Item.php:3536 +#: src/Model/Item.php:3542 src/Model/Item.php:3543 msgid "Link to source" msgstr "" @@ -3105,66 +3105,66 @@ msgstr "" msgid "Edit groups" msgstr "" -#: src/Model/Item.php:2023 +#: src/Model/Item.php:2026 #, php-format msgid "Detected languages in this post:\\n%s" msgstr "" -#: src/Model/Item.php:2915 +#: src/Model/Item.php:2918 msgid "activity" msgstr "" -#: src/Model/Item.php:2917 +#: src/Model/Item.php:2920 msgid "comment" msgstr "" -#: src/Model/Item.php:2920 +#: src/Model/Item.php:2923 msgid "post" msgstr "" -#: src/Model/Item.php:3061 +#: src/Model/Item.php:3064 #, php-format msgid "Content warning: %s" msgstr "" -#: src/Model/Item.php:3445 +#: src/Model/Item.php:3448 msgid "bytes" msgstr "" -#: src/Model/Item.php:3476 +#: src/Model/Item.php:3479 #, php-format msgid "%2$s (%3$d%%, %1$d vote)" msgid_plural "%2$s (%3$d%%, %1$d votes)" msgstr[0] "" msgstr[1] "" -#: src/Model/Item.php:3478 +#: src/Model/Item.php:3481 #, php-format msgid "%2$s (%1$d vote)" msgid_plural "%2$s (%1$d votes)" msgstr[0] "" msgstr[1] "" -#: src/Model/Item.php:3483 +#: src/Model/Item.php:3486 #, php-format msgid "%d voter. Poll end: %s" msgid_plural "%d voters. Poll end: %s" msgstr[0] "" msgstr[1] "" -#: src/Model/Item.php:3485 +#: src/Model/Item.php:3488 #, php-format msgid "%d voter." msgid_plural "%d voters." msgstr[0] "" msgstr[1] "" -#: src/Model/Item.php:3487 +#: src/Model/Item.php:3490 #, php-format msgid "Poll end: %s" msgstr "" -#: src/Model/Item.php:3521 src/Model/Item.php:3522 +#: src/Model/Item.php:3524 src/Model/Item.php:3525 msgid "View on separate page" msgstr "" @@ -3172,7 +3172,7 @@ msgstr "" msgid "[no subject]" msgstr "" -#: src/Model/Photo.php:1139 src/Module/Media/Photo/Upload.php:198 +#: src/Model/Photo.php:1144 src/Module/Media/Photo/Upload.php:198 msgid "Wall Photos" msgstr "" @@ -5896,8 +5896,8 @@ msgid "The contact could not be added." msgstr "" #: src/Module/Contact/MatchInterests.php:94 -#: src/Module/Media/Attachment/Upload.php:80 -#: src/Module/Media/Attachment/Upload.php:85 +#: src/Module/Media/Attachment/Upload.php:79 +#: src/Module/Media/Attachment/Upload.php:84 #: src/Module/Media/Photo/Upload.php:83 src/Module/Media/Photo/Upload.php:88 #: src/Module/Media/Photo/Upload.php:137 msgid "Invalid request." @@ -7136,30 +7136,30 @@ msgstr "" msgid "You need to be logged in to access this page." msgstr "" -#: src/Module/Media/Attachment/Browser.php:75 +#: src/Module/Media/Attachment/Browser.php:74 msgid "Files" msgstr "" -#: src/Module/Media/Attachment/Browser.php:80 +#: src/Module/Media/Attachment/Browser.php:79 #: src/Module/Media/Photo/Browser.php:90 #: src/Module/Settings/Profile/Photo/Index.php:128 msgid "Upload" msgstr "" -#: src/Module/Media/Attachment/Upload.php:100 +#: src/Module/Media/Attachment/Upload.php:99 msgid "Sorry, maybe your upload is bigger than the PHP configuration allows" msgstr "" -#: src/Module/Media/Attachment/Upload.php:100 +#: src/Module/Media/Attachment/Upload.php:99 msgid "Or - did you try to upload an empty file?" msgstr "" -#: src/Module/Media/Attachment/Upload.php:107 +#: src/Module/Media/Attachment/Upload.php:106 #, php-format msgid "File exceeds size limit of %s" msgstr "" -#: src/Module/Media/Attachment/Upload.php:117 +#: src/Module/Media/Attachment/Upload.php:116 msgid "File upload failed." msgstr "" From 6877f8a473616fffbf7e3183a8d782dde169cf1f Mon Sep 17 00:00:00 2001 From: MarekBenjamin <117765478+MarekBenjamin@users.noreply.github.com> Date: Mon, 28 Nov 2022 01:06:40 +0100 Subject: [PATCH 18/43] Update src/Module/Admin/Site.php Co-authored-by: Hypolite Petovan --- src/Module/Admin/Site.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Module/Admin/Site.php b/src/Module/Admin/Site.php index 0c627894b8..35f5887ea0 100644 --- a/src/Module/Admin/Site.php +++ b/src/Module/Admin/Site.php @@ -468,9 +468,9 @@ class Site extends BaseAdmin '$show_help' => ['show_help', DI::l10n()->t('Show help entry from navigation menu'), !DI::config()->get('system', 'hide_help'), DI::l10n()->t('Displays the menu entry for the Help pages from the navigation menu. It is always accessible by calling /help directly.')], '$singleuser' => ['singleuser', DI::l10n()->t('Single user instance'), DI::config()->get('system', 'singleuser', '---'), DI::l10n()->t('Make this instance multi-user or single-user for the named user'), $user_names], - '$maximagesize' => ['maximagesize', DI::l10n()->t('Maximum image size'), DI::config()->get('system', 'maximagesize'), DI::l10n()->t('Maximum size in bytes of uploaded images. Default is 0, which means no limits.') . - DI::l10n()->t('The value of upload_max_filesize in your PHP.ini needs be set to at least the desired limit. ') . - DI::l10n()->t('Currently upload_max_filesize is set to ' . Strings::getBytesFromShorthand(ini_get('upload_max_filesize')) . ' (' . ini_get('upload_max_filesize') . 'B). '), + '$maximagesize' => ['maximagesize', DI::l10n()->t('Maximum image size'), DI::config()->get('system', 'maximagesize'), DI::l10n()->t('Maximum size in bytes of uploaded images. Default is 0, which means no limits. + The value of upload_max_filesize in your PHP.ini needs be set to at least the desired limit. + Currently upload_max_filesize is set to %s (%sB)', Strings::getBytesFromShorthand(ini_get('upload_max_filesize'), ini_get('upload_max_filesize')), '1 kB = 1 KiB = 1024 Bytes'], '$maximagelength' => ['maximagelength', DI::l10n()->t('Maximum image length'), DI::config()->get('system', 'max_image_length'), DI::l10n()->t('Maximum length in pixels of the longest side of uploaded images. Default is -1, which means no limits.')], '$jpegimagequality' => ['jpegimagequality', DI::l10n()->t('JPEG image quality'), DI::config()->get('system', 'jpeg_quality'), DI::l10n()->t('Uploaded JPEGS will be saved at this quality setting [0-100]. Default is 100, which is full quality.')], From 5b2ac7b94454c7f8832928265cba0a007305b128 Mon Sep 17 00:00:00 2001 From: Marek Bachmann Date: Mon, 28 Nov 2022 01:11:02 +0100 Subject: [PATCH 19/43] Added missing ')' --- src/Module/Admin/Site.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Module/Admin/Site.php b/src/Module/Admin/Site.php index 35f5887ea0..382bb99eca 100644 --- a/src/Module/Admin/Site.php +++ b/src/Module/Admin/Site.php @@ -470,7 +470,7 @@ class Site extends BaseAdmin '$maximagesize' => ['maximagesize', DI::l10n()->t('Maximum image size'), DI::config()->get('system', 'maximagesize'), DI::l10n()->t('Maximum size in bytes of uploaded images. Default is 0, which means no limits. The value of upload_max_filesize in your PHP.ini needs be set to at least the desired limit. - Currently upload_max_filesize is set to %s (%sB)', Strings::getBytesFromShorthand(ini_get('upload_max_filesize'), ini_get('upload_max_filesize')), + Currently upload_max_filesize is set to %s (%sB)', Strings::getBytesFromShorthand(ini_get('upload_max_filesize'), ini_get('upload_max_filesize'))), '1 kB = 1 KiB = 1024 Bytes'], '$maximagelength' => ['maximagelength', DI::l10n()->t('Maximum image length'), DI::config()->get('system', 'max_image_length'), DI::l10n()->t('Maximum length in pixels of the longest side of uploaded images. Default is -1, which means no limits.')], '$jpegimagequality' => ['jpegimagequality', DI::l10n()->t('JPEG image quality'), DI::config()->get('system', 'jpeg_quality'), DI::l10n()->t('Uploaded JPEGS will be saved at this quality setting [0-100]. Default is 100, which is full quality.')], From d43e3939215500f1b4248f7af9378ff4f38e2acc Mon Sep 17 00:00:00 2001 From: Marek Bachmann Date: Mon, 28 Nov 2022 01:16:54 +0100 Subject: [PATCH 20/43] and now the missing ')' at the correct position --- src/Module/Admin/Site.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Module/Admin/Site.php b/src/Module/Admin/Site.php index 382bb99eca..a6931ce916 100644 --- a/src/Module/Admin/Site.php +++ b/src/Module/Admin/Site.php @@ -470,7 +470,7 @@ class Site extends BaseAdmin '$maximagesize' => ['maximagesize', DI::l10n()->t('Maximum image size'), DI::config()->get('system', 'maximagesize'), DI::l10n()->t('Maximum size in bytes of uploaded images. Default is 0, which means no limits. The value of upload_max_filesize in your PHP.ini needs be set to at least the desired limit. - Currently upload_max_filesize is set to %s (%sB)', Strings::getBytesFromShorthand(ini_get('upload_max_filesize'), ini_get('upload_max_filesize'))), + Currently upload_max_filesize is set to %s (%sB)', Strings::getBytesFromShorthand(ini_get('upload_max_filesize')), ini_get('upload_max_filesize')), '1 kB = 1 KiB = 1024 Bytes'], '$maximagelength' => ['maximagelength', DI::l10n()->t('Maximum image length'), DI::config()->get('system', 'max_image_length'), DI::l10n()->t('Maximum length in pixels of the longest side of uploaded images. Default is -1, which means no limits.')], '$jpegimagequality' => ['jpegimagequality', DI::l10n()->t('JPEG image quality'), DI::config()->get('system', 'jpeg_quality'), DI::l10n()->t('Uploaded JPEGS will be saved at this quality setting [0-100]. Default is 100, which is full quality.')], From 361908ce3bf7c692a4d457a00f793bee60d0100d Mon Sep 17 00:00:00 2001 From: Marek Bachmann Date: Mon, 28 Nov 2022 01:23:00 +0100 Subject: [PATCH 21/43] and the messages.po --- view/lang/C/messages.po | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/view/lang/C/messages.po b/view/lang/C/messages.po index 362af94b93..a3dac64757 100644 --- a/view/lang/C/messages.po +++ b/view/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 2022.12-dev\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-27 23:52+0100\n" +"POT-Creation-Date: 2022-11-28 01:21+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -4275,19 +4275,14 @@ msgid "Maximum image size" msgstr "" #: src/Module/Admin/Site.php:471 +#, php-format msgid "" "Maximum size in bytes of uploaded images. Default is 0, which means no " -"limits." -msgstr "" - -#: src/Module/Admin/Site.php:472 -msgid "" -"The value of upload_max_filesize in your PHP.ini " -"needs be set to at least the desired limit. " -msgstr "" - -#: src/Module/Admin/Site.php:473 -msgid "Currently upload_max_filesize is set to " +"limits.\n" +"\t\t\t\t\t\t\t\t\t\t\t\t\tThe value of upload_max_filesize in " +"your PHP.ini needs be set to at least the desired limit.\n" +"\t\t\t\t\t\t\t\t\t\t\t\t\tCurrently upload_max_filesize is set " +"to %s (%sB)" msgstr "" #: src/Module/Admin/Site.php:475 From 25ba8bfb53cd53bcbe4be28d70edce2b01b4fa48 Mon Sep 17 00:00:00 2001 From: Marek Bachmann Date: Wed, 30 Nov 2022 01:05:32 +0100 Subject: [PATCH 22/43] allow shorthands in the system.maximagesize --- mod/photos.php | 5 ++- src/Module/Admin/Site.php | 13 ++++-- src/Module/Api/Mastodon/Trends.php | 54 +++++++++++++++++++++++ view/templates/field_input.tpl | 2 +- view/theme/frio/css/mod_admin.css | 8 ++++ view/theme/frio/templates/field_input.tpl | 2 +- 6 files changed, 77 insertions(+), 7 deletions(-) create mode 100644 src/Module/Api/Mastodon/Trends.php diff --git a/mod/photos.php b/mod/photos.php index 4bca8275e3..d44afa588c 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -916,13 +916,14 @@ function photos_content(App $a) $maximagesize_Mbytes = 0; // Get the relevant size limits for uploads. Abbreviated var names: MaxImageSize -> mis; upload_max_filesize -> umf - $mis_bytes = DI::config()->get('system', 'maximagesize'); + $mis_bytes = Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize')); $umf_bytes = Strings::getBytesFromShorthand(ini_get('upload_max_filesize')); // When PHP is configured with upload_max_filesize less than maximagesize provide this lower limit. $maximagesize_Mbytes = (is_numeric($mis_bytes) && ($mis_bytes < $umf_bytes) ? $mis_bytes : $umf_bytes) / (1048576); - $usage_message = DI::l10n()->t('The maximum accepted image size is %.3g MB', $maximagesize_Mbytes); + // @todo We may be want to use appropriate binary prefixed dynamicly + $usage_message = DI::l10n()->t('The maximum accepted image size is %.6g MB', $maximagesize_Mbytes); $tpl = Renderer::getMarkupTemplate('photos_upload.tpl'); diff --git a/src/Module/Admin/Site.php b/src/Module/Admin/Site.php index a6931ce916..8aa43c5564 100644 --- a/src/Module/Admin/Site.php +++ b/src/Module/Admin/Site.php @@ -34,6 +34,7 @@ use Friendica\Model\User; use Friendica\Module\BaseAdmin; use Friendica\Module\Conversation\Community; use Friendica\Module\Register; +use Friendica\Navigation\SystemMessages; use Friendica\Protocol\Relay; use Friendica\Util\BasePath; use Friendica\Util\EMailer\MailBuilder; @@ -41,6 +42,8 @@ use Friendica\Util\Strings; class Site extends BaseAdmin { +// const SHORTHAND_REGEX = '/*/i'; + protected function post(array $request = []) { self::checkAdminAccess(); @@ -68,7 +71,7 @@ class Site extends BaseAdmin $language = (!empty($_POST['language']) ? trim($_POST['language']) : ''); $theme = (!empty($_POST['theme']) ? trim($_POST['theme']) : ''); $theme_mobile = (!empty($_POST['theme_mobile']) ? trim($_POST['theme_mobile']) : ''); - $maximagesize = (!empty($_POST['maximagesize']) ? intval(trim($_POST['maximagesize'])) : 0); + $maximagesize = (!empty($_POST['maximagesize']) ? trim($_POST['maximagesize']) : 0); $maximagelength = (!empty($_POST['maximagelength']) ? intval(trim($_POST['maximagelength'])) : -1); $jpegimagequality = (!empty($_POST['jpegimagequality']) ? intval(trim($_POST['jpegimagequality'])) : 100); @@ -240,7 +243,11 @@ class Site extends BaseAdmin } else { DI::config()->set('system', 'singleuser', $singleuser); } - DI::config()->set('system', 'maximagesize' , $maximagesize); + if (preg_match('/\d+(?:\s*[kmg])?/i', $maximagesize)) { + DI::config()->set('system', 'maximagesize', $maximagesize); + } else { + DI::sysmsg()->addNotice(DI::l10n()->t('%s is no valid input for maximum image size', $maximagesize)); + } DI::config()->set('system', 'max_image_length' , $maximagelength); DI::config()->set('system', 'jpeg_quality' , $jpegimagequality); @@ -471,7 +478,7 @@ class Site extends BaseAdmin '$maximagesize' => ['maximagesize', DI::l10n()->t('Maximum image size'), DI::config()->get('system', 'maximagesize'), DI::l10n()->t('Maximum size in bytes of uploaded images. Default is 0, which means no limits. The value of upload_max_filesize in your PHP.ini needs be set to at least the desired limit. Currently upload_max_filesize is set to %s (%sB)', Strings::getBytesFromShorthand(ini_get('upload_max_filesize')), ini_get('upload_max_filesize')), - '1 kB = 1 KiB = 1024 Bytes'], + '', '', '', '\d+(?:\s*[kmg])?'], '$maximagelength' => ['maximagelength', DI::l10n()->t('Maximum image length'), DI::config()->get('system', 'max_image_length'), DI::l10n()->t('Maximum length in pixels of the longest side of uploaded images. Default is -1, which means no limits.')], '$jpegimagequality' => ['jpegimagequality', DI::l10n()->t('JPEG image quality'), DI::config()->get('system', 'jpeg_quality'), DI::l10n()->t('Uploaded JPEGS will be saved at this quality setting [0-100]. Default is 100, which is full quality.')], diff --git a/src/Module/Api/Mastodon/Trends.php b/src/Module/Api/Mastodon/Trends.php new file mode 100644 index 0000000000..c42a27641b --- /dev/null +++ b/src/Module/Api/Mastodon/Trends.php @@ -0,0 +1,54 @@ +. + * + */ + +namespace Friendica\Module\Api\Mastodon; + +use Friendica\Core\System; +use Friendica\DI; +use Friendica\Model\Tag; +use Friendica\Module\BaseApi; + +/** + * @see https://docs.joinmastodon.org/methods/instance/trends/ + */ +class Trends extends BaseApi +{ + /** + * @throws \Friendica\Network\HTTPException\InternalServerErrorException + */ + protected function rawContent(array $request = []) + { + $request = $this->getRequest([ + 'limit' => 20, // Maximum number of results to return. Defaults to 10. + ], $request); + + $trending = []; + $tags = Tag::getGlobalTrendingHashtags(24, 20); + foreach ($tags as $tag) { + $tag['name'] = $tag['term']; + $history = [['day' => (string)time(), 'uses' => (string)$tag['score'], 'accounts' => (string)$tag['authors']]]; + $hashtag = new \Friendica\Object\Api\Mastodon\Tag(DI::baseUrl(), $tag, $history); + $trending[] = $hashtag->toArray(); + } + + System::jsonExit(array_slice($trending, 0, $request['limit'])); + } +} diff --git a/view/templates/field_input.tpl b/view/templates/field_input.tpl index 3455891b9d..95a13cfb7b 100644 --- a/view/templates/field_input.tpl +++ b/view/templates/field_input.tpl @@ -1,7 +1,7 @@
- + {{if $field.3}} {{$field.3 nofilter}} {{/if}} diff --git a/view/theme/frio/css/mod_admin.css b/view/theme/frio/css/mod_admin.css index 3475d1d82a..355cfd1401 100644 --- a/view/theme/frio/css/mod_admin.css +++ b/view/theme/frio/css/mod_admin.css @@ -40,3 +40,11 @@ tr.details th { .adminpage td { word-break: break-all; } + +.adminpage input[id=id_maximagesize]:valid { + background-color: palegreen; +} + +.adminpage input[id=id_maximagesize]:invalid { + background-color: lightpink; +} \ No newline at end of file diff --git a/view/theme/frio/templates/field_input.tpl b/view/theme/frio/templates/field_input.tpl index 3a9e54d06a..9812e3466f 100644 --- a/view/theme/frio/templates/field_input.tpl +++ b/view/theme/frio/templates/field_input.tpl @@ -3,7 +3,7 @@ {{if !isset($label) || $label != false }} {{/if}} - + {{if $field.3}} {{$field.3 nofilter}} {{/if}} From 10e067298172b4af8dc469a2e5c04c4984dc2af8 Mon Sep 17 00:00:00 2001 From: Marek Bachmann Date: Wed, 30 Nov 2022 01:15:42 +0100 Subject: [PATCH 23/43] wanted to use a constant for the shorthand regex to be used in the form input templates and to check maximagesize post value. But Input field seems to require the regex without enclosing "/.../", so remove const for now --- src/Module/Admin/Site.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Module/Admin/Site.php b/src/Module/Admin/Site.php index 8aa43c5564..9e6967d827 100644 --- a/src/Module/Admin/Site.php +++ b/src/Module/Admin/Site.php @@ -42,8 +42,6 @@ use Friendica\Util\Strings; class Site extends BaseAdmin { -// const SHORTHAND_REGEX = '/*/i'; - protected function post(array $request = []) { self::checkAdminAccess(); From e73451d89bcaacf9508240a1a022db16cd80b4af Mon Sep 17 00:00:00 2001 From: Marek Bachmann Date: Wed, 30 Nov 2022 01:22:38 +0100 Subject: [PATCH 24/43] Added Strings::getBytesFromShorthand() for file size check at upload and new message.po --- mod/photos.php | 2 +- view/lang/C/messages.po | 511 ++++++++++++++++++++-------------------- 2 files changed, 259 insertions(+), 254 deletions(-) diff --git a/mod/photos.php b/mod/photos.php index d44afa588c..8671c39495 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -654,7 +654,7 @@ function photos_post(App $a) Logger::info('photos: upload: received file: ' . $filename . ' as ' . $src . ' ('. $type . ') ' . $filesize . ' bytes'); - $maximagesize = DI::config()->get('system', 'maximagesize'); + $maximagesize = Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize')); if ($maximagesize && ($filesize > $maximagesize)) { DI::sysmsg()->addNotice(DI::l10n()->t('Image exceeds size limit of %s', Strings::formatBytes($maximagesize))); diff --git a/view/lang/C/messages.po b/view/lang/C/messages.po index a3dac64757..6a330cad46 100644 --- a/view/lang/C/messages.po +++ b/view/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 2022.12-dev\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-28 01:21+0100\n" +"POT-Creation-Date: 2022-11-30 01:19+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -292,7 +292,7 @@ msgstr "" msgid "Insert web link" msgstr "" -#: mod/message.php:203 mod/message.php:360 mod/photos.php:1492 +#: mod/message.php:203 mod/message.php:360 mod/photos.php:1493 #: src/Content/Conversation.php:371 src/Content/Conversation.php:717 #: src/Module/Item/Compose.php:204 src/Module/Post/Edit.php:142 #: src/Module/Profile/UnkMail.php:155 src/Object/Post.php:537 @@ -300,8 +300,8 @@ msgid "Please wait" msgstr "" #: mod/message.php:204 mod/message.php:359 mod/photos.php:914 -#: mod/photos.php:1026 mod/photos.php:1298 mod/photos.php:1339 -#: mod/photos.php:1395 mod/photos.php:1469 +#: mod/photos.php:1027 mod/photos.php:1299 mod/photos.php:1340 +#: mod/photos.php:1396 mod/photos.php:1470 #: src/Module/Calendar/Event/Form.php:250 src/Module/Contact/Advanced.php:132 #: src/Module/Contact/Profile.php:327 #: src/Module/Debug/ActivityPubConversion.php:140 @@ -405,7 +405,7 @@ msgstr "" msgid "Recent Photos" msgstr "" -#: mod/photos.php:110 mod/photos.php:1074 src/Module/Profile/Photos.php:172 +#: mod/photos.php:110 mod/photos.php:1075 src/Module/Profile/Photos.php:172 #: src/Module/Profile/Photos.php:189 msgid "Upload New Photos" msgstr "" @@ -494,40 +494,40 @@ msgstr "" msgid "Access to this item is restricted." msgstr "" -#: mod/photos.php:925 -msgid "The maximum accepted image size is %.3g MB" +#: mod/photos.php:926 +msgid "The maximum accepted image size is %.6g MB" msgstr "" -#: mod/photos.php:932 +#: mod/photos.php:933 msgid "Upload Photos" msgstr "" -#: mod/photos.php:936 mod/photos.php:1022 +#: mod/photos.php:937 mod/photos.php:1023 msgid "New album name: " msgstr "" -#: mod/photos.php:937 +#: mod/photos.php:938 msgid "or select existing album:" msgstr "" -#: mod/photos.php:938 +#: mod/photos.php:939 msgid "Do not show a status post for this upload" msgstr "" -#: mod/photos.php:940 mod/photos.php:1294 src/Content/Conversation.php:373 +#: mod/photos.php:941 mod/photos.php:1295 src/Content/Conversation.php:373 #: src/Module/Calendar/Event/Form.php:253 src/Module/Post/Edit.php:179 msgid "Permissions" msgstr "" -#: mod/photos.php:1003 +#: mod/photos.php:1004 msgid "Do you really want to delete this photo album and all its photos?" msgstr "" -#: mod/photos.php:1004 mod/photos.php:1027 +#: mod/photos.php:1005 mod/photos.php:1028 msgid "Delete Album" msgstr "" -#: mod/photos.php:1005 mod/photos.php:1106 src/Content/Conversation.php:389 +#: mod/photos.php:1006 mod/photos.php:1107 src/Content/Conversation.php:389 #: src/Module/Contact/Follow.php:173 src/Module/Contact/Revoke.php:109 #: src/Module/Contact/Unfollow.php:126 #: src/Module/Media/Attachment/Browser.php:77 @@ -537,130 +537,130 @@ msgstr "" msgid "Cancel" msgstr "" -#: mod/photos.php:1031 +#: mod/photos.php:1032 msgid "Edit Album" msgstr "" -#: mod/photos.php:1032 +#: mod/photos.php:1033 msgid "Drop Album" msgstr "" -#: mod/photos.php:1036 +#: mod/photos.php:1037 msgid "Show Newest First" msgstr "" -#: mod/photos.php:1038 +#: mod/photos.php:1039 msgid "Show Oldest First" msgstr "" -#: mod/photos.php:1059 src/Module/Profile/Photos.php:140 +#: mod/photos.php:1060 src/Module/Profile/Photos.php:140 msgid "View Photo" msgstr "" -#: mod/photos.php:1092 +#: mod/photos.php:1093 msgid "Permission denied. Access to this item may be restricted." msgstr "" -#: mod/photos.php:1094 +#: mod/photos.php:1095 msgid "Photo not available" msgstr "" -#: mod/photos.php:1104 +#: mod/photos.php:1105 msgid "Do you really want to delete this photo?" msgstr "" -#: mod/photos.php:1105 mod/photos.php:1299 +#: mod/photos.php:1106 mod/photos.php:1300 msgid "Delete Photo" msgstr "" -#: mod/photos.php:1197 +#: mod/photos.php:1198 msgid "View photo" msgstr "" -#: mod/photos.php:1199 +#: mod/photos.php:1200 msgid "Edit photo" msgstr "" -#: mod/photos.php:1200 +#: mod/photos.php:1201 msgid "Delete photo" msgstr "" -#: mod/photos.php:1201 +#: mod/photos.php:1202 msgid "Use as profile photo" msgstr "" -#: mod/photos.php:1208 +#: mod/photos.php:1209 msgid "Private Photo" msgstr "" -#: mod/photos.php:1214 +#: mod/photos.php:1215 msgid "View Full Size" msgstr "" -#: mod/photos.php:1267 +#: mod/photos.php:1268 msgid "Tags: " msgstr "" -#: mod/photos.php:1270 +#: mod/photos.php:1271 msgid "[Select tags to remove]" msgstr "" -#: mod/photos.php:1285 +#: mod/photos.php:1286 msgid "New album name" msgstr "" -#: mod/photos.php:1286 +#: mod/photos.php:1287 msgid "Caption" msgstr "" -#: mod/photos.php:1287 +#: mod/photos.php:1288 msgid "Add a Tag" msgstr "" -#: mod/photos.php:1287 +#: mod/photos.php:1288 msgid "Example: @bob, @Barbara_Jensen, @jim@example.com, #California, #camping" msgstr "" -#: mod/photos.php:1288 +#: mod/photos.php:1289 msgid "Do not rotate" msgstr "" -#: mod/photos.php:1289 +#: mod/photos.php:1290 msgid "Rotate CW (right)" msgstr "" -#: mod/photos.php:1290 +#: mod/photos.php:1291 msgid "Rotate CCW (left)" msgstr "" -#: mod/photos.php:1336 mod/photos.php:1392 mod/photos.php:1466 +#: mod/photos.php:1337 mod/photos.php:1393 mod/photos.php:1467 #: src/Module/Contact.php:547 src/Module/Item/Compose.php:188 #: src/Object/Post.php:983 msgid "This is you" msgstr "" -#: mod/photos.php:1338 mod/photos.php:1394 mod/photos.php:1468 +#: mod/photos.php:1339 mod/photos.php:1395 mod/photos.php:1469 #: src/Object/Post.php:531 src/Object/Post.php:985 msgid "Comment" msgstr "" -#: mod/photos.php:1340 mod/photos.php:1396 mod/photos.php:1470 +#: mod/photos.php:1341 mod/photos.php:1397 mod/photos.php:1471 #: src/Content/Conversation.php:386 src/Module/Calendar/Event/Form.php:248 #: src/Module/Item/Compose.php:199 src/Module/Post/Edit.php:162 #: src/Object/Post.php:997 msgid "Preview" msgstr "" -#: mod/photos.php:1341 src/Content/Conversation.php:341 +#: mod/photos.php:1342 src/Content/Conversation.php:341 #: src/Module/Post/Edit.php:127 src/Object/Post.php:987 msgid "Loading..." msgstr "" -#: mod/photos.php:1427 src/Content/Conversation.php:633 src/Object/Post.php:255 +#: mod/photos.php:1428 src/Content/Conversation.php:633 src/Object/Post.php:255 msgid "Select" msgstr "" -#: mod/photos.php:1428 src/Content/Conversation.php:634 +#: mod/photos.php:1429 src/Content/Conversation.php:634 #: src/Module/Moderation/Users/Active.php:136 #: src/Module/Moderation/Users/Blocked.php:136 #: src/Module/Moderation/Users/Index.php:151 @@ -668,23 +668,23 @@ msgstr "" msgid "Delete" msgstr "" -#: mod/photos.php:1489 src/Object/Post.php:378 +#: mod/photos.php:1490 src/Object/Post.php:378 msgid "Like" msgstr "" -#: mod/photos.php:1490 src/Object/Post.php:378 +#: mod/photos.php:1491 src/Object/Post.php:378 msgid "I like this (toggle)" msgstr "" -#: mod/photos.php:1491 src/Object/Post.php:379 +#: mod/photos.php:1492 src/Object/Post.php:379 msgid "Dislike" msgstr "" -#: mod/photos.php:1493 src/Object/Post.php:379 +#: mod/photos.php:1494 src/Object/Post.php:379 msgid "I don't like this (toggle)" msgstr "" -#: mod/photos.php:1515 +#: mod/photos.php:1516 msgid "Map" msgstr "" @@ -710,16 +710,16 @@ msgstr "" msgid "toggle mobile" msgstr "" -#: src/App/Router.php:310 +#: src/App/Router.php:309 #, php-format msgid "Method not allowed for this module. Allowed method(s): %s" msgstr "" -#: src/App/Router.php:312 src/Module/HTTPException/PageNotFound.php:49 +#: src/App/Router.php:311 src/Module/HTTPException/PageNotFound.php:49 msgid "Page not found." msgstr "" -#: src/App/Router.php:338 +#: src/App/Router.php:323 msgid "You must be logged in to use addons. " msgstr "" @@ -3607,7 +3607,7 @@ msgstr "" #: src/Module/Admin/Addons/Details.php:111 src/Module/Admin/Addons/Index.php:67 #: src/Module/Admin/Federation.php:202 src/Module/Admin/Logs/Settings.php:79 #: src/Module/Admin/Logs/View.php:84 src/Module/Admin/Queue.php:72 -#: src/Module/Admin/Site.php:432 src/Module/Admin/Storage.php:138 +#: src/Module/Admin/Site.php:437 src/Module/Admin/Storage.php:138 #: src/Module/Admin/Summary.php:216 src/Module/Admin/Themes/Details.php:90 #: src/Module/Admin/Themes/Index.php:111 src/Module/Admin/Tos.php:75 #: src/Module/Moderation/Users/Create.php:61 @@ -3645,7 +3645,7 @@ msgid "Addon %s failed to install." msgstr "" #: src/Module/Admin/Addons/Index.php:69 src/Module/Admin/Features.php:87 -#: src/Module/Admin/Logs/Settings.php:81 src/Module/Admin/Site.php:435 +#: src/Module/Admin/Logs/Settings.php:81 src/Module/Admin/Site.php:440 #: src/Module/Admin/Themes/Index.php:113 src/Module/Admin/Tos.php:83 #: src/Module/Settings/Account.php:560 src/Module/Settings/Addons.php:81 #: src/Module/Settings/Connectors.php:159 @@ -3997,284 +3997,289 @@ msgstr "" msgid "Priority" msgstr "" -#: src/Module/Admin/Site.php:337 src/Module/Settings/Display.php:137 +#: src/Module/Admin/Site.php:247 +#, php-format +msgid "%s is no valid input for maximum image size" +msgstr "" + +#: src/Module/Admin/Site.php:342 src/Module/Settings/Display.php:137 msgid "No special theme for mobile devices" msgstr "" -#: src/Module/Admin/Site.php:354 src/Module/Settings/Display.php:147 +#: src/Module/Admin/Site.php:359 src/Module/Settings/Display.php:147 #, php-format msgid "%s - (Experimental)" msgstr "" -#: src/Module/Admin/Site.php:366 +#: src/Module/Admin/Site.php:371 msgid "No community page" msgstr "" -#: src/Module/Admin/Site.php:367 +#: src/Module/Admin/Site.php:372 msgid "No community page for visitors" msgstr "" -#: src/Module/Admin/Site.php:368 +#: src/Module/Admin/Site.php:373 msgid "Public postings from users of this site" msgstr "" -#: src/Module/Admin/Site.php:369 +#: src/Module/Admin/Site.php:374 msgid "Public postings from the federated network" msgstr "" -#: src/Module/Admin/Site.php:370 +#: src/Module/Admin/Site.php:375 msgid "Public postings from local users and the federated network" msgstr "" -#: src/Module/Admin/Site.php:376 +#: src/Module/Admin/Site.php:381 msgid "Multi user instance" msgstr "" -#: src/Module/Admin/Site.php:403 +#: src/Module/Admin/Site.php:408 msgid "Closed" msgstr "" -#: src/Module/Admin/Site.php:404 +#: src/Module/Admin/Site.php:409 msgid "Requires approval" msgstr "" -#: src/Module/Admin/Site.php:405 +#: src/Module/Admin/Site.php:410 msgid "Open" msgstr "" -#: src/Module/Admin/Site.php:409 src/Module/Install.php:222 +#: src/Module/Admin/Site.php:414 src/Module/Install.php:222 msgid "No SSL policy, links will track page SSL state" msgstr "" -#: src/Module/Admin/Site.php:410 src/Module/Install.php:223 +#: src/Module/Admin/Site.php:415 src/Module/Install.php:223 msgid "Force all links to use SSL" msgstr "" -#: src/Module/Admin/Site.php:411 src/Module/Install.php:224 +#: src/Module/Admin/Site.php:416 src/Module/Install.php:224 msgid "Self-signed certificate, use SSL for local links only (discouraged)" msgstr "" -#: src/Module/Admin/Site.php:415 +#: src/Module/Admin/Site.php:420 msgid "Don't check" msgstr "" -#: src/Module/Admin/Site.php:416 +#: src/Module/Admin/Site.php:421 msgid "check the stable version" msgstr "" -#: src/Module/Admin/Site.php:417 +#: src/Module/Admin/Site.php:422 msgid "check the development version" msgstr "" -#: src/Module/Admin/Site.php:421 +#: src/Module/Admin/Site.php:426 msgid "none" msgstr "" -#: src/Module/Admin/Site.php:422 +#: src/Module/Admin/Site.php:427 msgid "Local contacts" msgstr "" -#: src/Module/Admin/Site.php:423 +#: src/Module/Admin/Site.php:428 msgid "Interactors" msgstr "" -#: src/Module/Admin/Site.php:433 src/Module/BaseAdmin.php:90 +#: src/Module/Admin/Site.php:438 src/Module/BaseAdmin.php:90 msgid "Site" msgstr "" -#: src/Module/Admin/Site.php:434 +#: src/Module/Admin/Site.php:439 msgid "General Information" msgstr "" -#: src/Module/Admin/Site.php:436 +#: src/Module/Admin/Site.php:441 msgid "Republish users to directory" msgstr "" -#: src/Module/Admin/Site.php:437 src/Module/Register.php:152 +#: src/Module/Admin/Site.php:442 src/Module/Register.php:152 msgid "Registration" msgstr "" -#: src/Module/Admin/Site.php:438 +#: src/Module/Admin/Site.php:443 msgid "File upload" msgstr "" -#: src/Module/Admin/Site.php:439 +#: src/Module/Admin/Site.php:444 msgid "Policies" msgstr "" -#: src/Module/Admin/Site.php:440 src/Module/Calendar/Event/Form.php:252 +#: src/Module/Admin/Site.php:445 src/Module/Calendar/Event/Form.php:252 #: src/Module/Contact.php:477 src/Module/Profile/Profile.php:248 msgid "Advanced" msgstr "" -#: src/Module/Admin/Site.php:441 +#: src/Module/Admin/Site.php:446 msgid "Auto Discovered Contact Directory" msgstr "" -#: src/Module/Admin/Site.php:442 +#: src/Module/Admin/Site.php:447 msgid "Performance" msgstr "" -#: src/Module/Admin/Site.php:443 +#: src/Module/Admin/Site.php:448 msgid "Worker" msgstr "" -#: src/Module/Admin/Site.php:444 +#: src/Module/Admin/Site.php:449 msgid "Message Relay" msgstr "" -#: src/Module/Admin/Site.php:445 +#: src/Module/Admin/Site.php:450 msgid "" "Use the command \"console relay\" in the command line to add or remove " "relays." msgstr "" -#: src/Module/Admin/Site.php:446 +#: src/Module/Admin/Site.php:451 msgid "The system is not subscribed to any relays at the moment." msgstr "" -#: src/Module/Admin/Site.php:447 +#: src/Module/Admin/Site.php:452 msgid "The system is currently subscribed to the following relays:" msgstr "" -#: src/Module/Admin/Site.php:449 +#: src/Module/Admin/Site.php:454 msgid "Relocate Node" msgstr "" -#: src/Module/Admin/Site.php:450 +#: src/Module/Admin/Site.php:455 msgid "" "Relocating your node enables you to change the DNS domain of this node and " "keep all the existing users and posts. This process takes a while and can " "only be started from the relocate console command like this:" msgstr "" -#: src/Module/Admin/Site.php:451 +#: src/Module/Admin/Site.php:456 msgid "(Friendica directory)# bin/console relocate https://newdomain.com" msgstr "" -#: src/Module/Admin/Site.php:455 +#: src/Module/Admin/Site.php:460 msgid "Site name" msgstr "" -#: src/Module/Admin/Site.php:456 +#: src/Module/Admin/Site.php:461 msgid "Sender Email" msgstr "" -#: src/Module/Admin/Site.php:456 +#: src/Module/Admin/Site.php:461 msgid "" "The email address your server shall use to send notification emails from." msgstr "" -#: src/Module/Admin/Site.php:457 +#: src/Module/Admin/Site.php:462 msgid "Name of the system actor" msgstr "" -#: src/Module/Admin/Site.php:457 +#: src/Module/Admin/Site.php:462 msgid "" "Name of the internal system account that is used to perform ActivityPub " "requests. This must be an unused username. If set, this can't be changed " "again." msgstr "" -#: src/Module/Admin/Site.php:458 +#: src/Module/Admin/Site.php:463 msgid "Banner/Logo" msgstr "" -#: src/Module/Admin/Site.php:459 +#: src/Module/Admin/Site.php:464 msgid "Email Banner/Logo" msgstr "" -#: src/Module/Admin/Site.php:460 +#: src/Module/Admin/Site.php:465 msgid "Shortcut icon" msgstr "" -#: src/Module/Admin/Site.php:460 +#: src/Module/Admin/Site.php:465 msgid "Link to an icon that will be used for browsers." msgstr "" -#: src/Module/Admin/Site.php:461 +#: src/Module/Admin/Site.php:466 msgid "Touch icon" msgstr "" -#: src/Module/Admin/Site.php:461 +#: src/Module/Admin/Site.php:466 msgid "Link to an icon that will be used for tablets and mobiles." msgstr "" -#: src/Module/Admin/Site.php:462 +#: src/Module/Admin/Site.php:467 msgid "Additional Info" msgstr "" -#: src/Module/Admin/Site.php:462 +#: src/Module/Admin/Site.php:467 #, php-format msgid "" "For public servers: you can add additional information here that will be " "listed at %s/servers." msgstr "" -#: src/Module/Admin/Site.php:463 +#: src/Module/Admin/Site.php:468 msgid "System language" msgstr "" -#: src/Module/Admin/Site.php:464 +#: src/Module/Admin/Site.php:469 msgid "System theme" msgstr "" -#: src/Module/Admin/Site.php:464 +#: src/Module/Admin/Site.php:469 #, php-format msgid "" "Default system theme - may be over-ridden by user profiles - Change default theme settings" msgstr "" -#: src/Module/Admin/Site.php:465 +#: src/Module/Admin/Site.php:470 msgid "Mobile system theme" msgstr "" -#: src/Module/Admin/Site.php:465 +#: src/Module/Admin/Site.php:470 msgid "Theme for mobile devices" msgstr "" -#: src/Module/Admin/Site.php:466 src/Module/Install.php:232 +#: src/Module/Admin/Site.php:471 src/Module/Install.php:232 msgid "SSL link policy" msgstr "" -#: src/Module/Admin/Site.php:466 src/Module/Install.php:234 +#: src/Module/Admin/Site.php:471 src/Module/Install.php:234 msgid "Determines whether generated links should be forced to use SSL" msgstr "" -#: src/Module/Admin/Site.php:467 +#: src/Module/Admin/Site.php:472 msgid "Force SSL" msgstr "" -#: src/Module/Admin/Site.php:467 +#: src/Module/Admin/Site.php:472 msgid "" "Force all Non-SSL requests to SSL - Attention: on some systems it could lead " "to endless loops." msgstr "" -#: src/Module/Admin/Site.php:468 +#: src/Module/Admin/Site.php:473 msgid "Show help entry from navigation menu" msgstr "" -#: src/Module/Admin/Site.php:468 +#: src/Module/Admin/Site.php:473 msgid "" "Displays the menu entry for the Help pages from the navigation menu. It is " "always accessible by calling /help directly." msgstr "" -#: src/Module/Admin/Site.php:469 +#: src/Module/Admin/Site.php:474 msgid "Single user instance" msgstr "" -#: src/Module/Admin/Site.php:469 +#: src/Module/Admin/Site.php:474 msgid "Make this instance multi-user or single-user for the named user" msgstr "" -#: src/Module/Admin/Site.php:471 +#: src/Module/Admin/Site.php:476 msgid "Maximum image size" msgstr "" -#: src/Module/Admin/Site.php:471 +#: src/Module/Admin/Site.php:476 #, php-format msgid "" "Maximum size in bytes of uploaded images. Default is 0, which means no " @@ -4285,192 +4290,192 @@ msgid "" "to %s (%sB)" msgstr "" -#: src/Module/Admin/Site.php:475 +#: src/Module/Admin/Site.php:480 msgid "Maximum image length" msgstr "" -#: src/Module/Admin/Site.php:475 +#: src/Module/Admin/Site.php:480 msgid "" "Maximum length in pixels of the longest side of uploaded images. Default is " "-1, which means no limits." msgstr "" -#: src/Module/Admin/Site.php:476 +#: src/Module/Admin/Site.php:481 msgid "JPEG image quality" msgstr "" -#: src/Module/Admin/Site.php:476 +#: src/Module/Admin/Site.php:481 msgid "" "Uploaded JPEGS will be saved at this quality setting [0-100]. Default is " "100, which is full quality." msgstr "" -#: src/Module/Admin/Site.php:478 +#: src/Module/Admin/Site.php:483 msgid "Register policy" msgstr "" -#: src/Module/Admin/Site.php:479 +#: src/Module/Admin/Site.php:484 msgid "Maximum Daily Registrations" msgstr "" -#: src/Module/Admin/Site.php:479 +#: src/Module/Admin/Site.php:484 msgid "" "If registration is permitted above, this sets the maximum number of new user " "registrations to accept per day. If register is set to closed, this setting " "has no effect." msgstr "" -#: src/Module/Admin/Site.php:480 +#: src/Module/Admin/Site.php:485 msgid "Register text" msgstr "" -#: src/Module/Admin/Site.php:480 +#: src/Module/Admin/Site.php:485 msgid "" "Will be displayed prominently on the registration page. You can use BBCode " "here." msgstr "" -#: src/Module/Admin/Site.php:481 +#: src/Module/Admin/Site.php:486 msgid "Forbidden Nicknames" msgstr "" -#: src/Module/Admin/Site.php:481 +#: src/Module/Admin/Site.php:486 msgid "" "Comma separated list of nicknames that are forbidden from registration. " "Preset is a list of role names according RFC 2142." msgstr "" -#: src/Module/Admin/Site.php:482 +#: src/Module/Admin/Site.php:487 msgid "Accounts abandoned after x days" msgstr "" -#: src/Module/Admin/Site.php:482 +#: src/Module/Admin/Site.php:487 msgid "" "Will not waste system resources polling external sites for abandonded " "accounts. Enter 0 for no time limit." msgstr "" -#: src/Module/Admin/Site.php:483 +#: src/Module/Admin/Site.php:488 msgid "Allowed friend domains" msgstr "" -#: src/Module/Admin/Site.php:483 +#: src/Module/Admin/Site.php:488 msgid "" "Comma separated list of domains which are allowed to establish friendships " "with this site. Wildcards are accepted. Empty to allow any domains" msgstr "" -#: src/Module/Admin/Site.php:484 +#: src/Module/Admin/Site.php:489 msgid "Allowed email domains" msgstr "" -#: src/Module/Admin/Site.php:484 +#: src/Module/Admin/Site.php:489 msgid "" "Comma separated list of domains which are allowed in email addresses for " "registrations to this site. Wildcards are accepted. Empty to allow any " "domains" msgstr "" -#: src/Module/Admin/Site.php:485 +#: src/Module/Admin/Site.php:490 msgid "No OEmbed rich content" msgstr "" -#: src/Module/Admin/Site.php:485 +#: src/Module/Admin/Site.php:490 msgid "" "Don't show the rich content (e.g. embedded PDF), except from the domains " "listed below." msgstr "" -#: src/Module/Admin/Site.php:486 +#: src/Module/Admin/Site.php:491 msgid "Trusted third-party domains" msgstr "" -#: src/Module/Admin/Site.php:486 +#: src/Module/Admin/Site.php:491 msgid "" "Comma separated list of domains from which content is allowed to be embedded " "in posts like with OEmbed. All sub-domains of the listed domains are allowed " "as well." msgstr "" -#: src/Module/Admin/Site.php:487 +#: src/Module/Admin/Site.php:492 msgid "Block public" msgstr "" -#: src/Module/Admin/Site.php:487 +#: src/Module/Admin/Site.php:492 msgid "" "Check to block public access to all otherwise public personal pages on this " "site unless you are currently logged in." msgstr "" -#: src/Module/Admin/Site.php:488 +#: src/Module/Admin/Site.php:493 msgid "Force publish" msgstr "" -#: src/Module/Admin/Site.php:488 +#: src/Module/Admin/Site.php:493 msgid "" "Check to force all profiles on this site to be listed in the site directory." msgstr "" -#: src/Module/Admin/Site.php:488 +#: src/Module/Admin/Site.php:493 msgid "Enabling this may violate privacy laws like the GDPR" msgstr "" -#: src/Module/Admin/Site.php:489 +#: src/Module/Admin/Site.php:494 msgid "Global directory URL" msgstr "" -#: src/Module/Admin/Site.php:489 +#: src/Module/Admin/Site.php:494 msgid "" "URL to the global directory. If this is not set, the global directory is " "completely unavailable to the application." msgstr "" -#: src/Module/Admin/Site.php:490 +#: src/Module/Admin/Site.php:495 msgid "Private posts by default for new users" msgstr "" -#: src/Module/Admin/Site.php:490 +#: src/Module/Admin/Site.php:495 msgid "" "Set default post permissions for all new members to the default privacy " "group rather than public." msgstr "" -#: src/Module/Admin/Site.php:491 +#: src/Module/Admin/Site.php:496 msgid "Don't include post content in email notifications" msgstr "" -#: src/Module/Admin/Site.php:491 +#: src/Module/Admin/Site.php:496 msgid "" "Don't include the content of a post/comment/private message/etc. in the " "email notifications that are sent out from this site, as a privacy measure." msgstr "" -#: src/Module/Admin/Site.php:492 +#: src/Module/Admin/Site.php:497 msgid "Disallow public access to addons listed in the apps menu." msgstr "" -#: src/Module/Admin/Site.php:492 +#: src/Module/Admin/Site.php:497 msgid "" "Checking this box will restrict addons listed in the apps menu to members " "only." msgstr "" -#: src/Module/Admin/Site.php:493 +#: src/Module/Admin/Site.php:498 msgid "Don't embed private images in posts" msgstr "" -#: src/Module/Admin/Site.php:493 +#: src/Module/Admin/Site.php:498 msgid "" "Don't replace locally-hosted private photos in posts with an embedded copy " "of the image. This means that contacts who receive posts containing private " "photos will have to authenticate and load each image, which may take a while." msgstr "" -#: src/Module/Admin/Site.php:494 +#: src/Module/Admin/Site.php:499 msgid "Explicit Content" msgstr "" -#: src/Module/Admin/Site.php:494 +#: src/Module/Admin/Site.php:499 msgid "" "Set this to announce that your node is used mostly for explicit content that " "might not be suited for minors. This information will be published in the " @@ -4479,267 +4484,267 @@ msgid "" "will be shown at the user registration page." msgstr "" -#: src/Module/Admin/Site.php:495 +#: src/Module/Admin/Site.php:500 msgid "Proxify external content" msgstr "" -#: src/Module/Admin/Site.php:495 +#: src/Module/Admin/Site.php:500 msgid "" "Route external content via the proxy functionality. This is used for example " "for some OEmbed accesses and in some other rare cases." msgstr "" -#: src/Module/Admin/Site.php:496 +#: src/Module/Admin/Site.php:501 msgid "Cache contact avatars" msgstr "" -#: src/Module/Admin/Site.php:496 +#: src/Module/Admin/Site.php:501 msgid "" "Locally store the avatar pictures of the contacts. This uses a lot of " "storage space but it increases the performance." msgstr "" -#: src/Module/Admin/Site.php:497 +#: src/Module/Admin/Site.php:502 msgid "Allow Users to set remote_self" msgstr "" -#: src/Module/Admin/Site.php:497 +#: src/Module/Admin/Site.php:502 msgid "" "With checking this, every user is allowed to mark every contact as a " "remote_self in the repair contact dialog. Setting this flag on a contact " "causes mirroring every posting of that contact in the users stream." msgstr "" -#: src/Module/Admin/Site.php:498 +#: src/Module/Admin/Site.php:503 msgid "Enable multiple registrations" msgstr "" -#: src/Module/Admin/Site.php:498 +#: src/Module/Admin/Site.php:503 msgid "Enable users to register additional accounts for use as pages." msgstr "" -#: src/Module/Admin/Site.php:499 +#: src/Module/Admin/Site.php:504 msgid "Enable OpenID" msgstr "" -#: src/Module/Admin/Site.php:499 +#: src/Module/Admin/Site.php:504 msgid "Enable OpenID support for registration and logins." msgstr "" -#: src/Module/Admin/Site.php:500 +#: src/Module/Admin/Site.php:505 msgid "Enable Fullname check" msgstr "" -#: src/Module/Admin/Site.php:500 +#: src/Module/Admin/Site.php:505 msgid "" "Enable check to only allow users to register with a space between the first " "name and the last name in their full name." msgstr "" -#: src/Module/Admin/Site.php:501 +#: src/Module/Admin/Site.php:506 msgid "Email administrators on new registration" msgstr "" -#: src/Module/Admin/Site.php:501 +#: src/Module/Admin/Site.php:506 msgid "" "If enabled and the system is set to an open registration, an email for each " "new registration is sent to the administrators." msgstr "" -#: src/Module/Admin/Site.php:502 +#: src/Module/Admin/Site.php:507 msgid "Community pages for visitors" msgstr "" -#: src/Module/Admin/Site.php:502 +#: src/Module/Admin/Site.php:507 msgid "" "Which community pages should be available for visitors. Local users always " "see both pages." msgstr "" -#: src/Module/Admin/Site.php:503 +#: src/Module/Admin/Site.php:508 msgid "Posts per user on community page" msgstr "" -#: src/Module/Admin/Site.php:503 +#: src/Module/Admin/Site.php:508 msgid "" "The maximum number of posts per user on the community page. (Not valid for " "\"Global Community\")" msgstr "" -#: src/Module/Admin/Site.php:505 +#: src/Module/Admin/Site.php:510 msgid "Enable Mail support" msgstr "" -#: src/Module/Admin/Site.php:505 +#: src/Module/Admin/Site.php:510 msgid "" "Enable built-in mail support to poll IMAP folders and to reply via mail." msgstr "" -#: src/Module/Admin/Site.php:506 +#: src/Module/Admin/Site.php:511 msgid "" "Mail support can't be enabled because the PHP IMAP module is not installed." msgstr "" -#: src/Module/Admin/Site.php:507 +#: src/Module/Admin/Site.php:512 msgid "Enable OStatus support" msgstr "" -#: src/Module/Admin/Site.php:507 +#: src/Module/Admin/Site.php:512 msgid "" "Enable built-in OStatus (StatusNet, GNU Social etc.) compatibility. All " "communications in OStatus are public." msgstr "" -#: src/Module/Admin/Site.php:509 +#: src/Module/Admin/Site.php:514 msgid "" "Diaspora support can't be enabled because Friendica was installed into a sub " "directory." msgstr "" -#: src/Module/Admin/Site.php:510 +#: src/Module/Admin/Site.php:515 msgid "Enable Diaspora support" msgstr "" -#: src/Module/Admin/Site.php:510 +#: src/Module/Admin/Site.php:515 msgid "" "Enable built-in Diaspora network compatibility for communicating with " "diaspora servers." msgstr "" -#: src/Module/Admin/Site.php:511 +#: src/Module/Admin/Site.php:516 msgid "Verify SSL" msgstr "" -#: src/Module/Admin/Site.php:511 +#: src/Module/Admin/Site.php:516 msgid "" "If you wish, you can turn on strict certificate checking. This will mean you " "cannot connect (at all) to self-signed SSL sites." msgstr "" -#: src/Module/Admin/Site.php:512 +#: src/Module/Admin/Site.php:517 msgid "Proxy user" msgstr "" -#: src/Module/Admin/Site.php:512 +#: src/Module/Admin/Site.php:517 msgid "User name for the proxy server." msgstr "" -#: src/Module/Admin/Site.php:513 +#: src/Module/Admin/Site.php:518 msgid "Proxy URL" msgstr "" -#: src/Module/Admin/Site.php:513 +#: src/Module/Admin/Site.php:518 msgid "" "If you want to use a proxy server that Friendica should use to connect to " "the network, put the URL of the proxy here." msgstr "" -#: src/Module/Admin/Site.php:514 +#: src/Module/Admin/Site.php:519 msgid "Network timeout" msgstr "" -#: src/Module/Admin/Site.php:514 +#: src/Module/Admin/Site.php:519 msgid "Value is in seconds. Set to 0 for unlimited (not recommended)." msgstr "" -#: src/Module/Admin/Site.php:515 +#: src/Module/Admin/Site.php:520 msgid "Maximum Load Average" msgstr "" -#: src/Module/Admin/Site.php:515 +#: src/Module/Admin/Site.php:520 #, php-format msgid "" "Maximum system load before delivery and poll processes are deferred - " "default %d." msgstr "" -#: src/Module/Admin/Site.php:516 +#: src/Module/Admin/Site.php:521 msgid "Minimal Memory" msgstr "" -#: src/Module/Admin/Site.php:516 +#: src/Module/Admin/Site.php:521 msgid "" "Minimal free memory in MB for the worker. Needs access to /proc/meminfo - " "default 0 (deactivated)." msgstr "" -#: src/Module/Admin/Site.php:517 +#: src/Module/Admin/Site.php:522 msgid "Periodically optimize tables" msgstr "" -#: src/Module/Admin/Site.php:517 +#: src/Module/Admin/Site.php:522 msgid "Periodically optimize tables like the cache and the workerqueue" msgstr "" -#: src/Module/Admin/Site.php:519 +#: src/Module/Admin/Site.php:524 msgid "Discover followers/followings from contacts" msgstr "" -#: src/Module/Admin/Site.php:519 +#: src/Module/Admin/Site.php:524 msgid "" "If enabled, contacts are checked for their followers and following contacts." msgstr "" -#: src/Module/Admin/Site.php:520 +#: src/Module/Admin/Site.php:525 msgid "None - deactivated" msgstr "" -#: src/Module/Admin/Site.php:521 +#: src/Module/Admin/Site.php:526 msgid "" "Local contacts - contacts of our local contacts are discovered for their " "followers/followings." msgstr "" -#: src/Module/Admin/Site.php:522 +#: src/Module/Admin/Site.php:527 msgid "" "Interactors - contacts of our local contacts and contacts who interacted on " "locally visible postings are discovered for their followers/followings." msgstr "" -#: src/Module/Admin/Site.php:524 +#: src/Module/Admin/Site.php:529 msgid "Synchronize the contacts with the directory server" msgstr "" -#: src/Module/Admin/Site.php:524 +#: src/Module/Admin/Site.php:529 msgid "" "if enabled, the system will check periodically for new contacts on the " "defined directory server." msgstr "" -#: src/Module/Admin/Site.php:526 +#: src/Module/Admin/Site.php:531 msgid "Days between requery" msgstr "" -#: src/Module/Admin/Site.php:526 +#: src/Module/Admin/Site.php:531 msgid "Number of days after which a server is requeried for his contacts." msgstr "" -#: src/Module/Admin/Site.php:527 +#: src/Module/Admin/Site.php:532 msgid "Discover contacts from other servers" msgstr "" -#: src/Module/Admin/Site.php:527 +#: src/Module/Admin/Site.php:532 msgid "" "Periodically query other servers for contacts. The system queries Friendica, " "Mastodon and Hubzilla servers." msgstr "" -#: src/Module/Admin/Site.php:528 +#: src/Module/Admin/Site.php:533 msgid "Search the local directory" msgstr "" -#: src/Module/Admin/Site.php:528 +#: src/Module/Admin/Site.php:533 msgid "" "Search the local directory instead of the global directory. When searching " "locally, every search will be executed on the global directory in the " "background. This improves the search results when the search is repeated." msgstr "" -#: src/Module/Admin/Site.php:530 +#: src/Module/Admin/Site.php:535 msgid "Publish server information" msgstr "" -#: src/Module/Admin/Site.php:530 +#: src/Module/Admin/Site.php:535 msgid "" "If enabled, general server and usage data will be published. The data " "contains the name and version of the server, number of users with public " @@ -4747,50 +4752,50 @@ msgid "" "href=\"http://the-federation.info/\">the-federation.info for details." msgstr "" -#: src/Module/Admin/Site.php:532 +#: src/Module/Admin/Site.php:537 msgid "Check upstream version" msgstr "" -#: src/Module/Admin/Site.php:532 +#: src/Module/Admin/Site.php:537 msgid "" "Enables checking for new Friendica versions at github. If there is a new " "version, you will be informed in the admin panel overview." msgstr "" -#: src/Module/Admin/Site.php:533 +#: src/Module/Admin/Site.php:538 msgid "Suppress Tags" msgstr "" -#: src/Module/Admin/Site.php:533 +#: src/Module/Admin/Site.php:538 msgid "Suppress showing a list of hashtags at the end of the posting." msgstr "" -#: src/Module/Admin/Site.php:534 +#: src/Module/Admin/Site.php:539 msgid "Clean database" msgstr "" -#: src/Module/Admin/Site.php:534 +#: src/Module/Admin/Site.php:539 msgid "" "Remove old remote items, orphaned database records and old content from some " "other helper tables." msgstr "" -#: src/Module/Admin/Site.php:535 +#: src/Module/Admin/Site.php:540 msgid "Lifespan of remote items" msgstr "" -#: src/Module/Admin/Site.php:535 +#: src/Module/Admin/Site.php:540 msgid "" "When the database cleanup is enabled, this defines the days after which " "remote items will be deleted. Own items, and marked or filed items are " "always kept. 0 disables this behaviour." msgstr "" -#: src/Module/Admin/Site.php:536 +#: src/Module/Admin/Site.php:541 msgid "Lifespan of unclaimed items" msgstr "" -#: src/Module/Admin/Site.php:536 +#: src/Module/Admin/Site.php:541 msgid "" "When the database cleanup is enabled, this defines the days after which " "unclaimed remote items (mostly content from the relay) will be deleted. " @@ -4798,144 +4803,144 @@ msgid "" "items if set to 0." msgstr "" -#: src/Module/Admin/Site.php:537 +#: src/Module/Admin/Site.php:542 msgid "Lifespan of raw conversation data" msgstr "" -#: src/Module/Admin/Site.php:537 +#: src/Module/Admin/Site.php:542 msgid "" "The conversation data is used for ActivityPub and OStatus, as well as for " "debug purposes. It should be safe to remove it after 14 days, default is 90 " "days." msgstr "" -#: src/Module/Admin/Site.php:538 +#: src/Module/Admin/Site.php:543 msgid "Maximum numbers of comments per post" msgstr "" -#: src/Module/Admin/Site.php:538 +#: src/Module/Admin/Site.php:543 msgid "How much comments should be shown for each post? Default value is 100." msgstr "" -#: src/Module/Admin/Site.php:539 +#: src/Module/Admin/Site.php:544 msgid "Maximum numbers of comments per post on the display page" msgstr "" -#: src/Module/Admin/Site.php:539 +#: src/Module/Admin/Site.php:544 msgid "" "How many comments should be shown on the single view for each post? Default " "value is 1000." msgstr "" -#: src/Module/Admin/Site.php:540 +#: src/Module/Admin/Site.php:545 msgid "Temp path" msgstr "" -#: src/Module/Admin/Site.php:540 +#: src/Module/Admin/Site.php:545 msgid "" "If you have a restricted system where the webserver can't access the system " "temp path, enter another path here." msgstr "" -#: src/Module/Admin/Site.php:541 +#: src/Module/Admin/Site.php:546 msgid "Only search in tags" msgstr "" -#: src/Module/Admin/Site.php:541 +#: src/Module/Admin/Site.php:546 msgid "On large systems the text search can slow down the system extremely." msgstr "" -#: src/Module/Admin/Site.php:542 +#: src/Module/Admin/Site.php:547 msgid "Generate counts per contact group when calculating network count" msgstr "" -#: src/Module/Admin/Site.php:542 +#: src/Module/Admin/Site.php:547 msgid "" "On systems with users that heavily use contact groups the query can be very " "expensive." msgstr "" -#: src/Module/Admin/Site.php:544 +#: src/Module/Admin/Site.php:549 msgid "Maximum number of parallel workers" msgstr "" -#: src/Module/Admin/Site.php:544 +#: src/Module/Admin/Site.php:549 #, php-format msgid "" "On shared hosters set this to %d. On larger systems, values of %d are great. " "Default value is %d." msgstr "" -#: src/Module/Admin/Site.php:545 +#: src/Module/Admin/Site.php:550 msgid "Enable fastlane" msgstr "" -#: src/Module/Admin/Site.php:545 +#: src/Module/Admin/Site.php:550 msgid "" "When enabed, the fastlane mechanism starts an additional worker if processes " "with higher priority are blocked by processes of lower priority." msgstr "" -#: src/Module/Admin/Site.php:547 +#: src/Module/Admin/Site.php:552 msgid "Direct relay transfer" msgstr "" -#: src/Module/Admin/Site.php:547 +#: src/Module/Admin/Site.php:552 msgid "" "Enables the direct transfer to other servers without using the relay servers" msgstr "" -#: src/Module/Admin/Site.php:548 +#: src/Module/Admin/Site.php:553 msgid "Relay scope" msgstr "" -#: src/Module/Admin/Site.php:548 +#: src/Module/Admin/Site.php:553 msgid "" "Can be \"all\" or \"tags\". \"all\" means that every public post should be " "received. \"tags\" means that only posts with selected tags should be " "received." msgstr "" -#: src/Module/Admin/Site.php:548 src/Module/Contact/Profile.php:274 +#: src/Module/Admin/Site.php:553 src/Module/Contact/Profile.php:274 #: src/Module/Settings/TwoFactor/Index.php:125 msgid "Disabled" msgstr "" -#: src/Module/Admin/Site.php:548 +#: src/Module/Admin/Site.php:553 msgid "all" msgstr "" -#: src/Module/Admin/Site.php:548 +#: src/Module/Admin/Site.php:553 msgid "tags" msgstr "" -#: src/Module/Admin/Site.php:549 +#: src/Module/Admin/Site.php:554 msgid "Server tags" msgstr "" -#: src/Module/Admin/Site.php:549 +#: src/Module/Admin/Site.php:554 msgid "Comma separated list of tags for the \"tags\" subscription." msgstr "" -#: src/Module/Admin/Site.php:550 +#: src/Module/Admin/Site.php:555 msgid "Deny Server tags" msgstr "" -#: src/Module/Admin/Site.php:550 +#: src/Module/Admin/Site.php:555 msgid "Comma separated list of tags that are rejected." msgstr "" -#: src/Module/Admin/Site.php:551 +#: src/Module/Admin/Site.php:556 msgid "Allow user tags" msgstr "" -#: src/Module/Admin/Site.php:551 +#: src/Module/Admin/Site.php:556 msgid "" "If enabled, the tags from the saved searches will used for the \"tags\" " "subscription in addition to the \"relay_server_tags\"." msgstr "" -#: src/Module/Admin/Site.php:554 +#: src/Module/Admin/Site.php:559 msgid "Start Relocation" msgstr "" From 9c383e20044b03e1590899e65509eb13dc22d414 Mon Sep 17 00:00:00 2001 From: Marek Bachmann Date: Wed, 30 Nov 2022 01:05:32 +0100 Subject: [PATCH 25/43] allow shorthands in the system.maximagesize --- mod/photos.php | 5 +++-- src/Module/Admin/Site.php | 13 ++++++++++--- view/templates/field_input.tpl | 2 +- view/theme/frio/css/mod_admin.css | 8 ++++++++ view/theme/frio/templates/field_input.tpl | 2 +- 5 files changed, 23 insertions(+), 7 deletions(-) diff --git a/mod/photos.php b/mod/photos.php index 4bca8275e3..d44afa588c 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -916,13 +916,14 @@ function photos_content(App $a) $maximagesize_Mbytes = 0; // Get the relevant size limits for uploads. Abbreviated var names: MaxImageSize -> mis; upload_max_filesize -> umf - $mis_bytes = DI::config()->get('system', 'maximagesize'); + $mis_bytes = Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize')); $umf_bytes = Strings::getBytesFromShorthand(ini_get('upload_max_filesize')); // When PHP is configured with upload_max_filesize less than maximagesize provide this lower limit. $maximagesize_Mbytes = (is_numeric($mis_bytes) && ($mis_bytes < $umf_bytes) ? $mis_bytes : $umf_bytes) / (1048576); - $usage_message = DI::l10n()->t('The maximum accepted image size is %.3g MB', $maximagesize_Mbytes); + // @todo We may be want to use appropriate binary prefixed dynamicly + $usage_message = DI::l10n()->t('The maximum accepted image size is %.6g MB', $maximagesize_Mbytes); $tpl = Renderer::getMarkupTemplate('photos_upload.tpl'); diff --git a/src/Module/Admin/Site.php b/src/Module/Admin/Site.php index a6931ce916..8aa43c5564 100644 --- a/src/Module/Admin/Site.php +++ b/src/Module/Admin/Site.php @@ -34,6 +34,7 @@ use Friendica\Model\User; use Friendica\Module\BaseAdmin; use Friendica\Module\Conversation\Community; use Friendica\Module\Register; +use Friendica\Navigation\SystemMessages; use Friendica\Protocol\Relay; use Friendica\Util\BasePath; use Friendica\Util\EMailer\MailBuilder; @@ -41,6 +42,8 @@ use Friendica\Util\Strings; class Site extends BaseAdmin { +// const SHORTHAND_REGEX = '/*/i'; + protected function post(array $request = []) { self::checkAdminAccess(); @@ -68,7 +71,7 @@ class Site extends BaseAdmin $language = (!empty($_POST['language']) ? trim($_POST['language']) : ''); $theme = (!empty($_POST['theme']) ? trim($_POST['theme']) : ''); $theme_mobile = (!empty($_POST['theme_mobile']) ? trim($_POST['theme_mobile']) : ''); - $maximagesize = (!empty($_POST['maximagesize']) ? intval(trim($_POST['maximagesize'])) : 0); + $maximagesize = (!empty($_POST['maximagesize']) ? trim($_POST['maximagesize']) : 0); $maximagelength = (!empty($_POST['maximagelength']) ? intval(trim($_POST['maximagelength'])) : -1); $jpegimagequality = (!empty($_POST['jpegimagequality']) ? intval(trim($_POST['jpegimagequality'])) : 100); @@ -240,7 +243,11 @@ class Site extends BaseAdmin } else { DI::config()->set('system', 'singleuser', $singleuser); } - DI::config()->set('system', 'maximagesize' , $maximagesize); + if (preg_match('/\d+(?:\s*[kmg])?/i', $maximagesize)) { + DI::config()->set('system', 'maximagesize', $maximagesize); + } else { + DI::sysmsg()->addNotice(DI::l10n()->t('%s is no valid input for maximum image size', $maximagesize)); + } DI::config()->set('system', 'max_image_length' , $maximagelength); DI::config()->set('system', 'jpeg_quality' , $jpegimagequality); @@ -471,7 +478,7 @@ class Site extends BaseAdmin '$maximagesize' => ['maximagesize', DI::l10n()->t('Maximum image size'), DI::config()->get('system', 'maximagesize'), DI::l10n()->t('Maximum size in bytes of uploaded images. Default is 0, which means no limits. The value of upload_max_filesize in your PHP.ini needs be set to at least the desired limit. Currently upload_max_filesize is set to %s (%sB)', Strings::getBytesFromShorthand(ini_get('upload_max_filesize')), ini_get('upload_max_filesize')), - '1 kB = 1 KiB = 1024 Bytes'], + '', '', '', '\d+(?:\s*[kmg])?'], '$maximagelength' => ['maximagelength', DI::l10n()->t('Maximum image length'), DI::config()->get('system', 'max_image_length'), DI::l10n()->t('Maximum length in pixels of the longest side of uploaded images. Default is -1, which means no limits.')], '$jpegimagequality' => ['jpegimagequality', DI::l10n()->t('JPEG image quality'), DI::config()->get('system', 'jpeg_quality'), DI::l10n()->t('Uploaded JPEGS will be saved at this quality setting [0-100]. Default is 100, which is full quality.')], diff --git a/view/templates/field_input.tpl b/view/templates/field_input.tpl index 3455891b9d..95a13cfb7b 100644 --- a/view/templates/field_input.tpl +++ b/view/templates/field_input.tpl @@ -1,7 +1,7 @@
- + {{if $field.3}} {{$field.3 nofilter}} {{/if}} diff --git a/view/theme/frio/css/mod_admin.css b/view/theme/frio/css/mod_admin.css index 3475d1d82a..355cfd1401 100644 --- a/view/theme/frio/css/mod_admin.css +++ b/view/theme/frio/css/mod_admin.css @@ -40,3 +40,11 @@ tr.details th { .adminpage td { word-break: break-all; } + +.adminpage input[id=id_maximagesize]:valid { + background-color: palegreen; +} + +.adminpage input[id=id_maximagesize]:invalid { + background-color: lightpink; +} \ No newline at end of file diff --git a/view/theme/frio/templates/field_input.tpl b/view/theme/frio/templates/field_input.tpl index 3a9e54d06a..9812e3466f 100644 --- a/view/theme/frio/templates/field_input.tpl +++ b/view/theme/frio/templates/field_input.tpl @@ -3,7 +3,7 @@ {{if !isset($label) || $label != false }} {{/if}} - + {{if $field.3}} {{$field.3 nofilter}} {{/if}} From d44968cd107fa331a6ef20296156d17683ac46c3 Mon Sep 17 00:00:00 2001 From: Marek Bachmann Date: Wed, 30 Nov 2022 01:05:32 +0100 Subject: [PATCH 26/43] split-off! Trends.php allow shorthands in the system.maximagesize --- src/Module/Api/Mastodon/Trends.php | 54 ++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 src/Module/Api/Mastodon/Trends.php diff --git a/src/Module/Api/Mastodon/Trends.php b/src/Module/Api/Mastodon/Trends.php new file mode 100644 index 0000000000..c42a27641b --- /dev/null +++ b/src/Module/Api/Mastodon/Trends.php @@ -0,0 +1,54 @@ +. + * + */ + +namespace Friendica\Module\Api\Mastodon; + +use Friendica\Core\System; +use Friendica\DI; +use Friendica\Model\Tag; +use Friendica\Module\BaseApi; + +/** + * @see https://docs.joinmastodon.org/methods/instance/trends/ + */ +class Trends extends BaseApi +{ + /** + * @throws \Friendica\Network\HTTPException\InternalServerErrorException + */ + protected function rawContent(array $request = []) + { + $request = $this->getRequest([ + 'limit' => 20, // Maximum number of results to return. Defaults to 10. + ], $request); + + $trending = []; + $tags = Tag::getGlobalTrendingHashtags(24, 20); + foreach ($tags as $tag) { + $tag['name'] = $tag['term']; + $history = [['day' => (string)time(), 'uses' => (string)$tag['score'], 'accounts' => (string)$tag['authors']]]; + $hashtag = new \Friendica\Object\Api\Mastodon\Tag(DI::baseUrl(), $tag, $history); + $trending[] = $hashtag->toArray(); + } + + System::jsonExit(array_slice($trending, 0, $request['limit'])); + } +} From c03784eaa90da6081e01cb7688964facdb2283a3 Mon Sep 17 00:00:00 2001 From: Marek Bachmann Date: Wed, 30 Nov 2022 01:15:42 +0100 Subject: [PATCH 27/43] wanted to use a constant for the shorthand regex to be used in the form input templates and to check maximagesize post value. But Input field seems to require the regex without enclosing "/.../", so remove const for now --- src/Module/Admin/Site.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Module/Admin/Site.php b/src/Module/Admin/Site.php index 8aa43c5564..9e6967d827 100644 --- a/src/Module/Admin/Site.php +++ b/src/Module/Admin/Site.php @@ -42,8 +42,6 @@ use Friendica\Util\Strings; class Site extends BaseAdmin { -// const SHORTHAND_REGEX = '/*/i'; - protected function post(array $request = []) { self::checkAdminAccess(); From 978fe26f4c494e6f954085d1a225a5aa485c61e9 Mon Sep 17 00:00:00 2001 From: Marek Bachmann Date: Wed, 30 Nov 2022 01:22:38 +0100 Subject: [PATCH 28/43] Added Strings::getBytesFromShorthand() for file size check at upload and new message.po --- mod/photos.php | 2 +- view/lang/C/messages.po | 511 ++++++++++++++++++++-------------------- 2 files changed, 259 insertions(+), 254 deletions(-) diff --git a/mod/photos.php b/mod/photos.php index d44afa588c..8671c39495 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -654,7 +654,7 @@ function photos_post(App $a) Logger::info('photos: upload: received file: ' . $filename . ' as ' . $src . ' ('. $type . ') ' . $filesize . ' bytes'); - $maximagesize = DI::config()->get('system', 'maximagesize'); + $maximagesize = Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize')); if ($maximagesize && ($filesize > $maximagesize)) { DI::sysmsg()->addNotice(DI::l10n()->t('Image exceeds size limit of %s', Strings::formatBytes($maximagesize))); diff --git a/view/lang/C/messages.po b/view/lang/C/messages.po index a3dac64757..6a330cad46 100644 --- a/view/lang/C/messages.po +++ b/view/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 2022.12-dev\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-28 01:21+0100\n" +"POT-Creation-Date: 2022-11-30 01:19+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -292,7 +292,7 @@ msgstr "" msgid "Insert web link" msgstr "" -#: mod/message.php:203 mod/message.php:360 mod/photos.php:1492 +#: mod/message.php:203 mod/message.php:360 mod/photos.php:1493 #: src/Content/Conversation.php:371 src/Content/Conversation.php:717 #: src/Module/Item/Compose.php:204 src/Module/Post/Edit.php:142 #: src/Module/Profile/UnkMail.php:155 src/Object/Post.php:537 @@ -300,8 +300,8 @@ msgid "Please wait" msgstr "" #: mod/message.php:204 mod/message.php:359 mod/photos.php:914 -#: mod/photos.php:1026 mod/photos.php:1298 mod/photos.php:1339 -#: mod/photos.php:1395 mod/photos.php:1469 +#: mod/photos.php:1027 mod/photos.php:1299 mod/photos.php:1340 +#: mod/photos.php:1396 mod/photos.php:1470 #: src/Module/Calendar/Event/Form.php:250 src/Module/Contact/Advanced.php:132 #: src/Module/Contact/Profile.php:327 #: src/Module/Debug/ActivityPubConversion.php:140 @@ -405,7 +405,7 @@ msgstr "" msgid "Recent Photos" msgstr "" -#: mod/photos.php:110 mod/photos.php:1074 src/Module/Profile/Photos.php:172 +#: mod/photos.php:110 mod/photos.php:1075 src/Module/Profile/Photos.php:172 #: src/Module/Profile/Photos.php:189 msgid "Upload New Photos" msgstr "" @@ -494,40 +494,40 @@ msgstr "" msgid "Access to this item is restricted." msgstr "" -#: mod/photos.php:925 -msgid "The maximum accepted image size is %.3g MB" +#: mod/photos.php:926 +msgid "The maximum accepted image size is %.6g MB" msgstr "" -#: mod/photos.php:932 +#: mod/photos.php:933 msgid "Upload Photos" msgstr "" -#: mod/photos.php:936 mod/photos.php:1022 +#: mod/photos.php:937 mod/photos.php:1023 msgid "New album name: " msgstr "" -#: mod/photos.php:937 +#: mod/photos.php:938 msgid "or select existing album:" msgstr "" -#: mod/photos.php:938 +#: mod/photos.php:939 msgid "Do not show a status post for this upload" msgstr "" -#: mod/photos.php:940 mod/photos.php:1294 src/Content/Conversation.php:373 +#: mod/photos.php:941 mod/photos.php:1295 src/Content/Conversation.php:373 #: src/Module/Calendar/Event/Form.php:253 src/Module/Post/Edit.php:179 msgid "Permissions" msgstr "" -#: mod/photos.php:1003 +#: mod/photos.php:1004 msgid "Do you really want to delete this photo album and all its photos?" msgstr "" -#: mod/photos.php:1004 mod/photos.php:1027 +#: mod/photos.php:1005 mod/photos.php:1028 msgid "Delete Album" msgstr "" -#: mod/photos.php:1005 mod/photos.php:1106 src/Content/Conversation.php:389 +#: mod/photos.php:1006 mod/photos.php:1107 src/Content/Conversation.php:389 #: src/Module/Contact/Follow.php:173 src/Module/Contact/Revoke.php:109 #: src/Module/Contact/Unfollow.php:126 #: src/Module/Media/Attachment/Browser.php:77 @@ -537,130 +537,130 @@ msgstr "" msgid "Cancel" msgstr "" -#: mod/photos.php:1031 +#: mod/photos.php:1032 msgid "Edit Album" msgstr "" -#: mod/photos.php:1032 +#: mod/photos.php:1033 msgid "Drop Album" msgstr "" -#: mod/photos.php:1036 +#: mod/photos.php:1037 msgid "Show Newest First" msgstr "" -#: mod/photos.php:1038 +#: mod/photos.php:1039 msgid "Show Oldest First" msgstr "" -#: mod/photos.php:1059 src/Module/Profile/Photos.php:140 +#: mod/photos.php:1060 src/Module/Profile/Photos.php:140 msgid "View Photo" msgstr "" -#: mod/photos.php:1092 +#: mod/photos.php:1093 msgid "Permission denied. Access to this item may be restricted." msgstr "" -#: mod/photos.php:1094 +#: mod/photos.php:1095 msgid "Photo not available" msgstr "" -#: mod/photos.php:1104 +#: mod/photos.php:1105 msgid "Do you really want to delete this photo?" msgstr "" -#: mod/photos.php:1105 mod/photos.php:1299 +#: mod/photos.php:1106 mod/photos.php:1300 msgid "Delete Photo" msgstr "" -#: mod/photos.php:1197 +#: mod/photos.php:1198 msgid "View photo" msgstr "" -#: mod/photos.php:1199 +#: mod/photos.php:1200 msgid "Edit photo" msgstr "" -#: mod/photos.php:1200 +#: mod/photos.php:1201 msgid "Delete photo" msgstr "" -#: mod/photos.php:1201 +#: mod/photos.php:1202 msgid "Use as profile photo" msgstr "" -#: mod/photos.php:1208 +#: mod/photos.php:1209 msgid "Private Photo" msgstr "" -#: mod/photos.php:1214 +#: mod/photos.php:1215 msgid "View Full Size" msgstr "" -#: mod/photos.php:1267 +#: mod/photos.php:1268 msgid "Tags: " msgstr "" -#: mod/photos.php:1270 +#: mod/photos.php:1271 msgid "[Select tags to remove]" msgstr "" -#: mod/photos.php:1285 +#: mod/photos.php:1286 msgid "New album name" msgstr "" -#: mod/photos.php:1286 +#: mod/photos.php:1287 msgid "Caption" msgstr "" -#: mod/photos.php:1287 +#: mod/photos.php:1288 msgid "Add a Tag" msgstr "" -#: mod/photos.php:1287 +#: mod/photos.php:1288 msgid "Example: @bob, @Barbara_Jensen, @jim@example.com, #California, #camping" msgstr "" -#: mod/photos.php:1288 +#: mod/photos.php:1289 msgid "Do not rotate" msgstr "" -#: mod/photos.php:1289 +#: mod/photos.php:1290 msgid "Rotate CW (right)" msgstr "" -#: mod/photos.php:1290 +#: mod/photos.php:1291 msgid "Rotate CCW (left)" msgstr "" -#: mod/photos.php:1336 mod/photos.php:1392 mod/photos.php:1466 +#: mod/photos.php:1337 mod/photos.php:1393 mod/photos.php:1467 #: src/Module/Contact.php:547 src/Module/Item/Compose.php:188 #: src/Object/Post.php:983 msgid "This is you" msgstr "" -#: mod/photos.php:1338 mod/photos.php:1394 mod/photos.php:1468 +#: mod/photos.php:1339 mod/photos.php:1395 mod/photos.php:1469 #: src/Object/Post.php:531 src/Object/Post.php:985 msgid "Comment" msgstr "" -#: mod/photos.php:1340 mod/photos.php:1396 mod/photos.php:1470 +#: mod/photos.php:1341 mod/photos.php:1397 mod/photos.php:1471 #: src/Content/Conversation.php:386 src/Module/Calendar/Event/Form.php:248 #: src/Module/Item/Compose.php:199 src/Module/Post/Edit.php:162 #: src/Object/Post.php:997 msgid "Preview" msgstr "" -#: mod/photos.php:1341 src/Content/Conversation.php:341 +#: mod/photos.php:1342 src/Content/Conversation.php:341 #: src/Module/Post/Edit.php:127 src/Object/Post.php:987 msgid "Loading..." msgstr "" -#: mod/photos.php:1427 src/Content/Conversation.php:633 src/Object/Post.php:255 +#: mod/photos.php:1428 src/Content/Conversation.php:633 src/Object/Post.php:255 msgid "Select" msgstr "" -#: mod/photos.php:1428 src/Content/Conversation.php:634 +#: mod/photos.php:1429 src/Content/Conversation.php:634 #: src/Module/Moderation/Users/Active.php:136 #: src/Module/Moderation/Users/Blocked.php:136 #: src/Module/Moderation/Users/Index.php:151 @@ -668,23 +668,23 @@ msgstr "" msgid "Delete" msgstr "" -#: mod/photos.php:1489 src/Object/Post.php:378 +#: mod/photos.php:1490 src/Object/Post.php:378 msgid "Like" msgstr "" -#: mod/photos.php:1490 src/Object/Post.php:378 +#: mod/photos.php:1491 src/Object/Post.php:378 msgid "I like this (toggle)" msgstr "" -#: mod/photos.php:1491 src/Object/Post.php:379 +#: mod/photos.php:1492 src/Object/Post.php:379 msgid "Dislike" msgstr "" -#: mod/photos.php:1493 src/Object/Post.php:379 +#: mod/photos.php:1494 src/Object/Post.php:379 msgid "I don't like this (toggle)" msgstr "" -#: mod/photos.php:1515 +#: mod/photos.php:1516 msgid "Map" msgstr "" @@ -710,16 +710,16 @@ msgstr "" msgid "toggle mobile" msgstr "" -#: src/App/Router.php:310 +#: src/App/Router.php:309 #, php-format msgid "Method not allowed for this module. Allowed method(s): %s" msgstr "" -#: src/App/Router.php:312 src/Module/HTTPException/PageNotFound.php:49 +#: src/App/Router.php:311 src/Module/HTTPException/PageNotFound.php:49 msgid "Page not found." msgstr "" -#: src/App/Router.php:338 +#: src/App/Router.php:323 msgid "You must be logged in to use addons. " msgstr "" @@ -3607,7 +3607,7 @@ msgstr "" #: src/Module/Admin/Addons/Details.php:111 src/Module/Admin/Addons/Index.php:67 #: src/Module/Admin/Federation.php:202 src/Module/Admin/Logs/Settings.php:79 #: src/Module/Admin/Logs/View.php:84 src/Module/Admin/Queue.php:72 -#: src/Module/Admin/Site.php:432 src/Module/Admin/Storage.php:138 +#: src/Module/Admin/Site.php:437 src/Module/Admin/Storage.php:138 #: src/Module/Admin/Summary.php:216 src/Module/Admin/Themes/Details.php:90 #: src/Module/Admin/Themes/Index.php:111 src/Module/Admin/Tos.php:75 #: src/Module/Moderation/Users/Create.php:61 @@ -3645,7 +3645,7 @@ msgid "Addon %s failed to install." msgstr "" #: src/Module/Admin/Addons/Index.php:69 src/Module/Admin/Features.php:87 -#: src/Module/Admin/Logs/Settings.php:81 src/Module/Admin/Site.php:435 +#: src/Module/Admin/Logs/Settings.php:81 src/Module/Admin/Site.php:440 #: src/Module/Admin/Themes/Index.php:113 src/Module/Admin/Tos.php:83 #: src/Module/Settings/Account.php:560 src/Module/Settings/Addons.php:81 #: src/Module/Settings/Connectors.php:159 @@ -3997,284 +3997,289 @@ msgstr "" msgid "Priority" msgstr "" -#: src/Module/Admin/Site.php:337 src/Module/Settings/Display.php:137 +#: src/Module/Admin/Site.php:247 +#, php-format +msgid "%s is no valid input for maximum image size" +msgstr "" + +#: src/Module/Admin/Site.php:342 src/Module/Settings/Display.php:137 msgid "No special theme for mobile devices" msgstr "" -#: src/Module/Admin/Site.php:354 src/Module/Settings/Display.php:147 +#: src/Module/Admin/Site.php:359 src/Module/Settings/Display.php:147 #, php-format msgid "%s - (Experimental)" msgstr "" -#: src/Module/Admin/Site.php:366 +#: src/Module/Admin/Site.php:371 msgid "No community page" msgstr "" -#: src/Module/Admin/Site.php:367 +#: src/Module/Admin/Site.php:372 msgid "No community page for visitors" msgstr "" -#: src/Module/Admin/Site.php:368 +#: src/Module/Admin/Site.php:373 msgid "Public postings from users of this site" msgstr "" -#: src/Module/Admin/Site.php:369 +#: src/Module/Admin/Site.php:374 msgid "Public postings from the federated network" msgstr "" -#: src/Module/Admin/Site.php:370 +#: src/Module/Admin/Site.php:375 msgid "Public postings from local users and the federated network" msgstr "" -#: src/Module/Admin/Site.php:376 +#: src/Module/Admin/Site.php:381 msgid "Multi user instance" msgstr "" -#: src/Module/Admin/Site.php:403 +#: src/Module/Admin/Site.php:408 msgid "Closed" msgstr "" -#: src/Module/Admin/Site.php:404 +#: src/Module/Admin/Site.php:409 msgid "Requires approval" msgstr "" -#: src/Module/Admin/Site.php:405 +#: src/Module/Admin/Site.php:410 msgid "Open" msgstr "" -#: src/Module/Admin/Site.php:409 src/Module/Install.php:222 +#: src/Module/Admin/Site.php:414 src/Module/Install.php:222 msgid "No SSL policy, links will track page SSL state" msgstr "" -#: src/Module/Admin/Site.php:410 src/Module/Install.php:223 +#: src/Module/Admin/Site.php:415 src/Module/Install.php:223 msgid "Force all links to use SSL" msgstr "" -#: src/Module/Admin/Site.php:411 src/Module/Install.php:224 +#: src/Module/Admin/Site.php:416 src/Module/Install.php:224 msgid "Self-signed certificate, use SSL for local links only (discouraged)" msgstr "" -#: src/Module/Admin/Site.php:415 +#: src/Module/Admin/Site.php:420 msgid "Don't check" msgstr "" -#: src/Module/Admin/Site.php:416 +#: src/Module/Admin/Site.php:421 msgid "check the stable version" msgstr "" -#: src/Module/Admin/Site.php:417 +#: src/Module/Admin/Site.php:422 msgid "check the development version" msgstr "" -#: src/Module/Admin/Site.php:421 +#: src/Module/Admin/Site.php:426 msgid "none" msgstr "" -#: src/Module/Admin/Site.php:422 +#: src/Module/Admin/Site.php:427 msgid "Local contacts" msgstr "" -#: src/Module/Admin/Site.php:423 +#: src/Module/Admin/Site.php:428 msgid "Interactors" msgstr "" -#: src/Module/Admin/Site.php:433 src/Module/BaseAdmin.php:90 +#: src/Module/Admin/Site.php:438 src/Module/BaseAdmin.php:90 msgid "Site" msgstr "" -#: src/Module/Admin/Site.php:434 +#: src/Module/Admin/Site.php:439 msgid "General Information" msgstr "" -#: src/Module/Admin/Site.php:436 +#: src/Module/Admin/Site.php:441 msgid "Republish users to directory" msgstr "" -#: src/Module/Admin/Site.php:437 src/Module/Register.php:152 +#: src/Module/Admin/Site.php:442 src/Module/Register.php:152 msgid "Registration" msgstr "" -#: src/Module/Admin/Site.php:438 +#: src/Module/Admin/Site.php:443 msgid "File upload" msgstr "" -#: src/Module/Admin/Site.php:439 +#: src/Module/Admin/Site.php:444 msgid "Policies" msgstr "" -#: src/Module/Admin/Site.php:440 src/Module/Calendar/Event/Form.php:252 +#: src/Module/Admin/Site.php:445 src/Module/Calendar/Event/Form.php:252 #: src/Module/Contact.php:477 src/Module/Profile/Profile.php:248 msgid "Advanced" msgstr "" -#: src/Module/Admin/Site.php:441 +#: src/Module/Admin/Site.php:446 msgid "Auto Discovered Contact Directory" msgstr "" -#: src/Module/Admin/Site.php:442 +#: src/Module/Admin/Site.php:447 msgid "Performance" msgstr "" -#: src/Module/Admin/Site.php:443 +#: src/Module/Admin/Site.php:448 msgid "Worker" msgstr "" -#: src/Module/Admin/Site.php:444 +#: src/Module/Admin/Site.php:449 msgid "Message Relay" msgstr "" -#: src/Module/Admin/Site.php:445 +#: src/Module/Admin/Site.php:450 msgid "" "Use the command \"console relay\" in the command line to add or remove " "relays." msgstr "" -#: src/Module/Admin/Site.php:446 +#: src/Module/Admin/Site.php:451 msgid "The system is not subscribed to any relays at the moment." msgstr "" -#: src/Module/Admin/Site.php:447 +#: src/Module/Admin/Site.php:452 msgid "The system is currently subscribed to the following relays:" msgstr "" -#: src/Module/Admin/Site.php:449 +#: src/Module/Admin/Site.php:454 msgid "Relocate Node" msgstr "" -#: src/Module/Admin/Site.php:450 +#: src/Module/Admin/Site.php:455 msgid "" "Relocating your node enables you to change the DNS domain of this node and " "keep all the existing users and posts. This process takes a while and can " "only be started from the relocate console command like this:" msgstr "" -#: src/Module/Admin/Site.php:451 +#: src/Module/Admin/Site.php:456 msgid "(Friendica directory)# bin/console relocate https://newdomain.com" msgstr "" -#: src/Module/Admin/Site.php:455 +#: src/Module/Admin/Site.php:460 msgid "Site name" msgstr "" -#: src/Module/Admin/Site.php:456 +#: src/Module/Admin/Site.php:461 msgid "Sender Email" msgstr "" -#: src/Module/Admin/Site.php:456 +#: src/Module/Admin/Site.php:461 msgid "" "The email address your server shall use to send notification emails from." msgstr "" -#: src/Module/Admin/Site.php:457 +#: src/Module/Admin/Site.php:462 msgid "Name of the system actor" msgstr "" -#: src/Module/Admin/Site.php:457 +#: src/Module/Admin/Site.php:462 msgid "" "Name of the internal system account that is used to perform ActivityPub " "requests. This must be an unused username. If set, this can't be changed " "again." msgstr "" -#: src/Module/Admin/Site.php:458 +#: src/Module/Admin/Site.php:463 msgid "Banner/Logo" msgstr "" -#: src/Module/Admin/Site.php:459 +#: src/Module/Admin/Site.php:464 msgid "Email Banner/Logo" msgstr "" -#: src/Module/Admin/Site.php:460 +#: src/Module/Admin/Site.php:465 msgid "Shortcut icon" msgstr "" -#: src/Module/Admin/Site.php:460 +#: src/Module/Admin/Site.php:465 msgid "Link to an icon that will be used for browsers." msgstr "" -#: src/Module/Admin/Site.php:461 +#: src/Module/Admin/Site.php:466 msgid "Touch icon" msgstr "" -#: src/Module/Admin/Site.php:461 +#: src/Module/Admin/Site.php:466 msgid "Link to an icon that will be used for tablets and mobiles." msgstr "" -#: src/Module/Admin/Site.php:462 +#: src/Module/Admin/Site.php:467 msgid "Additional Info" msgstr "" -#: src/Module/Admin/Site.php:462 +#: src/Module/Admin/Site.php:467 #, php-format msgid "" "For public servers: you can add additional information here that will be " "listed at %s/servers." msgstr "" -#: src/Module/Admin/Site.php:463 +#: src/Module/Admin/Site.php:468 msgid "System language" msgstr "" -#: src/Module/Admin/Site.php:464 +#: src/Module/Admin/Site.php:469 msgid "System theme" msgstr "" -#: src/Module/Admin/Site.php:464 +#: src/Module/Admin/Site.php:469 #, php-format msgid "" "Default system theme - may be over-ridden by user profiles - Change default theme settings" msgstr "" -#: src/Module/Admin/Site.php:465 +#: src/Module/Admin/Site.php:470 msgid "Mobile system theme" msgstr "" -#: src/Module/Admin/Site.php:465 +#: src/Module/Admin/Site.php:470 msgid "Theme for mobile devices" msgstr "" -#: src/Module/Admin/Site.php:466 src/Module/Install.php:232 +#: src/Module/Admin/Site.php:471 src/Module/Install.php:232 msgid "SSL link policy" msgstr "" -#: src/Module/Admin/Site.php:466 src/Module/Install.php:234 +#: src/Module/Admin/Site.php:471 src/Module/Install.php:234 msgid "Determines whether generated links should be forced to use SSL" msgstr "" -#: src/Module/Admin/Site.php:467 +#: src/Module/Admin/Site.php:472 msgid "Force SSL" msgstr "" -#: src/Module/Admin/Site.php:467 +#: src/Module/Admin/Site.php:472 msgid "" "Force all Non-SSL requests to SSL - Attention: on some systems it could lead " "to endless loops." msgstr "" -#: src/Module/Admin/Site.php:468 +#: src/Module/Admin/Site.php:473 msgid "Show help entry from navigation menu" msgstr "" -#: src/Module/Admin/Site.php:468 +#: src/Module/Admin/Site.php:473 msgid "" "Displays the menu entry for the Help pages from the navigation menu. It is " "always accessible by calling /help directly." msgstr "" -#: src/Module/Admin/Site.php:469 +#: src/Module/Admin/Site.php:474 msgid "Single user instance" msgstr "" -#: src/Module/Admin/Site.php:469 +#: src/Module/Admin/Site.php:474 msgid "Make this instance multi-user or single-user for the named user" msgstr "" -#: src/Module/Admin/Site.php:471 +#: src/Module/Admin/Site.php:476 msgid "Maximum image size" msgstr "" -#: src/Module/Admin/Site.php:471 +#: src/Module/Admin/Site.php:476 #, php-format msgid "" "Maximum size in bytes of uploaded images. Default is 0, which means no " @@ -4285,192 +4290,192 @@ msgid "" "to %s (%sB)" msgstr "" -#: src/Module/Admin/Site.php:475 +#: src/Module/Admin/Site.php:480 msgid "Maximum image length" msgstr "" -#: src/Module/Admin/Site.php:475 +#: src/Module/Admin/Site.php:480 msgid "" "Maximum length in pixels of the longest side of uploaded images. Default is " "-1, which means no limits." msgstr "" -#: src/Module/Admin/Site.php:476 +#: src/Module/Admin/Site.php:481 msgid "JPEG image quality" msgstr "" -#: src/Module/Admin/Site.php:476 +#: src/Module/Admin/Site.php:481 msgid "" "Uploaded JPEGS will be saved at this quality setting [0-100]. Default is " "100, which is full quality." msgstr "" -#: src/Module/Admin/Site.php:478 +#: src/Module/Admin/Site.php:483 msgid "Register policy" msgstr "" -#: src/Module/Admin/Site.php:479 +#: src/Module/Admin/Site.php:484 msgid "Maximum Daily Registrations" msgstr "" -#: src/Module/Admin/Site.php:479 +#: src/Module/Admin/Site.php:484 msgid "" "If registration is permitted above, this sets the maximum number of new user " "registrations to accept per day. If register is set to closed, this setting " "has no effect." msgstr "" -#: src/Module/Admin/Site.php:480 +#: src/Module/Admin/Site.php:485 msgid "Register text" msgstr "" -#: src/Module/Admin/Site.php:480 +#: src/Module/Admin/Site.php:485 msgid "" "Will be displayed prominently on the registration page. You can use BBCode " "here." msgstr "" -#: src/Module/Admin/Site.php:481 +#: src/Module/Admin/Site.php:486 msgid "Forbidden Nicknames" msgstr "" -#: src/Module/Admin/Site.php:481 +#: src/Module/Admin/Site.php:486 msgid "" "Comma separated list of nicknames that are forbidden from registration. " "Preset is a list of role names according RFC 2142." msgstr "" -#: src/Module/Admin/Site.php:482 +#: src/Module/Admin/Site.php:487 msgid "Accounts abandoned after x days" msgstr "" -#: src/Module/Admin/Site.php:482 +#: src/Module/Admin/Site.php:487 msgid "" "Will not waste system resources polling external sites for abandonded " "accounts. Enter 0 for no time limit." msgstr "" -#: src/Module/Admin/Site.php:483 +#: src/Module/Admin/Site.php:488 msgid "Allowed friend domains" msgstr "" -#: src/Module/Admin/Site.php:483 +#: src/Module/Admin/Site.php:488 msgid "" "Comma separated list of domains which are allowed to establish friendships " "with this site. Wildcards are accepted. Empty to allow any domains" msgstr "" -#: src/Module/Admin/Site.php:484 +#: src/Module/Admin/Site.php:489 msgid "Allowed email domains" msgstr "" -#: src/Module/Admin/Site.php:484 +#: src/Module/Admin/Site.php:489 msgid "" "Comma separated list of domains which are allowed in email addresses for " "registrations to this site. Wildcards are accepted. Empty to allow any " "domains" msgstr "" -#: src/Module/Admin/Site.php:485 +#: src/Module/Admin/Site.php:490 msgid "No OEmbed rich content" msgstr "" -#: src/Module/Admin/Site.php:485 +#: src/Module/Admin/Site.php:490 msgid "" "Don't show the rich content (e.g. embedded PDF), except from the domains " "listed below." msgstr "" -#: src/Module/Admin/Site.php:486 +#: src/Module/Admin/Site.php:491 msgid "Trusted third-party domains" msgstr "" -#: src/Module/Admin/Site.php:486 +#: src/Module/Admin/Site.php:491 msgid "" "Comma separated list of domains from which content is allowed to be embedded " "in posts like with OEmbed. All sub-domains of the listed domains are allowed " "as well." msgstr "" -#: src/Module/Admin/Site.php:487 +#: src/Module/Admin/Site.php:492 msgid "Block public" msgstr "" -#: src/Module/Admin/Site.php:487 +#: src/Module/Admin/Site.php:492 msgid "" "Check to block public access to all otherwise public personal pages on this " "site unless you are currently logged in." msgstr "" -#: src/Module/Admin/Site.php:488 +#: src/Module/Admin/Site.php:493 msgid "Force publish" msgstr "" -#: src/Module/Admin/Site.php:488 +#: src/Module/Admin/Site.php:493 msgid "" "Check to force all profiles on this site to be listed in the site directory." msgstr "" -#: src/Module/Admin/Site.php:488 +#: src/Module/Admin/Site.php:493 msgid "Enabling this may violate privacy laws like the GDPR" msgstr "" -#: src/Module/Admin/Site.php:489 +#: src/Module/Admin/Site.php:494 msgid "Global directory URL" msgstr "" -#: src/Module/Admin/Site.php:489 +#: src/Module/Admin/Site.php:494 msgid "" "URL to the global directory. If this is not set, the global directory is " "completely unavailable to the application." msgstr "" -#: src/Module/Admin/Site.php:490 +#: src/Module/Admin/Site.php:495 msgid "Private posts by default for new users" msgstr "" -#: src/Module/Admin/Site.php:490 +#: src/Module/Admin/Site.php:495 msgid "" "Set default post permissions for all new members to the default privacy " "group rather than public." msgstr "" -#: src/Module/Admin/Site.php:491 +#: src/Module/Admin/Site.php:496 msgid "Don't include post content in email notifications" msgstr "" -#: src/Module/Admin/Site.php:491 +#: src/Module/Admin/Site.php:496 msgid "" "Don't include the content of a post/comment/private message/etc. in the " "email notifications that are sent out from this site, as a privacy measure." msgstr "" -#: src/Module/Admin/Site.php:492 +#: src/Module/Admin/Site.php:497 msgid "Disallow public access to addons listed in the apps menu." msgstr "" -#: src/Module/Admin/Site.php:492 +#: src/Module/Admin/Site.php:497 msgid "" "Checking this box will restrict addons listed in the apps menu to members " "only." msgstr "" -#: src/Module/Admin/Site.php:493 +#: src/Module/Admin/Site.php:498 msgid "Don't embed private images in posts" msgstr "" -#: src/Module/Admin/Site.php:493 +#: src/Module/Admin/Site.php:498 msgid "" "Don't replace locally-hosted private photos in posts with an embedded copy " "of the image. This means that contacts who receive posts containing private " "photos will have to authenticate and load each image, which may take a while." msgstr "" -#: src/Module/Admin/Site.php:494 +#: src/Module/Admin/Site.php:499 msgid "Explicit Content" msgstr "" -#: src/Module/Admin/Site.php:494 +#: src/Module/Admin/Site.php:499 msgid "" "Set this to announce that your node is used mostly for explicit content that " "might not be suited for minors. This information will be published in the " @@ -4479,267 +4484,267 @@ msgid "" "will be shown at the user registration page." msgstr "" -#: src/Module/Admin/Site.php:495 +#: src/Module/Admin/Site.php:500 msgid "Proxify external content" msgstr "" -#: src/Module/Admin/Site.php:495 +#: src/Module/Admin/Site.php:500 msgid "" "Route external content via the proxy functionality. This is used for example " "for some OEmbed accesses and in some other rare cases." msgstr "" -#: src/Module/Admin/Site.php:496 +#: src/Module/Admin/Site.php:501 msgid "Cache contact avatars" msgstr "" -#: src/Module/Admin/Site.php:496 +#: src/Module/Admin/Site.php:501 msgid "" "Locally store the avatar pictures of the contacts. This uses a lot of " "storage space but it increases the performance." msgstr "" -#: src/Module/Admin/Site.php:497 +#: src/Module/Admin/Site.php:502 msgid "Allow Users to set remote_self" msgstr "" -#: src/Module/Admin/Site.php:497 +#: src/Module/Admin/Site.php:502 msgid "" "With checking this, every user is allowed to mark every contact as a " "remote_self in the repair contact dialog. Setting this flag on a contact " "causes mirroring every posting of that contact in the users stream." msgstr "" -#: src/Module/Admin/Site.php:498 +#: src/Module/Admin/Site.php:503 msgid "Enable multiple registrations" msgstr "" -#: src/Module/Admin/Site.php:498 +#: src/Module/Admin/Site.php:503 msgid "Enable users to register additional accounts for use as pages." msgstr "" -#: src/Module/Admin/Site.php:499 +#: src/Module/Admin/Site.php:504 msgid "Enable OpenID" msgstr "" -#: src/Module/Admin/Site.php:499 +#: src/Module/Admin/Site.php:504 msgid "Enable OpenID support for registration and logins." msgstr "" -#: src/Module/Admin/Site.php:500 +#: src/Module/Admin/Site.php:505 msgid "Enable Fullname check" msgstr "" -#: src/Module/Admin/Site.php:500 +#: src/Module/Admin/Site.php:505 msgid "" "Enable check to only allow users to register with a space between the first " "name and the last name in their full name." msgstr "" -#: src/Module/Admin/Site.php:501 +#: src/Module/Admin/Site.php:506 msgid "Email administrators on new registration" msgstr "" -#: src/Module/Admin/Site.php:501 +#: src/Module/Admin/Site.php:506 msgid "" "If enabled and the system is set to an open registration, an email for each " "new registration is sent to the administrators." msgstr "" -#: src/Module/Admin/Site.php:502 +#: src/Module/Admin/Site.php:507 msgid "Community pages for visitors" msgstr "" -#: src/Module/Admin/Site.php:502 +#: src/Module/Admin/Site.php:507 msgid "" "Which community pages should be available for visitors. Local users always " "see both pages." msgstr "" -#: src/Module/Admin/Site.php:503 +#: src/Module/Admin/Site.php:508 msgid "Posts per user on community page" msgstr "" -#: src/Module/Admin/Site.php:503 +#: src/Module/Admin/Site.php:508 msgid "" "The maximum number of posts per user on the community page. (Not valid for " "\"Global Community\")" msgstr "" -#: src/Module/Admin/Site.php:505 +#: src/Module/Admin/Site.php:510 msgid "Enable Mail support" msgstr "" -#: src/Module/Admin/Site.php:505 +#: src/Module/Admin/Site.php:510 msgid "" "Enable built-in mail support to poll IMAP folders and to reply via mail." msgstr "" -#: src/Module/Admin/Site.php:506 +#: src/Module/Admin/Site.php:511 msgid "" "Mail support can't be enabled because the PHP IMAP module is not installed." msgstr "" -#: src/Module/Admin/Site.php:507 +#: src/Module/Admin/Site.php:512 msgid "Enable OStatus support" msgstr "" -#: src/Module/Admin/Site.php:507 +#: src/Module/Admin/Site.php:512 msgid "" "Enable built-in OStatus (StatusNet, GNU Social etc.) compatibility. All " "communications in OStatus are public." msgstr "" -#: src/Module/Admin/Site.php:509 +#: src/Module/Admin/Site.php:514 msgid "" "Diaspora support can't be enabled because Friendica was installed into a sub " "directory." msgstr "" -#: src/Module/Admin/Site.php:510 +#: src/Module/Admin/Site.php:515 msgid "Enable Diaspora support" msgstr "" -#: src/Module/Admin/Site.php:510 +#: src/Module/Admin/Site.php:515 msgid "" "Enable built-in Diaspora network compatibility for communicating with " "diaspora servers." msgstr "" -#: src/Module/Admin/Site.php:511 +#: src/Module/Admin/Site.php:516 msgid "Verify SSL" msgstr "" -#: src/Module/Admin/Site.php:511 +#: src/Module/Admin/Site.php:516 msgid "" "If you wish, you can turn on strict certificate checking. This will mean you " "cannot connect (at all) to self-signed SSL sites." msgstr "" -#: src/Module/Admin/Site.php:512 +#: src/Module/Admin/Site.php:517 msgid "Proxy user" msgstr "" -#: src/Module/Admin/Site.php:512 +#: src/Module/Admin/Site.php:517 msgid "User name for the proxy server." msgstr "" -#: src/Module/Admin/Site.php:513 +#: src/Module/Admin/Site.php:518 msgid "Proxy URL" msgstr "" -#: src/Module/Admin/Site.php:513 +#: src/Module/Admin/Site.php:518 msgid "" "If you want to use a proxy server that Friendica should use to connect to " "the network, put the URL of the proxy here." msgstr "" -#: src/Module/Admin/Site.php:514 +#: src/Module/Admin/Site.php:519 msgid "Network timeout" msgstr "" -#: src/Module/Admin/Site.php:514 +#: src/Module/Admin/Site.php:519 msgid "Value is in seconds. Set to 0 for unlimited (not recommended)." msgstr "" -#: src/Module/Admin/Site.php:515 +#: src/Module/Admin/Site.php:520 msgid "Maximum Load Average" msgstr "" -#: src/Module/Admin/Site.php:515 +#: src/Module/Admin/Site.php:520 #, php-format msgid "" "Maximum system load before delivery and poll processes are deferred - " "default %d." msgstr "" -#: src/Module/Admin/Site.php:516 +#: src/Module/Admin/Site.php:521 msgid "Minimal Memory" msgstr "" -#: src/Module/Admin/Site.php:516 +#: src/Module/Admin/Site.php:521 msgid "" "Minimal free memory in MB for the worker. Needs access to /proc/meminfo - " "default 0 (deactivated)." msgstr "" -#: src/Module/Admin/Site.php:517 +#: src/Module/Admin/Site.php:522 msgid "Periodically optimize tables" msgstr "" -#: src/Module/Admin/Site.php:517 +#: src/Module/Admin/Site.php:522 msgid "Periodically optimize tables like the cache and the workerqueue" msgstr "" -#: src/Module/Admin/Site.php:519 +#: src/Module/Admin/Site.php:524 msgid "Discover followers/followings from contacts" msgstr "" -#: src/Module/Admin/Site.php:519 +#: src/Module/Admin/Site.php:524 msgid "" "If enabled, contacts are checked for their followers and following contacts." msgstr "" -#: src/Module/Admin/Site.php:520 +#: src/Module/Admin/Site.php:525 msgid "None - deactivated" msgstr "" -#: src/Module/Admin/Site.php:521 +#: src/Module/Admin/Site.php:526 msgid "" "Local contacts - contacts of our local contacts are discovered for their " "followers/followings." msgstr "" -#: src/Module/Admin/Site.php:522 +#: src/Module/Admin/Site.php:527 msgid "" "Interactors - contacts of our local contacts and contacts who interacted on " "locally visible postings are discovered for their followers/followings." msgstr "" -#: src/Module/Admin/Site.php:524 +#: src/Module/Admin/Site.php:529 msgid "Synchronize the contacts with the directory server" msgstr "" -#: src/Module/Admin/Site.php:524 +#: src/Module/Admin/Site.php:529 msgid "" "if enabled, the system will check periodically for new contacts on the " "defined directory server." msgstr "" -#: src/Module/Admin/Site.php:526 +#: src/Module/Admin/Site.php:531 msgid "Days between requery" msgstr "" -#: src/Module/Admin/Site.php:526 +#: src/Module/Admin/Site.php:531 msgid "Number of days after which a server is requeried for his contacts." msgstr "" -#: src/Module/Admin/Site.php:527 +#: src/Module/Admin/Site.php:532 msgid "Discover contacts from other servers" msgstr "" -#: src/Module/Admin/Site.php:527 +#: src/Module/Admin/Site.php:532 msgid "" "Periodically query other servers for contacts. The system queries Friendica, " "Mastodon and Hubzilla servers." msgstr "" -#: src/Module/Admin/Site.php:528 +#: src/Module/Admin/Site.php:533 msgid "Search the local directory" msgstr "" -#: src/Module/Admin/Site.php:528 +#: src/Module/Admin/Site.php:533 msgid "" "Search the local directory instead of the global directory. When searching " "locally, every search will be executed on the global directory in the " "background. This improves the search results when the search is repeated." msgstr "" -#: src/Module/Admin/Site.php:530 +#: src/Module/Admin/Site.php:535 msgid "Publish server information" msgstr "" -#: src/Module/Admin/Site.php:530 +#: src/Module/Admin/Site.php:535 msgid "" "If enabled, general server and usage data will be published. The data " "contains the name and version of the server, number of users with public " @@ -4747,50 +4752,50 @@ msgid "" "href=\"http://the-federation.info/\">the-federation.info for details." msgstr "" -#: src/Module/Admin/Site.php:532 +#: src/Module/Admin/Site.php:537 msgid "Check upstream version" msgstr "" -#: src/Module/Admin/Site.php:532 +#: src/Module/Admin/Site.php:537 msgid "" "Enables checking for new Friendica versions at github. If there is a new " "version, you will be informed in the admin panel overview." msgstr "" -#: src/Module/Admin/Site.php:533 +#: src/Module/Admin/Site.php:538 msgid "Suppress Tags" msgstr "" -#: src/Module/Admin/Site.php:533 +#: src/Module/Admin/Site.php:538 msgid "Suppress showing a list of hashtags at the end of the posting." msgstr "" -#: src/Module/Admin/Site.php:534 +#: src/Module/Admin/Site.php:539 msgid "Clean database" msgstr "" -#: src/Module/Admin/Site.php:534 +#: src/Module/Admin/Site.php:539 msgid "" "Remove old remote items, orphaned database records and old content from some " "other helper tables." msgstr "" -#: src/Module/Admin/Site.php:535 +#: src/Module/Admin/Site.php:540 msgid "Lifespan of remote items" msgstr "" -#: src/Module/Admin/Site.php:535 +#: src/Module/Admin/Site.php:540 msgid "" "When the database cleanup is enabled, this defines the days after which " "remote items will be deleted. Own items, and marked or filed items are " "always kept. 0 disables this behaviour." msgstr "" -#: src/Module/Admin/Site.php:536 +#: src/Module/Admin/Site.php:541 msgid "Lifespan of unclaimed items" msgstr "" -#: src/Module/Admin/Site.php:536 +#: src/Module/Admin/Site.php:541 msgid "" "When the database cleanup is enabled, this defines the days after which " "unclaimed remote items (mostly content from the relay) will be deleted. " @@ -4798,144 +4803,144 @@ msgid "" "items if set to 0." msgstr "" -#: src/Module/Admin/Site.php:537 +#: src/Module/Admin/Site.php:542 msgid "Lifespan of raw conversation data" msgstr "" -#: src/Module/Admin/Site.php:537 +#: src/Module/Admin/Site.php:542 msgid "" "The conversation data is used for ActivityPub and OStatus, as well as for " "debug purposes. It should be safe to remove it after 14 days, default is 90 " "days." msgstr "" -#: src/Module/Admin/Site.php:538 +#: src/Module/Admin/Site.php:543 msgid "Maximum numbers of comments per post" msgstr "" -#: src/Module/Admin/Site.php:538 +#: src/Module/Admin/Site.php:543 msgid "How much comments should be shown for each post? Default value is 100." msgstr "" -#: src/Module/Admin/Site.php:539 +#: src/Module/Admin/Site.php:544 msgid "Maximum numbers of comments per post on the display page" msgstr "" -#: src/Module/Admin/Site.php:539 +#: src/Module/Admin/Site.php:544 msgid "" "How many comments should be shown on the single view for each post? Default " "value is 1000." msgstr "" -#: src/Module/Admin/Site.php:540 +#: src/Module/Admin/Site.php:545 msgid "Temp path" msgstr "" -#: src/Module/Admin/Site.php:540 +#: src/Module/Admin/Site.php:545 msgid "" "If you have a restricted system where the webserver can't access the system " "temp path, enter another path here." msgstr "" -#: src/Module/Admin/Site.php:541 +#: src/Module/Admin/Site.php:546 msgid "Only search in tags" msgstr "" -#: src/Module/Admin/Site.php:541 +#: src/Module/Admin/Site.php:546 msgid "On large systems the text search can slow down the system extremely." msgstr "" -#: src/Module/Admin/Site.php:542 +#: src/Module/Admin/Site.php:547 msgid "Generate counts per contact group when calculating network count" msgstr "" -#: src/Module/Admin/Site.php:542 +#: src/Module/Admin/Site.php:547 msgid "" "On systems with users that heavily use contact groups the query can be very " "expensive." msgstr "" -#: src/Module/Admin/Site.php:544 +#: src/Module/Admin/Site.php:549 msgid "Maximum number of parallel workers" msgstr "" -#: src/Module/Admin/Site.php:544 +#: src/Module/Admin/Site.php:549 #, php-format msgid "" "On shared hosters set this to %d. On larger systems, values of %d are great. " "Default value is %d." msgstr "" -#: src/Module/Admin/Site.php:545 +#: src/Module/Admin/Site.php:550 msgid "Enable fastlane" msgstr "" -#: src/Module/Admin/Site.php:545 +#: src/Module/Admin/Site.php:550 msgid "" "When enabed, the fastlane mechanism starts an additional worker if processes " "with higher priority are blocked by processes of lower priority." msgstr "" -#: src/Module/Admin/Site.php:547 +#: src/Module/Admin/Site.php:552 msgid "Direct relay transfer" msgstr "" -#: src/Module/Admin/Site.php:547 +#: src/Module/Admin/Site.php:552 msgid "" "Enables the direct transfer to other servers without using the relay servers" msgstr "" -#: src/Module/Admin/Site.php:548 +#: src/Module/Admin/Site.php:553 msgid "Relay scope" msgstr "" -#: src/Module/Admin/Site.php:548 +#: src/Module/Admin/Site.php:553 msgid "" "Can be \"all\" or \"tags\". \"all\" means that every public post should be " "received. \"tags\" means that only posts with selected tags should be " "received." msgstr "" -#: src/Module/Admin/Site.php:548 src/Module/Contact/Profile.php:274 +#: src/Module/Admin/Site.php:553 src/Module/Contact/Profile.php:274 #: src/Module/Settings/TwoFactor/Index.php:125 msgid "Disabled" msgstr "" -#: src/Module/Admin/Site.php:548 +#: src/Module/Admin/Site.php:553 msgid "all" msgstr "" -#: src/Module/Admin/Site.php:548 +#: src/Module/Admin/Site.php:553 msgid "tags" msgstr "" -#: src/Module/Admin/Site.php:549 +#: src/Module/Admin/Site.php:554 msgid "Server tags" msgstr "" -#: src/Module/Admin/Site.php:549 +#: src/Module/Admin/Site.php:554 msgid "Comma separated list of tags for the \"tags\" subscription." msgstr "" -#: src/Module/Admin/Site.php:550 +#: src/Module/Admin/Site.php:555 msgid "Deny Server tags" msgstr "" -#: src/Module/Admin/Site.php:550 +#: src/Module/Admin/Site.php:555 msgid "Comma separated list of tags that are rejected." msgstr "" -#: src/Module/Admin/Site.php:551 +#: src/Module/Admin/Site.php:556 msgid "Allow user tags" msgstr "" -#: src/Module/Admin/Site.php:551 +#: src/Module/Admin/Site.php:556 msgid "" "If enabled, the tags from the saved searches will used for the \"tags\" " "subscription in addition to the \"relay_server_tags\"." msgstr "" -#: src/Module/Admin/Site.php:554 +#: src/Module/Admin/Site.php:559 msgid "Start Relocation" msgstr "" From 7d86cb1a1e4ef775b41216a1374a93d892c264d8 Mon Sep 17 00:00:00 2001 From: Marek Bachmann Date: Wed, 30 Nov 2022 01:40:21 +0100 Subject: [PATCH 29/43] Removed Trends.php which for what ever reason found its way in my branch under src/Module/Api/Mastodon but is not present in friendica:develop --- src/Module/Api/Mastodon/Trends.php | 54 ------------------------------ 1 file changed, 54 deletions(-) delete mode 100644 src/Module/Api/Mastodon/Trends.php diff --git a/src/Module/Api/Mastodon/Trends.php b/src/Module/Api/Mastodon/Trends.php deleted file mode 100644 index c42a27641b..0000000000 --- a/src/Module/Api/Mastodon/Trends.php +++ /dev/null @@ -1,54 +0,0 @@ -. - * - */ - -namespace Friendica\Module\Api\Mastodon; - -use Friendica\Core\System; -use Friendica\DI; -use Friendica\Model\Tag; -use Friendica\Module\BaseApi; - -/** - * @see https://docs.joinmastodon.org/methods/instance/trends/ - */ -class Trends extends BaseApi -{ - /** - * @throws \Friendica\Network\HTTPException\InternalServerErrorException - */ - protected function rawContent(array $request = []) - { - $request = $this->getRequest([ - 'limit' => 20, // Maximum number of results to return. Defaults to 10. - ], $request); - - $trending = []; - $tags = Tag::getGlobalTrendingHashtags(24, 20); - foreach ($tags as $tag) { - $tag['name'] = $tag['term']; - $history = [['day' => (string)time(), 'uses' => (string)$tag['score'], 'accounts' => (string)$tag['authors']]]; - $hashtag = new \Friendica\Object\Api\Mastodon\Tag(DI::baseUrl(), $tag, $history); - $trending[] = $hashtag->toArray(); - } - - System::jsonExit(array_slice($trending, 0, $request['limit'])); - } -} From 72b3bbb23c43d1868e05efd8109441beb01ebd43 Mon Sep 17 00:00:00 2001 From: MarekBenjamin <117765478+MarekBenjamin@users.noreply.github.com> Date: Wed, 30 Nov 2022 01:49:53 +0100 Subject: [PATCH 30/43] Update src/Module/Admin/Site.php Co-authored-by: Hypolite Petovan --- src/Module/Admin/Site.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Module/Admin/Site.php b/src/Module/Admin/Site.php index 9e6967d827..a6b47df245 100644 --- a/src/Module/Admin/Site.php +++ b/src/Module/Admin/Site.php @@ -476,7 +476,7 @@ class Site extends BaseAdmin '$maximagesize' => ['maximagesize', DI::l10n()->t('Maximum image size'), DI::config()->get('system', 'maximagesize'), DI::l10n()->t('Maximum size in bytes of uploaded images. Default is 0, which means no limits. The value of upload_max_filesize in your PHP.ini needs be set to at least the desired limit. Currently upload_max_filesize is set to %s (%sB)', Strings::getBytesFromShorthand(ini_get('upload_max_filesize')), ini_get('upload_max_filesize')), - '', '', '', '\d+(?:\s*[kmg])?'], + '', 'pattern="\d+(?:\s*[kmg])?"'], '$maximagelength' => ['maximagelength', DI::l10n()->t('Maximum image length'), DI::config()->get('system', 'max_image_length'), DI::l10n()->t('Maximum length in pixels of the longest side of uploaded images. Default is -1, which means no limits.')], '$jpegimagequality' => ['jpegimagequality', DI::l10n()->t('JPEG image quality'), DI::config()->get('system', 'jpeg_quality'), DI::l10n()->t('Uploaded JPEGS will be saved at this quality setting [0-100]. Default is 100, which is full quality.')], From 0ea219f728b77f3a3b66bf3996a96e1f8d791bb2 Mon Sep 17 00:00:00 2001 From: Marek Bachmann Date: Wed, 30 Nov 2022 01:58:22 +0100 Subject: [PATCH 31/43] Use previously already available field.5 for short hand pattern ad admin page for maximagesize --- view/templates/field_input.tpl | 2 +- view/theme/frio/templates/field_input.tpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/view/templates/field_input.tpl b/view/templates/field_input.tpl index 95a13cfb7b..3455891b9d 100644 --- a/view/templates/field_input.tpl +++ b/view/templates/field_input.tpl @@ -1,7 +1,7 @@
- + {{if $field.3}} {{$field.3 nofilter}} {{/if}} diff --git a/view/theme/frio/templates/field_input.tpl b/view/theme/frio/templates/field_input.tpl index 9812e3466f..3a9e54d06a 100644 --- a/view/theme/frio/templates/field_input.tpl +++ b/view/theme/frio/templates/field_input.tpl @@ -3,7 +3,7 @@ {{if !isset($label) || $label != false }} {{/if}} - + {{if $field.3}} {{$field.3 nofilter}} {{/if}} From 2794100cbc3276f296237af5d4fd89738cccc29b Mon Sep 17 00:00:00 2001 From: Marek Bachmann Date: Wed, 30 Nov 2022 02:16:04 +0100 Subject: [PATCH 32/43] Fixed meaning of "maximagesize" = 0 --> infinity --- mod/photos.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mod/photos.php b/mod/photos.php index 8671c39495..d31f8daab5 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -918,7 +918,10 @@ function photos_content(App $a) // Get the relevant size limits for uploads. Abbreviated var names: MaxImageSize -> mis; upload_max_filesize -> umf $mis_bytes = Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize')); $umf_bytes = Strings::getBytesFromShorthand(ini_get('upload_max_filesize')); - + // Per Friendica definition a value of '0' mean unlimited: + If ($mis_bytes == 0) { + $mis_bytes = INF; + } // When PHP is configured with upload_max_filesize less than maximagesize provide this lower limit. $maximagesize_Mbytes = (is_numeric($mis_bytes) && ($mis_bytes < $umf_bytes) ? $mis_bytes : $umf_bytes) / (1048576); From 99e1c64b1aad337a5c987c15f513a55519e76845 Mon Sep 17 00:00:00 2001 From: Marek Bachmann Date: Wed, 30 Nov 2022 02:16:48 +0100 Subject: [PATCH 33/43] Added info that shorthands can be used for maxfilesize Admin Site --- src/Module/Admin/Site.php | 2 +- view/lang/C/messages.po | 101 +++++++++++++++++++------------------- 2 files changed, 52 insertions(+), 51 deletions(-) diff --git a/src/Module/Admin/Site.php b/src/Module/Admin/Site.php index a6b47df245..9e23d6a639 100644 --- a/src/Module/Admin/Site.php +++ b/src/Module/Admin/Site.php @@ -473,7 +473,7 @@ class Site extends BaseAdmin '$show_help' => ['show_help', DI::l10n()->t('Show help entry from navigation menu'), !DI::config()->get('system', 'hide_help'), DI::l10n()->t('Displays the menu entry for the Help pages from the navigation menu. It is always accessible by calling /help directly.')], '$singleuser' => ['singleuser', DI::l10n()->t('Single user instance'), DI::config()->get('system', 'singleuser', '---'), DI::l10n()->t('Make this instance multi-user or single-user for the named user'), $user_names], - '$maximagesize' => ['maximagesize', DI::l10n()->t('Maximum image size'), DI::config()->get('system', 'maximagesize'), DI::l10n()->t('Maximum size in bytes of uploaded images. Default is 0, which means no limits. + '$maximagesize' => ['maximagesize', DI::l10n()->t('Maximum image size'), DI::config()->get('system', 'maximagesize'), DI::l10n()->t('Maximum size in bytes of uploaded images. Default is 0, which means no limits. You can put k, m, or g behind the desired value for KiB, MiB, GiB, respectively. The value of upload_max_filesize in your PHP.ini needs be set to at least the desired limit. Currently upload_max_filesize is set to %s (%sB)', Strings::getBytesFromShorthand(ini_get('upload_max_filesize')), ini_get('upload_max_filesize')), '', 'pattern="\d+(?:\s*[kmg])?"'], diff --git a/view/lang/C/messages.po b/view/lang/C/messages.po index 6a330cad46..2143ae93fd 100644 --- a/view/lang/C/messages.po +++ b/view/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 2022.12-dev\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-30 01:19+0100\n" +"POT-Creation-Date: 2022-11-30 02:13+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -292,7 +292,7 @@ msgstr "" msgid "Insert web link" msgstr "" -#: mod/message.php:203 mod/message.php:360 mod/photos.php:1493 +#: mod/message.php:203 mod/message.php:360 mod/photos.php:1496 #: src/Content/Conversation.php:371 src/Content/Conversation.php:717 #: src/Module/Item/Compose.php:204 src/Module/Post/Edit.php:142 #: src/Module/Profile/UnkMail.php:155 src/Object/Post.php:537 @@ -300,8 +300,8 @@ msgid "Please wait" msgstr "" #: mod/message.php:204 mod/message.php:359 mod/photos.php:914 -#: mod/photos.php:1027 mod/photos.php:1299 mod/photos.php:1340 -#: mod/photos.php:1396 mod/photos.php:1470 +#: mod/photos.php:1030 mod/photos.php:1302 mod/photos.php:1343 +#: mod/photos.php:1399 mod/photos.php:1473 #: src/Module/Calendar/Event/Form.php:250 src/Module/Contact/Advanced.php:132 #: src/Module/Contact/Profile.php:327 #: src/Module/Debug/ActivityPubConversion.php:140 @@ -405,7 +405,7 @@ msgstr "" msgid "Recent Photos" msgstr "" -#: mod/photos.php:110 mod/photos.php:1075 src/Module/Profile/Photos.php:172 +#: mod/photos.php:110 mod/photos.php:1078 src/Module/Profile/Photos.php:172 #: src/Module/Profile/Photos.php:189 msgid "Upload New Photos" msgstr "" @@ -494,40 +494,40 @@ msgstr "" msgid "Access to this item is restricted." msgstr "" -#: mod/photos.php:926 +#: mod/photos.php:929 msgid "The maximum accepted image size is %.6g MB" msgstr "" -#: mod/photos.php:933 +#: mod/photos.php:936 msgid "Upload Photos" msgstr "" -#: mod/photos.php:937 mod/photos.php:1023 +#: mod/photos.php:940 mod/photos.php:1026 msgid "New album name: " msgstr "" -#: mod/photos.php:938 +#: mod/photos.php:941 msgid "or select existing album:" msgstr "" -#: mod/photos.php:939 +#: mod/photos.php:942 msgid "Do not show a status post for this upload" msgstr "" -#: mod/photos.php:941 mod/photos.php:1295 src/Content/Conversation.php:373 +#: mod/photos.php:944 mod/photos.php:1298 src/Content/Conversation.php:373 #: src/Module/Calendar/Event/Form.php:253 src/Module/Post/Edit.php:179 msgid "Permissions" msgstr "" -#: mod/photos.php:1004 +#: mod/photos.php:1007 msgid "Do you really want to delete this photo album and all its photos?" msgstr "" -#: mod/photos.php:1005 mod/photos.php:1028 +#: mod/photos.php:1008 mod/photos.php:1031 msgid "Delete Album" msgstr "" -#: mod/photos.php:1006 mod/photos.php:1107 src/Content/Conversation.php:389 +#: mod/photos.php:1009 mod/photos.php:1110 src/Content/Conversation.php:389 #: src/Module/Contact/Follow.php:173 src/Module/Contact/Revoke.php:109 #: src/Module/Contact/Unfollow.php:126 #: src/Module/Media/Attachment/Browser.php:77 @@ -537,130 +537,130 @@ msgstr "" msgid "Cancel" msgstr "" -#: mod/photos.php:1032 +#: mod/photos.php:1035 msgid "Edit Album" msgstr "" -#: mod/photos.php:1033 +#: mod/photos.php:1036 msgid "Drop Album" msgstr "" -#: mod/photos.php:1037 +#: mod/photos.php:1040 msgid "Show Newest First" msgstr "" -#: mod/photos.php:1039 +#: mod/photos.php:1042 msgid "Show Oldest First" msgstr "" -#: mod/photos.php:1060 src/Module/Profile/Photos.php:140 +#: mod/photos.php:1063 src/Module/Profile/Photos.php:140 msgid "View Photo" msgstr "" -#: mod/photos.php:1093 +#: mod/photos.php:1096 msgid "Permission denied. Access to this item may be restricted." msgstr "" -#: mod/photos.php:1095 +#: mod/photos.php:1098 msgid "Photo not available" msgstr "" -#: mod/photos.php:1105 +#: mod/photos.php:1108 msgid "Do you really want to delete this photo?" msgstr "" -#: mod/photos.php:1106 mod/photos.php:1300 +#: mod/photos.php:1109 mod/photos.php:1303 msgid "Delete Photo" msgstr "" -#: mod/photos.php:1198 +#: mod/photos.php:1201 msgid "View photo" msgstr "" -#: mod/photos.php:1200 +#: mod/photos.php:1203 msgid "Edit photo" msgstr "" -#: mod/photos.php:1201 +#: mod/photos.php:1204 msgid "Delete photo" msgstr "" -#: mod/photos.php:1202 +#: mod/photos.php:1205 msgid "Use as profile photo" msgstr "" -#: mod/photos.php:1209 +#: mod/photos.php:1212 msgid "Private Photo" msgstr "" -#: mod/photos.php:1215 +#: mod/photos.php:1218 msgid "View Full Size" msgstr "" -#: mod/photos.php:1268 +#: mod/photos.php:1271 msgid "Tags: " msgstr "" -#: mod/photos.php:1271 +#: mod/photos.php:1274 msgid "[Select tags to remove]" msgstr "" -#: mod/photos.php:1286 +#: mod/photos.php:1289 msgid "New album name" msgstr "" -#: mod/photos.php:1287 +#: mod/photos.php:1290 msgid "Caption" msgstr "" -#: mod/photos.php:1288 +#: mod/photos.php:1291 msgid "Add a Tag" msgstr "" -#: mod/photos.php:1288 +#: mod/photos.php:1291 msgid "Example: @bob, @Barbara_Jensen, @jim@example.com, #California, #camping" msgstr "" -#: mod/photos.php:1289 +#: mod/photos.php:1292 msgid "Do not rotate" msgstr "" -#: mod/photos.php:1290 +#: mod/photos.php:1293 msgid "Rotate CW (right)" msgstr "" -#: mod/photos.php:1291 +#: mod/photos.php:1294 msgid "Rotate CCW (left)" msgstr "" -#: mod/photos.php:1337 mod/photos.php:1393 mod/photos.php:1467 +#: mod/photos.php:1340 mod/photos.php:1396 mod/photos.php:1470 #: src/Module/Contact.php:547 src/Module/Item/Compose.php:188 #: src/Object/Post.php:983 msgid "This is you" msgstr "" -#: mod/photos.php:1339 mod/photos.php:1395 mod/photos.php:1469 +#: mod/photos.php:1342 mod/photos.php:1398 mod/photos.php:1472 #: src/Object/Post.php:531 src/Object/Post.php:985 msgid "Comment" msgstr "" -#: mod/photos.php:1341 mod/photos.php:1397 mod/photos.php:1471 +#: mod/photos.php:1344 mod/photos.php:1400 mod/photos.php:1474 #: src/Content/Conversation.php:386 src/Module/Calendar/Event/Form.php:248 #: src/Module/Item/Compose.php:199 src/Module/Post/Edit.php:162 #: src/Object/Post.php:997 msgid "Preview" msgstr "" -#: mod/photos.php:1342 src/Content/Conversation.php:341 +#: mod/photos.php:1345 src/Content/Conversation.php:341 #: src/Module/Post/Edit.php:127 src/Object/Post.php:987 msgid "Loading..." msgstr "" -#: mod/photos.php:1428 src/Content/Conversation.php:633 src/Object/Post.php:255 +#: mod/photos.php:1431 src/Content/Conversation.php:633 src/Object/Post.php:255 msgid "Select" msgstr "" -#: mod/photos.php:1429 src/Content/Conversation.php:634 +#: mod/photos.php:1432 src/Content/Conversation.php:634 #: src/Module/Moderation/Users/Active.php:136 #: src/Module/Moderation/Users/Blocked.php:136 #: src/Module/Moderation/Users/Index.php:151 @@ -668,23 +668,23 @@ msgstr "" msgid "Delete" msgstr "" -#: mod/photos.php:1490 src/Object/Post.php:378 +#: mod/photos.php:1493 src/Object/Post.php:378 msgid "Like" msgstr "" -#: mod/photos.php:1491 src/Object/Post.php:378 +#: mod/photos.php:1494 src/Object/Post.php:378 msgid "I like this (toggle)" msgstr "" -#: mod/photos.php:1492 src/Object/Post.php:379 +#: mod/photos.php:1495 src/Object/Post.php:379 msgid "Dislike" msgstr "" -#: mod/photos.php:1494 src/Object/Post.php:379 +#: mod/photos.php:1497 src/Object/Post.php:379 msgid "I don't like this (toggle)" msgstr "" -#: mod/photos.php:1516 +#: mod/photos.php:1519 msgid "Map" msgstr "" @@ -4283,7 +4283,8 @@ msgstr "" #, php-format msgid "" "Maximum size in bytes of uploaded images. Default is 0, which means no " -"limits.\n" +"limits. You can put k, m, or g behind the desired value for KiB, MiB, GiB, " +"respectively.\n" "\t\t\t\t\t\t\t\t\t\t\t\t\tThe value of upload_max_filesize in " "your PHP.ini needs be set to at least the desired limit.\n" "\t\t\t\t\t\t\t\t\t\t\t\t\tCurrently upload_max_filesize is set " From bbd1c34292e8ac0d4d0b879b0fe57fb69a0c7841 Mon Sep 17 00:00:00 2001 From: Marek Bachmann Date: Wed, 30 Nov 2022 02:26:56 +0100 Subject: [PATCH 34/43] Wrapped all occurrences of DI::config()->get('system', 'maximagesize') with Strings::getBytesFromShorthand() --- src/Model/Photo.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Model/Photo.php b/src/Model/Photo.php index 990fb7e616..967c58e2ab 100644 --- a/src/Model/Photo.php +++ b/src/Model/Photo.php @@ -575,7 +575,7 @@ class Photo $image->scaleToSquare(300); $filesize = strlen($image->asString()); - $maximagesize = DI::config()->get('system', 'maximagesize'); + $maximagesize = Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize')); if (!empty($maximagesize) && ($filesize > $maximagesize)) { Logger::info('Avatar exceeds image limit', ['uid' => $uid, 'cid' => $cid, 'maximagesize' => $maximagesize, 'size' => $filesize, 'type' => $image->getType()]); if ($image->getType() == 'image/gif') { @@ -966,7 +966,7 @@ class Photo $width = $image->getWidth(); $height = $image->getHeight(); - $maximagesize = DI::config()->get('system', 'maximagesize'); + $maximagesize = Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize')); if (!empty($maximagesize) && ($filesize > $maximagesize)) { // Scale down to multiples of 640 until the maximum size isn't exceeded anymore From 97a3587e5821d6d2208d38941b36118e7da17059 Mon Sep 17 00:00:00 2001 From: Marek Bachmann Date: Wed, 30 Nov 2022 02:44:48 +0100 Subject: [PATCH 35/43] Added handling as infinity if maxfilesize is set to 0 --- mod/photos.php | 8 +++++++- src/Model/Photo.php | 9 +++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/mod/photos.php b/mod/photos.php index d31f8daab5..9624982ca9 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -656,6 +656,10 @@ function photos_post(App $a) $maximagesize = Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize')); + if ($maximagesize == 0) { + $maximagesize = INF; + } + if ($maximagesize && ($filesize > $maximagesize)) { DI::sysmsg()->addNotice(DI::l10n()->t('Image exceeds size limit of %s', Strings::formatBytes($maximagesize))); @unlink($src); @@ -918,10 +922,12 @@ function photos_content(App $a) // Get the relevant size limits for uploads. Abbreviated var names: MaxImageSize -> mis; upload_max_filesize -> umf $mis_bytes = Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize')); $umf_bytes = Strings::getBytesFromShorthand(ini_get('upload_max_filesize')); - // Per Friendica definition a value of '0' mean unlimited: + + // Per Friendica definition a value of '0' means unlimited: If ($mis_bytes == 0) { $mis_bytes = INF; } + // When PHP is configured with upload_max_filesize less than maximagesize provide this lower limit. $maximagesize_Mbytes = (is_numeric($mis_bytes) && ($mis_bytes < $umf_bytes) ? $mis_bytes : $umf_bytes) / (1048576); diff --git a/src/Model/Photo.php b/src/Model/Photo.php index 967c58e2ab..1250ad570b 100644 --- a/src/Model/Photo.php +++ b/src/Model/Photo.php @@ -576,6 +576,11 @@ class Photo $filesize = strlen($image->asString()); $maximagesize = Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize')); + + if ($maximagesize == 0) { + $maximagesize = INF; + } + if (!empty($maximagesize) && ($filesize > $maximagesize)) { Logger::info('Avatar exceeds image limit', ['uid' => $uid, 'cid' => $cid, 'maximagesize' => $maximagesize, 'size' => $filesize, 'type' => $image->getType()]); if ($image->getType() == 'image/gif') { @@ -968,6 +973,10 @@ class Photo $maximagesize = Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize')); + if ($maximagesize == 0) { + $maximagesize = INF; + } + if (!empty($maximagesize) && ($filesize > $maximagesize)) { // Scale down to multiples of 640 until the maximum size isn't exceeded anymore foreach ([5120, 2560, 1280, 640] as $pixels) { From bb9afc520bec634e403ed5d297500464162a6116 Mon Sep 17 00:00:00 2001 From: Marek Bachmann Date: Wed, 30 Nov 2022 04:13:10 +0100 Subject: [PATCH 36/43] Added getBytesFromShorthand at the remaining places. --- src/Module/Media/Photo/Upload.php | 7 ++++++- src/Module/Settings/Profile/Photo/Index.php | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/Module/Media/Photo/Upload.php b/src/Module/Media/Photo/Upload.php index c07249c902..ec8dbcf70d 100644 --- a/src/Module/Media/Photo/Upload.php +++ b/src/Module/Media/Photo/Upload.php @@ -26,6 +26,7 @@ use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\L10n; use Friendica\Core\Session\Capability\IHandleUserSessions; use Friendica\Database\Database; +use Friendica\DI; use Friendica\Model\Photo; use Friendica\Model\User; use Friendica\Module\BaseApi; @@ -168,7 +169,11 @@ class Upload extends \Friendica\BaseModule $width = $image->getWidth(); $height = $image->getHeight(); - $maximagesize = $this->config->get('system', 'maximagesize'); + $maximagesize = Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize')); + + if ($maximagesize == 0) { + $maximagesize = INF; + } if (!empty($maximagesize) && $filesize > $maximagesize) { // Scale down to multiples of 640 until the maximum size isn't exceeded anymore diff --git a/src/Module/Settings/Profile/Photo/Index.php b/src/Module/Settings/Profile/Photo/Index.php index d58576e757..ee551f88bc 100644 --- a/src/Module/Settings/Profile/Photo/Index.php +++ b/src/Module/Settings/Profile/Photo/Index.php @@ -53,7 +53,11 @@ class Index extends BaseSettings $filetype = Images::getMimeTypeBySource($src, $filename, $filetype); - $maximagesize = DI::config()->get('system', 'maximagesize', 0); + $maximagesize = Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize', 0)); + + if ($maximagesize == 0) { + $maximagesize = INF; + } if ($maximagesize && $filesize > $maximagesize) { DI::sysmsg()->addNotice(DI::l10n()->t('Image exceeds size limit of %s', Strings::formatBytes($maximagesize))); From 037e181f82a84718d1719db4777cb58429734c47 Mon Sep 17 00:00:00 2001 From: Marek Bachmann Date: Wed, 30 Nov 2022 04:34:40 +0100 Subject: [PATCH 37/43] use the existing function for format byte values to KiB, MiB, GiB --- mod/photos.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mod/photos.php b/mod/photos.php index 9624982ca9..4436da5d69 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -918,7 +918,6 @@ function photos_content(App $a) '$submit' => DI::l10n()->t('Submit'), ]); - $maximagesize_Mbytes = 0; // Get the relevant size limits for uploads. Abbreviated var names: MaxImageSize -> mis; upload_max_filesize -> umf $mis_bytes = Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize')); $umf_bytes = Strings::getBytesFromShorthand(ini_get('upload_max_filesize')); @@ -929,10 +928,10 @@ function photos_content(App $a) } // When PHP is configured with upload_max_filesize less than maximagesize provide this lower limit. - $maximagesize_Mbytes = (is_numeric($mis_bytes) && ($mis_bytes < $umf_bytes) ? $mis_bytes : $umf_bytes) / (1048576); + $maximagesize_bytes = (is_numeric($mis_bytes) && ($mis_bytes < $umf_bytes) ? $mis_bytes : $umf_bytes); // @todo We may be want to use appropriate binary prefixed dynamicly - $usage_message = DI::l10n()->t('The maximum accepted image size is %.6g MB', $maximagesize_Mbytes); + $usage_message = DI::l10n()->t('The maximum accepted image size is %s', Strings::formatBytes($maximagesize_bytes)); $tpl = Renderer::getMarkupTemplate('photos_upload.tpl'); From 75b01f669a88bae2c7014ce9b10c651c1d7ebcd5 Mon Sep 17 00:00:00 2001 From: Marek Bachmann Date: Wed, 30 Nov 2022 04:35:18 +0100 Subject: [PATCH 38/43] Check for inf values before try to converts bytes to binary prefix strings --- src/Util/Strings.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Util/Strings.php b/src/Util/Strings.php index 5988cc89bc..e1ec4ae50b 100644 --- a/src/Util/Strings.php +++ b/src/Util/Strings.php @@ -220,6 +220,11 @@ class Strings */ public static function formatBytes(int $bytes, int $precision = 2): string { + // If this method is called for an infinite (== unlimited) amount of bytes: + if ($bytes == INF) { + return INF; + } + $units = ['B', 'KB', 'MB', 'GB', 'TB']; $bytes = max($bytes, 0); $pow = floor(($bytes ? log($bytes) : 0) / log(1024)); From a3d8a59b00e829b852b0115c14d1de2e6b4d428d Mon Sep 17 00:00:00 2001 From: Marek Bachmann Date: Wed, 30 Nov 2022 04:37:08 +0100 Subject: [PATCH 39/43] Correctly output binary prefix values since base 2 is used for conversion --- src/Util/Strings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Util/Strings.php b/src/Util/Strings.php index e1ec4ae50b..0d7bf66911 100644 --- a/src/Util/Strings.php +++ b/src/Util/Strings.php @@ -225,7 +225,7 @@ class Strings return INF; } - $units = ['B', 'KB', 'MB', 'GB', 'TB']; + $units = ['B', 'KiB', 'MiB', 'GiB', 'TiB']; $bytes = max($bytes, 0); $pow = floor(($bytes ? log($bytes) : 0) / log(1024)); $pow = min($pow, count($units) - 1); From 00808326c27f1cdc56b68e5109b3dd20f745504f Mon Sep 17 00:00:00 2001 From: Marek Bachmann Date: Wed, 30 Nov 2022 04:39:00 +0100 Subject: [PATCH 40/43] message.po --- view/lang/C/messages.po | 167 ++++++++++++++++++++-------------------- 1 file changed, 84 insertions(+), 83 deletions(-) diff --git a/view/lang/C/messages.po b/view/lang/C/messages.po index 2143ae93fd..a51b305db3 100644 --- a/view/lang/C/messages.po +++ b/view/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 2022.12-dev\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-30 02:13+0100\n" +"POT-Creation-Date: 2022-11-30 04:38+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -23,7 +23,7 @@ msgid "Unable to locate original post." msgstr "" #: mod/item.php:179 mod/item.php:184 mod/item.php:855 mod/message.php:69 -#: mod/message.php:114 mod/notes.php:44 mod/photos.php:159 mod/photos.php:884 +#: mod/message.php:114 mod/notes.php:44 mod/photos.php:159 mod/photos.php:888 #: src/Module/Attach.php:55 src/Module/BaseApi.php:94 #: src/Module/BaseNotifications.php:98 src/Module/BaseSettings.php:52 #: src/Module/Calendar/Event/API.php:88 src/Module/Calendar/Event/Form.php:84 @@ -50,7 +50,7 @@ msgstr "" #: src/Module/Settings/Delegation.php:69 src/Module/Settings/Display.php:41 #: src/Module/Settings/Display.php:119 #: src/Module/Settings/Profile/Photo/Crop.php:165 -#: src/Module/Settings/Profile/Photo/Index.php:111 +#: src/Module/Settings/Profile/Photo/Index.php:115 #: src/Module/Settings/RemoveMe.php:117 src/Module/Settings/UserExport.php:80 #: src/Module/Settings/UserExport.php:114 #: src/Module/Settings/UserExport.php:215 @@ -292,16 +292,16 @@ msgstr "" msgid "Insert web link" msgstr "" -#: mod/message.php:203 mod/message.php:360 mod/photos.php:1496 +#: mod/message.php:203 mod/message.php:360 mod/photos.php:1501 #: src/Content/Conversation.php:371 src/Content/Conversation.php:717 #: src/Module/Item/Compose.php:204 src/Module/Post/Edit.php:142 #: src/Module/Profile/UnkMail.php:155 src/Object/Post.php:537 msgid "Please wait" msgstr "" -#: mod/message.php:204 mod/message.php:359 mod/photos.php:914 -#: mod/photos.php:1030 mod/photos.php:1302 mod/photos.php:1343 -#: mod/photos.php:1399 mod/photos.php:1473 +#: mod/message.php:204 mod/message.php:359 mod/photos.php:918 +#: mod/photos.php:1035 mod/photos.php:1307 mod/photos.php:1348 +#: mod/photos.php:1404 mod/photos.php:1478 #: src/Module/Calendar/Event/Form.php:250 src/Module/Contact/Advanced.php:132 #: src/Module/Contact/Profile.php:327 #: src/Module/Debug/ActivityPubConversion.php:140 @@ -384,7 +384,7 @@ msgstr "" msgid "Save" msgstr "" -#: mod/photos.php:68 mod/photos.php:139 mod/photos.php:791 +#: mod/photos.php:68 mod/photos.php:139 mod/photos.php:795 #: src/Model/Event.php:514 src/Model/Profile.php:234 #: src/Module/Calendar/Export.php:67 src/Module/Feed.php:72 #: src/Module/HCard.php:51 src/Module/Profile/Common.php:40 @@ -405,7 +405,7 @@ msgstr "" msgid "Recent Photos" msgstr "" -#: mod/photos.php:110 mod/photos.php:1078 src/Module/Profile/Photos.php:172 +#: mod/photos.php:110 mod/photos.php:1083 src/Module/Profile/Photos.php:172 #: src/Module/Profile/Photos.php:189 msgid "Upload New Photos" msgstr "" @@ -444,9 +444,9 @@ msgstr "" msgid "%1$s was tagged in %2$s by %3$s" msgstr "" -#: mod/photos.php:630 mod/photos.php:633 mod/photos.php:660 -#: src/Module/Media/Photo/Upload.php:188 -#: src/Module/Settings/Profile/Photo/Index.php:59 +#: mod/photos.php:630 mod/photos.php:633 mod/photos.php:664 +#: src/Module/Media/Photo/Upload.php:193 +#: src/Module/Settings/Profile/Photo/Index.php:63 #, php-format msgid "Image exceeds size limit of %s" msgstr "" @@ -465,69 +465,70 @@ msgid "" "administrator" msgstr "" -#: mod/photos.php:668 +#: mod/photos.php:672 msgid "Image file is empty." msgstr "" -#: mod/photos.php:683 src/Module/Media/Photo/Upload.php:154 -#: src/Module/Media/Photo/Upload.php:155 -#: src/Module/Settings/Profile/Photo/Index.php:68 +#: mod/photos.php:687 src/Module/Media/Photo/Upload.php:155 +#: src/Module/Media/Photo/Upload.php:156 +#: src/Module/Settings/Profile/Photo/Index.php:72 msgid "Unable to process image." msgstr "" -#: mod/photos.php:709 src/Module/Media/Photo/Upload.php:206 -#: src/Module/Settings/Profile/Photo/Index.php:95 +#: mod/photos.php:713 src/Module/Media/Photo/Upload.php:211 +#: src/Module/Settings/Profile/Photo/Index.php:99 msgid "Image upload failed." msgstr "" -#: mod/photos.php:795 src/Module/Conversation/Community.php:187 +#: mod/photos.php:799 src/Module/Conversation/Community.php:187 #: src/Module/Directory.php:48 src/Module/Profile/Photos.php:72 #: src/Module/Search/Index.php:64 msgid "Public access denied." msgstr "" -#: mod/photos.php:800 +#: mod/photos.php:804 msgid "No photos selected" msgstr "" -#: mod/photos.php:869 src/Module/Profile/Photos.php:92 +#: mod/photos.php:873 src/Module/Profile/Photos.php:92 msgid "Access to this item is restricted." msgstr "" -#: mod/photos.php:929 -msgid "The maximum accepted image size is %.6g MB" -msgstr "" - -#: mod/photos.php:936 -msgid "Upload Photos" -msgstr "" - -#: mod/photos.php:940 mod/photos.php:1026 -msgid "New album name: " +#: mod/photos.php:934 +#, php-format +msgid "The maximum accepted image size is %s" msgstr "" #: mod/photos.php:941 +msgid "Upload Photos" +msgstr "" + +#: mod/photos.php:945 mod/photos.php:1031 +msgid "New album name: " +msgstr "" + +#: mod/photos.php:946 msgid "or select existing album:" msgstr "" -#: mod/photos.php:942 +#: mod/photos.php:947 msgid "Do not show a status post for this upload" msgstr "" -#: mod/photos.php:944 mod/photos.php:1298 src/Content/Conversation.php:373 +#: mod/photos.php:949 mod/photos.php:1303 src/Content/Conversation.php:373 #: src/Module/Calendar/Event/Form.php:253 src/Module/Post/Edit.php:179 msgid "Permissions" msgstr "" -#: mod/photos.php:1007 +#: mod/photos.php:1012 msgid "Do you really want to delete this photo album and all its photos?" msgstr "" -#: mod/photos.php:1008 mod/photos.php:1031 +#: mod/photos.php:1013 mod/photos.php:1036 msgid "Delete Album" msgstr "" -#: mod/photos.php:1009 mod/photos.php:1110 src/Content/Conversation.php:389 +#: mod/photos.php:1014 mod/photos.php:1115 src/Content/Conversation.php:389 #: src/Module/Contact/Follow.php:173 src/Module/Contact/Revoke.php:109 #: src/Module/Contact/Unfollow.php:126 #: src/Module/Media/Attachment/Browser.php:77 @@ -537,130 +538,130 @@ msgstr "" msgid "Cancel" msgstr "" -#: mod/photos.php:1035 +#: mod/photos.php:1040 msgid "Edit Album" msgstr "" -#: mod/photos.php:1036 +#: mod/photos.php:1041 msgid "Drop Album" msgstr "" -#: mod/photos.php:1040 +#: mod/photos.php:1045 msgid "Show Newest First" msgstr "" -#: mod/photos.php:1042 +#: mod/photos.php:1047 msgid "Show Oldest First" msgstr "" -#: mod/photos.php:1063 src/Module/Profile/Photos.php:140 +#: mod/photos.php:1068 src/Module/Profile/Photos.php:140 msgid "View Photo" msgstr "" -#: mod/photos.php:1096 +#: mod/photos.php:1101 msgid "Permission denied. Access to this item may be restricted." msgstr "" -#: mod/photos.php:1098 +#: mod/photos.php:1103 msgid "Photo not available" msgstr "" -#: mod/photos.php:1108 +#: mod/photos.php:1113 msgid "Do you really want to delete this photo?" msgstr "" -#: mod/photos.php:1109 mod/photos.php:1303 +#: mod/photos.php:1114 mod/photos.php:1308 msgid "Delete Photo" msgstr "" -#: mod/photos.php:1201 +#: mod/photos.php:1206 msgid "View photo" msgstr "" -#: mod/photos.php:1203 +#: mod/photos.php:1208 msgid "Edit photo" msgstr "" -#: mod/photos.php:1204 +#: mod/photos.php:1209 msgid "Delete photo" msgstr "" -#: mod/photos.php:1205 +#: mod/photos.php:1210 msgid "Use as profile photo" msgstr "" -#: mod/photos.php:1212 +#: mod/photos.php:1217 msgid "Private Photo" msgstr "" -#: mod/photos.php:1218 +#: mod/photos.php:1223 msgid "View Full Size" msgstr "" -#: mod/photos.php:1271 +#: mod/photos.php:1276 msgid "Tags: " msgstr "" -#: mod/photos.php:1274 +#: mod/photos.php:1279 msgid "[Select tags to remove]" msgstr "" -#: mod/photos.php:1289 +#: mod/photos.php:1294 msgid "New album name" msgstr "" -#: mod/photos.php:1290 +#: mod/photos.php:1295 msgid "Caption" msgstr "" -#: mod/photos.php:1291 +#: mod/photos.php:1296 msgid "Add a Tag" msgstr "" -#: mod/photos.php:1291 +#: mod/photos.php:1296 msgid "Example: @bob, @Barbara_Jensen, @jim@example.com, #California, #camping" msgstr "" -#: mod/photos.php:1292 +#: mod/photos.php:1297 msgid "Do not rotate" msgstr "" -#: mod/photos.php:1293 +#: mod/photos.php:1298 msgid "Rotate CW (right)" msgstr "" -#: mod/photos.php:1294 +#: mod/photos.php:1299 msgid "Rotate CCW (left)" msgstr "" -#: mod/photos.php:1340 mod/photos.php:1396 mod/photos.php:1470 +#: mod/photos.php:1345 mod/photos.php:1401 mod/photos.php:1475 #: src/Module/Contact.php:547 src/Module/Item/Compose.php:188 #: src/Object/Post.php:983 msgid "This is you" msgstr "" -#: mod/photos.php:1342 mod/photos.php:1398 mod/photos.php:1472 +#: mod/photos.php:1347 mod/photos.php:1403 mod/photos.php:1477 #: src/Object/Post.php:531 src/Object/Post.php:985 msgid "Comment" msgstr "" -#: mod/photos.php:1344 mod/photos.php:1400 mod/photos.php:1474 +#: mod/photos.php:1349 mod/photos.php:1405 mod/photos.php:1479 #: src/Content/Conversation.php:386 src/Module/Calendar/Event/Form.php:248 #: src/Module/Item/Compose.php:199 src/Module/Post/Edit.php:162 #: src/Object/Post.php:997 msgid "Preview" msgstr "" -#: mod/photos.php:1345 src/Content/Conversation.php:341 +#: mod/photos.php:1350 src/Content/Conversation.php:341 #: src/Module/Post/Edit.php:127 src/Object/Post.php:987 msgid "Loading..." msgstr "" -#: mod/photos.php:1431 src/Content/Conversation.php:633 src/Object/Post.php:255 +#: mod/photos.php:1436 src/Content/Conversation.php:633 src/Object/Post.php:255 msgid "Select" msgstr "" -#: mod/photos.php:1432 src/Content/Conversation.php:634 +#: mod/photos.php:1437 src/Content/Conversation.php:634 #: src/Module/Moderation/Users/Active.php:136 #: src/Module/Moderation/Users/Blocked.php:136 #: src/Module/Moderation/Users/Index.php:151 @@ -668,23 +669,23 @@ msgstr "" msgid "Delete" msgstr "" -#: mod/photos.php:1493 src/Object/Post.php:378 +#: mod/photos.php:1498 src/Object/Post.php:378 msgid "Like" msgstr "" -#: mod/photos.php:1494 src/Object/Post.php:378 +#: mod/photos.php:1499 src/Object/Post.php:378 msgid "I like this (toggle)" msgstr "" -#: mod/photos.php:1495 src/Object/Post.php:379 +#: mod/photos.php:1500 src/Object/Post.php:379 msgid "Dislike" msgstr "" -#: mod/photos.php:1497 src/Object/Post.php:379 +#: mod/photos.php:1502 src/Object/Post.php:379 msgid "I don't like this (toggle)" msgstr "" -#: mod/photos.php:1519 +#: mod/photos.php:1524 msgid "Map" msgstr "" @@ -3172,7 +3173,7 @@ msgstr "" msgid "[no subject]" msgstr "" -#: src/Model/Photo.php:1144 src/Module/Media/Photo/Upload.php:198 +#: src/Model/Photo.php:1153 src/Module/Media/Photo/Upload.php:203 msgid "Wall Photos" msgstr "" @@ -5899,8 +5900,8 @@ msgstr "" #: src/Module/Contact/MatchInterests.php:94 #: src/Module/Media/Attachment/Upload.php:79 #: src/Module/Media/Attachment/Upload.php:84 -#: src/Module/Media/Photo/Upload.php:83 src/Module/Media/Photo/Upload.php:88 -#: src/Module/Media/Photo/Upload.php:137 +#: src/Module/Media/Photo/Upload.php:84 src/Module/Media/Photo/Upload.php:89 +#: src/Module/Media/Photo/Upload.php:138 msgid "Invalid request." msgstr "" @@ -7143,7 +7144,7 @@ msgstr "" #: src/Module/Media/Attachment/Browser.php:79 #: src/Module/Media/Photo/Browser.php:90 -#: src/Module/Settings/Profile/Photo/Index.php:128 +#: src/Module/Settings/Profile/Photo/Index.php:132 msgid "Upload" msgstr "" @@ -9782,7 +9783,7 @@ msgstr "" #: src/Module/Settings/Profile/Photo/Crop.php:107 #: src/Module/Settings/Profile/Photo/Crop.php:125 #: src/Module/Settings/Profile/Photo/Crop.php:143 -#: src/Module/Settings/Profile/Photo/Index.php:101 +#: src/Module/Settings/Profile/Photo/Index.php:105 #, php-format msgid "Image size reduction [%s] failed." msgstr "" @@ -9822,31 +9823,31 @@ msgstr "" msgid "Missing uploaded image." msgstr "" -#: src/Module/Settings/Profile/Photo/Index.php:124 +#: src/Module/Settings/Profile/Photo/Index.php:128 msgid "Profile Picture Settings" msgstr "" -#: src/Module/Settings/Profile/Photo/Index.php:125 +#: src/Module/Settings/Profile/Photo/Index.php:129 msgid "Current Profile Picture" msgstr "" -#: src/Module/Settings/Profile/Photo/Index.php:126 +#: src/Module/Settings/Profile/Photo/Index.php:130 msgid "Upload Profile Picture" msgstr "" -#: src/Module/Settings/Profile/Photo/Index.php:127 +#: src/Module/Settings/Profile/Photo/Index.php:131 msgid "Upload Picture:" msgstr "" -#: src/Module/Settings/Profile/Photo/Index.php:132 +#: src/Module/Settings/Profile/Photo/Index.php:136 msgid "or" msgstr "" -#: src/Module/Settings/Profile/Photo/Index.php:134 +#: src/Module/Settings/Profile/Photo/Index.php:138 msgid "skip this step" msgstr "" -#: src/Module/Settings/Profile/Photo/Index.php:136 +#: src/Module/Settings/Profile/Photo/Index.php:140 msgid "select a photo from your photo albums" msgstr "" From 79235b6db1c9badd6c9602d54ad0d550e4bec2fd Mon Sep 17 00:00:00 2001 From: Marek Bachmann Date: Wed, 30 Nov 2022 05:17:48 +0100 Subject: [PATCH 41/43] Removed redundant maximagesize = INF statements --- mod/photos.php | 4 ---- src/Model/Photo.php | 12 ++---------- src/Module/Media/Photo/Upload.php | 6 +----- src/Module/Settings/Profile/Photo/Index.php | 4 ---- 4 files changed, 3 insertions(+), 23 deletions(-) diff --git a/mod/photos.php b/mod/photos.php index 4436da5d69..14eb88ac95 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -656,10 +656,6 @@ function photos_post(App $a) $maximagesize = Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize')); - if ($maximagesize == 0) { - $maximagesize = INF; - } - if ($maximagesize && ($filesize > $maximagesize)) { DI::sysmsg()->addNotice(DI::l10n()->t('Image exceeds size limit of %s', Strings::formatBytes($maximagesize))); @unlink($src); diff --git a/src/Model/Photo.php b/src/Model/Photo.php index 1250ad570b..126bc152b4 100644 --- a/src/Model/Photo.php +++ b/src/Model/Photo.php @@ -577,11 +577,7 @@ class Photo $filesize = strlen($image->asString()); $maximagesize = Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize')); - if ($maximagesize == 0) { - $maximagesize = INF; - } - - if (!empty($maximagesize) && ($filesize > $maximagesize)) { + if ($maximagesize && ($filesize > $maximagesize)) { Logger::info('Avatar exceeds image limit', ['uid' => $uid, 'cid' => $cid, 'maximagesize' => $maximagesize, 'size' => $filesize, 'type' => $image->getType()]); if ($image->getType() == 'image/gif') { $image->toStatic(); @@ -973,11 +969,7 @@ class Photo $maximagesize = Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize')); - if ($maximagesize == 0) { - $maximagesize = INF; - } - - if (!empty($maximagesize) && ($filesize > $maximagesize)) { + if ($maximagesize && ($filesize > $maximagesize)) { // Scale down to multiples of 640 until the maximum size isn't exceeded anymore foreach ([5120, 2560, 1280, 640] as $pixels) { if (($filesize > $maximagesize) && (max($width, $height) > $pixels)) { diff --git a/src/Module/Media/Photo/Upload.php b/src/Module/Media/Photo/Upload.php index ec8dbcf70d..885aa86147 100644 --- a/src/Module/Media/Photo/Upload.php +++ b/src/Module/Media/Photo/Upload.php @@ -171,11 +171,7 @@ class Upload extends \Friendica\BaseModule $maximagesize = Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize')); - if ($maximagesize == 0) { - $maximagesize = INF; - } - - if (!empty($maximagesize) && $filesize > $maximagesize) { + if ($maximagesize && $filesize > $maximagesize) { // Scale down to multiples of 640 until the maximum size isn't exceeded anymore foreach ([5120, 2560, 1280, 640] as $pixels) { if ($filesize > $maximagesize && max($width, $height) > $pixels) { diff --git a/src/Module/Settings/Profile/Photo/Index.php b/src/Module/Settings/Profile/Photo/Index.php index ee551f88bc..26caae9650 100644 --- a/src/Module/Settings/Profile/Photo/Index.php +++ b/src/Module/Settings/Profile/Photo/Index.php @@ -55,10 +55,6 @@ class Index extends BaseSettings $maximagesize = Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize', 0)); - if ($maximagesize == 0) { - $maximagesize = INF; - } - if ($maximagesize && $filesize > $maximagesize) { DI::sysmsg()->addNotice(DI::l10n()->t('Image exceeds size limit of %s', Strings::formatBytes($maximagesize))); @unlink($src); From f9c0d5a14b475e4bbe2f81ff35bbe91b1eeecfb4 Mon Sep 17 00:00:00 2001 From: MarekBenjamin <117765478+MarekBenjamin@users.noreply.github.com> Date: Wed, 30 Nov 2022 18:16:42 +0100 Subject: [PATCH 42/43] Update src/Module/Media/Photo/Upload.php Co-authored-by: Hypolite Petovan --- src/Module/Media/Photo/Upload.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Module/Media/Photo/Upload.php b/src/Module/Media/Photo/Upload.php index 885aa86147..3a48fa3bc7 100644 --- a/src/Module/Media/Photo/Upload.php +++ b/src/Module/Media/Photo/Upload.php @@ -169,7 +169,7 @@ class Upload extends \Friendica\BaseModule $width = $image->getWidth(); $height = $image->getHeight(); - $maximagesize = Strings::getBytesFromShorthand(DI::config()->get('system', 'maximagesize')); + $maximagesize = Strings::getBytesFromShorthand($this->config->get('system', 'maximagesize')); if ($maximagesize && $filesize > $maximagesize) { // Scale down to multiples of 640 until the maximum size isn't exceeded anymore From e4fd9d425f2254e2536d319c6c47ea04fa4dd535 Mon Sep 17 00:00:00 2001 From: MarekBenjamin <117765478+MarekBenjamin@users.noreply.github.com> Date: Wed, 30 Nov 2022 18:16:55 +0100 Subject: [PATCH 43/43] Update src/Module/Media/Photo/Upload.php Co-authored-by: Hypolite Petovan --- src/Module/Media/Photo/Upload.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Module/Media/Photo/Upload.php b/src/Module/Media/Photo/Upload.php index 3a48fa3bc7..9f6ed34364 100644 --- a/src/Module/Media/Photo/Upload.php +++ b/src/Module/Media/Photo/Upload.php @@ -26,7 +26,6 @@ use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\L10n; use Friendica\Core\Session\Capability\IHandleUserSessions; use Friendica\Database\Database; -use Friendica\DI; use Friendica\Model\Photo; use Friendica\Model\User; use Friendica\Module\BaseApi;