From c6551336c8f4c5c8fe93d8e88be185cb7c8f764b Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Thu, 1 Nov 2018 21:50:36 +0100 Subject: [PATCH 01/10] Fix wrong image resize for some external images --- include/network.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/network.php b/include/network.php index 4c9813768..f976dcc35 100644 --- a/include/network.php +++ b/include/network.php @@ -711,9 +711,9 @@ function scale_external_images($s, $include_link = true, $scale_replace = false) foreach($matches as $mtch) { logger('data: ' . $mtch[2] . ' ' . $mtch[3]); - if(substr($mtch[1],0,1) == '=') { + if(substr($mtch[2],0,1) == '=') { $owidth = intval(substr($mtch[2],1)); - if(intval($owidth) > 0 && intval($owidth) < 1024) + if($owidth > 0 && $owidth < 1024) continue; } From 32c4614a324f07133fee1163fff77aab5e9cc258 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 2 Nov 2018 10:52:52 +0100 Subject: [PATCH 02/10] Workaround for incorrect ISO-8859-5 encoded content conversion --- Zotlabs/Module/Linkinfo.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Zotlabs/Module/Linkinfo.php b/Zotlabs/Module/Linkinfo.php index a0ad17e68..5c3946d4f 100644 --- a/Zotlabs/Module/Linkinfo.php +++ b/Zotlabs/Module/Linkinfo.php @@ -228,8 +228,11 @@ class Linkinfo extends \Zotlabs\Web\Controller { $header = $result['header']; $body = $result['body']; - - $body = mb_convert_encoding($body, 'UTF-8', (preg_match('/meta.+content=["|\']text\/html;\s+charset=([^"|\']+)/i', $body, $o) ? $o[1] : 'UTF-8')); + + $cp = (preg_match('/meta.+content=["|\']text\/html;\s+charset=([^"|\']+)/i', $body, $o) ? $o[1] : 'AUTO'); + if(strtoupper($cp) == 'ISO-8859-5') + $cp = 'AUTO'; + $body = mb_convert_encoding($body, 'UTF-8', $cp); $body = mb_convert_encoding($body, 'HTML-ENTITIES', "UTF-8"); $doc = new \DOMDocument(); From c2e01bedc51b40e16ac64a62d28e56c9bdf593cc Mon Sep 17 00:00:00 2001 From: gia vec Date: Fri, 2 Nov 2018 19:27:11 +0100 Subject: [PATCH 03/10] Update hstrings.php --- view/it/hstrings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/view/it/hstrings.php b/view/it/hstrings.php index 42fc58347..1f5527946 100644 --- a/view/it/hstrings.php +++ b/view/it/hstrings.php @@ -1393,7 +1393,7 @@ App::$strings["This site is powered by \$Projectname"] = "Questo sito è costrui App::$strings["Federated and decentralised networking and identity services provided by Zot"] = ""; App::$strings["Version %s"] = "Versione %s"; App::$strings["Project homepage"] = "Homepage del progetto"; -App::$strings["Developer homepage"] = "Homepege dello sviluppatore"; +App::$strings["Developer homepage"] = "Homepage dello sviluppatore"; App::$strings["No ratings"] = "Nessuna valutazione"; App::$strings["Ratings"] = "Valutazioni"; App::$strings["Rating: "] = "Valutazione:"; From 8235d0bd500c396c06821b7ac1227f4cb7cd398b Mon Sep 17 00:00:00 2001 From: gia vec Date: Fri, 2 Nov 2018 19:41:07 +0100 Subject: [PATCH 04/10] Update hmessages.po --- view/it/hmessages.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/view/it/hmessages.po b/view/it/hmessages.po index fc4772846..94911bc20 100644 --- a/view/it/hmessages.po +++ b/view/it/hmessages.po @@ -5849,7 +5849,7 @@ msgstr "Impossibile creare il menù." #: ../../Zotlabs/Module/Menu.php:98 ../../Zotlabs/Module/Menu.php:110 msgid "Menu Name" -msgstr "Nome del menu" +msgstr "Nome del menù" #: ../../Zotlabs/Module/Menu.php:98 msgid "Unique name (not visible on webpage) - required" @@ -6543,7 +6543,7 @@ msgstr "Homepage del progetto" #: ../../Zotlabs/Module/Siteinfo.php:32 msgid "Developer homepage" -msgstr "Homepege dello sviluppatore" +msgstr "Homepage dello sviluppatore" #: ../../Zotlabs/Module/Ratings.php:70 msgid "No ratings" @@ -6623,7 +6623,7 @@ msgstr "Importazione completata." msgid "" "Channel name changes are not allowed within 48 hours of changing the account" " password." -msgstr "Non è possibile cambiare il nome del canale entro le 48 dal cambio della password dell'account." +msgstr "Non è possibile cambiare il nome del canale entro le 48 ore dal cambio della password dell'account." #: ../../Zotlabs/Module/Changeaddr.php:46 ../../include/channel.php:214 #: ../../include/channel.php:599 From 0d9d0a4b70a2dd73005089f1128f4d6fc10340ce Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 2 Nov 2018 22:37:53 +0100 Subject: [PATCH 05/10] more precise codepage detection --- Zotlabs/Module/Linkinfo.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Zotlabs/Module/Linkinfo.php b/Zotlabs/Module/Linkinfo.php index 5c3946d4f..4bd1deefb 100644 --- a/Zotlabs/Module/Linkinfo.php +++ b/Zotlabs/Module/Linkinfo.php @@ -229,9 +229,11 @@ class Linkinfo extends \Zotlabs\Web\Controller { $header = $result['header']; $body = $result['body']; - $cp = (preg_match('/meta.+content=["|\']text\/html;\s+charset=([^"|\']+)/i', $body, $o) ? $o[1] : 'AUTO'); - if(strtoupper($cp) == 'ISO-8859-5') - $cp = 'AUTO'; + // Check codepage in page or in HTTP headers if not exist + $cp = (preg_match('/meta.+content=["|\']text\/html;\s+charset=([^"|\']+)/i', $body, $o) ? $o[1] : ''); + if(empty($cp) || strtoupper($cp) == 'ISO-8859-5') + $cp = (preg_match('/Content-Type: text\/html;\s+charset=(.+)/im', $header, $o) ? $o[1] : 'AUTO'); + $body = mb_convert_encoding($body, 'UTF-8', $cp); $body = mb_convert_encoding($body, 'HTML-ENTITIES', "UTF-8"); From a9bbe0b12882db9d9c3192c3cd0055a50e9c34d5 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Fri, 2 Nov 2018 22:40:48 +0100 Subject: [PATCH 06/10] Update Linkinfo.php --- Zotlabs/Module/Linkinfo.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Zotlabs/Module/Linkinfo.php b/Zotlabs/Module/Linkinfo.php index 4bd1deefb..6b067f6fd 100644 --- a/Zotlabs/Module/Linkinfo.php +++ b/Zotlabs/Module/Linkinfo.php @@ -230,9 +230,9 @@ class Linkinfo extends \Zotlabs\Web\Controller { $body = $result['body']; // Check codepage in page or in HTTP headers if not exist - $cp = (preg_match('/meta.+content=["|\']text\/html;\s+charset=([^"|\']+)/i', $body, $o) ? $o[1] : ''); + $cp = (preg_match('/meta.+content=["|\']text\/html; charset=([^"|\']+)/i', $body, $o) ? $o[1] : ''); if(empty($cp) || strtoupper($cp) == 'ISO-8859-5') - $cp = (preg_match('/Content-Type: text\/html;\s+charset=(.+)/im', $header, $o) ? $o[1] : 'AUTO'); + $cp = (preg_match('/Content-Type: text\/html; charset=(.+)/im', $header, $o) ? $o[1] : 'AUTO'); $body = mb_convert_encoding($body, 'UTF-8', $cp); $body = mb_convert_encoding($body, 'HTML-ENTITIES', "UTF-8"); From 2f3b4a7aafeaf92d9937aa71acce8e777c46f63d Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Sat, 3 Nov 2018 00:01:15 +0100 Subject: [PATCH 07/10] Update Linkinfo.php --- Zotlabs/Module/Linkinfo.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Zotlabs/Module/Linkinfo.php b/Zotlabs/Module/Linkinfo.php index 6b067f6fd..8ce82f7e9 100644 --- a/Zotlabs/Module/Linkinfo.php +++ b/Zotlabs/Module/Linkinfo.php @@ -229,10 +229,10 @@ class Linkinfo extends \Zotlabs\Web\Controller { $header = $result['header']; $body = $result['body']; - // Check codepage in page or in HTTP headers if not exist - $cp = (preg_match('/meta.+content=["|\']text\/html; charset=([^"|\']+)/i', $body, $o) ? $o[1] : ''); - if(empty($cp) || strtoupper($cp) == 'ISO-8859-5') - $cp = (preg_match('/Content-Type: text\/html; charset=(.+)/im', $header, $o) ? $o[1] : 'AUTO'); + // Check codepage in HTTP headers or HTML if not exist + $cp = trim((preg_match('/Content-Type: text\/html; charset=(.+)/im', $header, $o) ? $o[1] : '')); + if(empty($cp)) + $cp = (preg_match('/meta.+content=["|\']text\/html; charset=([^"|\']+)/i', $body, $o) ? $o[1] : 'AUTO'); $body = mb_convert_encoding($body, 'UTF-8', $cp); $body = mb_convert_encoding($body, 'HTML-ENTITIES', "UTF-8"); From a7624ea48bb89122ef23d59d977642994feb6ad5 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Sat, 3 Nov 2018 00:10:05 +0100 Subject: [PATCH 08/10] Update Linkinfo.php --- Zotlabs/Module/Linkinfo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zotlabs/Module/Linkinfo.php b/Zotlabs/Module/Linkinfo.php index 8ce82f7e9..623b574af 100644 --- a/Zotlabs/Module/Linkinfo.php +++ b/Zotlabs/Module/Linkinfo.php @@ -230,7 +230,7 @@ class Linkinfo extends \Zotlabs\Web\Controller { $body = $result['body']; // Check codepage in HTTP headers or HTML if not exist - $cp = trim((preg_match('/Content-Type: text\/html; charset=(.+)/im', $header, $o) ? $o[1] : '')); + $cp = (preg_match('/Content-Type: text\/html; charset=(.+)/i', $header, $o) ? trim($o[1]) : ''); if(empty($cp)) $cp = (preg_match('/meta.+content=["|\']text\/html; charset=([^"|\']+)/i', $body, $o) ? $o[1] : 'AUTO'); From 46b0510b994fb885cd3c64b703ce73c2cee6d6c1 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Sat, 3 Nov 2018 10:41:31 +0100 Subject: [PATCH 09/10] Update Linkinfo.php --- Zotlabs/Module/Linkinfo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zotlabs/Module/Linkinfo.php b/Zotlabs/Module/Linkinfo.php index 623b574af..670967370 100644 --- a/Zotlabs/Module/Linkinfo.php +++ b/Zotlabs/Module/Linkinfo.php @@ -230,7 +230,7 @@ class Linkinfo extends \Zotlabs\Web\Controller { $body = $result['body']; // Check codepage in HTTP headers or HTML if not exist - $cp = (preg_match('/Content-Type: text\/html; charset=(.+)/i', $header, $o) ? trim($o[1]) : ''); + $cp = (preg_match('/Content-Type: text\/html; charset=(.+)\r\n/i', $header, $o) ? $o[1] : ''); if(empty($cp)) $cp = (preg_match('/meta.+content=["|\']text\/html; charset=([^"|\']+)/i', $body, $o) ? $o[1] : 'AUTO'); From 71425c3b23fbb905fd4a9a7dca6961d1c5c1c3e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Jim=C3=A9nez=20Friaza?= Date: Sat, 3 Nov 2018 19:19:01 +0100 Subject: [PATCH 10/10] Fixed typo at view/es-es/hstrings.php --- view/es-es/hstrings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/view/es-es/hstrings.php b/view/es-es/hstrings.php index 6daac9592..2024504a1 100644 --- a/view/es-es/hstrings.php +++ b/view/es-es/hstrings.php @@ -5,7 +5,7 @@ function string_plural_select_es_es($n){ return ($n != 1);; }} App::$rtl = 0; -App::$strings["plural_function_code"] = "(n != 1);"; +App::$strings["plural_function_code"] = "(n != 1)"; App::$strings["Can view my channel stream and posts"] = "Pueden verse la actividad y publicaciones de mi canal"; App::$strings["Can send me their channel stream and posts"] = "Se me pueden enviar entradas y contenido de un canal"; App::$strings["Can view my default channel profile"] = "Puede verse mi perfil de canal predeterminado.";