From d7c7ff1c12b5d46c71a0aa2421a71b27d36f52d2 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sat, 15 Dec 2018 17:19:29 +0000 Subject: [PATCH 01/24] fix wiki preview issue with hyperlinks (cherry picked from commit 919ea9f750fbb665a655cd26ae86c00e424a4318) --- Zotlabs/Module/Wiki.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Zotlabs/Module/Wiki.php b/Zotlabs/Module/Wiki.php index 892810241..502f96a62 100644 --- a/Zotlabs/Module/Wiki.php +++ b/Zotlabs/Module/Wiki.php @@ -442,8 +442,8 @@ class Wiki extends Controller { $mimeType = $_POST['mimetype']; if($mimeType === 'text/bbcode') { - $linkconverted = NativeWikiPage::convert_links($content,$wikiURL); - $html = zidify_links(smilies(bbcode($linkconverted))); + $html = zidify_links(smilies(bbcode($content))); + $html = NativeWikiPage::convert_links($html,$wikiURL); } elseif($mimeType === 'text/markdown') { $linkconverted = NativeWikiPage::convert_links($content,$wikiURL); From 8323458da9896e440ded61cabf3fe0ce1a981341 Mon Sep 17 00:00:00 2001 From: "DM42.Net (Matt Dent)" Date: Fri, 14 Dec 2018 14:55:27 +0000 Subject: [PATCH 02/24] ARTICLES MODULE: Default to local_channel() user when no argv(1) is passed. (cherry picked from commit 3f06a857c27344263d4a361e367738e85fc30af6) --- Zotlabs/Module/Articles.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Zotlabs/Module/Articles.php b/Zotlabs/Module/Articles.php index 58c16be45..bc6c00483 100644 --- a/Zotlabs/Module/Articles.php +++ b/Zotlabs/Module/Articles.php @@ -17,8 +17,14 @@ class Articles extends Controller { if(argc() > 1) $which = argv(1); - else - return; + + if(! $which) { + if(local_channel()) { + $channel = App::get_channel(); + if($channel && $channel['channel_address']) + $which = $channel['channel_address']; + } + } profile_load($which); From aabc6c282560a67c7232bc7545a93e71831c04e8 Mon Sep 17 00:00:00 2001 From: "DM42.Net (Matt Dent)" Date: Sun, 16 Dec 2018 00:49:59 +0000 Subject: [PATCH 03/24] Add return if no local_channel() (cherry picked from commit 5bcc379530e6789f59397dc39f4da66cc8c5b2ae) --- Zotlabs/Module/Articles.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Zotlabs/Module/Articles.php b/Zotlabs/Module/Articles.php index bc6c00483..ca132c01e 100644 --- a/Zotlabs/Module/Articles.php +++ b/Zotlabs/Module/Articles.php @@ -23,7 +23,9 @@ class Articles extends Controller { $channel = App::get_channel(); if($channel && $channel['channel_address']) $which = $channel['channel_address']; - } + } else { + return; + } } profile_load($which); From 06c71eec659e4cce89a7623291e6e855fd0c0ce4 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sun, 16 Dec 2018 22:38:58 +0000 Subject: [PATCH 04/24] default curl to http/1.1 (cherry picked from commit 04a45a407ead8e7afcdd3423b773074207e885df) --- include/network.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/include/network.php b/include/network.php index d37da05f7..a9a7cd03e 100644 --- a/include/network.php +++ b/include/network.php @@ -116,6 +116,14 @@ function z_fetch_url($url, $binary = false, $redirects = 0, $opts = array()) { @curl_setopt($ch, CURLOPT_USERPWD, $opts['http_auth']); } + if(array_key_exists('http_version',$opts)) { + @curl_setopt($ch,CURLOPT_HTTP_VERSION,$opts['http_version']); + } + else { + @curl_setopt($ch,CURLOPT_HTTP_VERSION,CURL_HTTP_VERSION_1_1); + } + + if(x($opts,'cookiejar')) @curl_setopt($ch, CURLOPT_COOKIEJAR, $opts['cookiejar']); if(x($opts,'cookiefile')) @@ -286,6 +294,13 @@ function z_post_url($url, $params, $redirects = 0, $opts = array()) { @curl_setopt($ch, CURLOPT_USERPWD, $opts['http_auth']); } + if(array_key_exists('http_version',$opts)) { + @curl_setopt($ch,CURLOPT_HTTP_VERSION,$opts['http_version']); + } + else { + @curl_setopt($ch,CURLOPT_HTTP_VERSION,CURL_HTTP_VERSION_1_1); + } + if(x($opts,'cookiejar')) @curl_setopt($ch, CURLOPT_COOKIEJAR, $opts['cookiejar']); if(x($opts,'cookiefile')) From d0ee6d1ad23bb265b5f2b17300fd8d7228701cfa Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 20 Dec 2018 18:45:11 +0000 Subject: [PATCH 05/24] missing observer check (cherry picked from commit ec769bc9f948956a8093c675a14970461c5d8304) --- Zotlabs/Module/Like.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Zotlabs/Module/Like.php b/Zotlabs/Module/Like.php index 4e216f08b..8873954e4 100644 --- a/Zotlabs/Module/Like.php +++ b/Zotlabs/Module/Like.php @@ -249,6 +249,9 @@ class Like extends \Zotlabs\Web\Controller { } } else { + + if(! $observer) + killme(); // this is used to like an item or comment From 5f5746a2f68cf5fee500478e3049c1a810b71915 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 20 Dec 2018 19:06:52 +0000 Subject: [PATCH 06/24] like permission issue (cherry picked from commit 389b4beba47823ebc0549ee8d7c0549c27b73b7a) --- Zotlabs/Module/Like.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zotlabs/Module/Like.php b/Zotlabs/Module/Like.php index 8873954e4..fd192538e 100644 --- a/Zotlabs/Module/Like.php +++ b/Zotlabs/Module/Like.php @@ -50,7 +50,7 @@ class Like extends \Zotlabs\Web\Controller { $observer = \App::get_observer(); $interactive = $_REQUEST['interactive']; - if($interactive) { + if((! $observer) || ($interactive)) { $o .= '

' . t('Like/Dislike') . '

'; $o .= EOL . EOL; From 5ec1e97cae429e2554e89f6df9a704b3ddd36993 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 21 Dec 2018 11:51:19 +0000 Subject: [PATCH 07/24] do not add timestamp to the photo src. caching is handled in mod photo now. (cherry picked from commit e34853e19ea10bde7a4dc2e585da3c26d7032bdb) --- Zotlabs/Module/Photos.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zotlabs/Module/Photos.php b/Zotlabs/Module/Photos.php index b87c586da..3833d5088 100644 --- a/Zotlabs/Module/Photos.php +++ b/Zotlabs/Module/Photos.php @@ -988,7 +988,7 @@ class Photos extends \Zotlabs\Web\Controller { $photo = array( 'href' => z_root() . '/photo/' . $hires['resource_id'] . '-' . $hires['imgscale'] . '.' . $phototypes[$hires['mimetype']], 'title'=> t('View Full Size'), - 'src' => z_root() . '/photo/' . $lores['resource_id'] . '-' . $lores['imgscale'] . '.' . $phototypes[$lores['mimetype']] . '?f=&_u=' . datetime_convert('','','','ymdhis') + 'src' => z_root() . '/photo/' . $lores['resource_id'] . '-' . $lores['imgscale'] . '.' . $phototypes[$lores['mimetype']] ); if($nextlink) From 19952264c8eee9cb5a9dac9642bfd28fc34d91df Mon Sep 17 00:00:00 2001 From: "M. Dent" Date: Wed, 19 Dec 2018 09:12:59 +0000 Subject: [PATCH 08/24] Add reload to util/addons (cherry picked from commit 0e5d76e7359d3f38b971138069a239ae4ef171eb) --- util/addons | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/util/addons b/util/addons index 3d772bf73..7bd70984e 100755 --- a/util/addons +++ b/util/addons @@ -10,6 +10,7 @@ echo <<< EOT util/addons list all # list all addons (*)= installed, (!)= disabled due to version compatibility util/addons install foo # install addon named 'foo' util/addons uninstall foo # uninstall addon named 'foo' + util/addons reinstall # reinstall all plugins EOT; } @@ -68,6 +69,20 @@ if($argc == 2 && $argv[1] === 'list') { killme(); } +if($argc == 2 && $argv[1] === 'reinstall') { + require_once("include/plugin.php"); + if($plugins) { + foreach($plugins as $p) { + if($p[1]) { + echo "Reinstall: ". $p[0] . "\n"; + uninstall_plugin($p[0]); + install_plugin($p[0]); + } + } + } + killme(); +} + if($argc == 3 && $argv[1] === 'list' && $argv[2] === 'all') { if($plugins) { From 0e32c86c3dd5bf7ec43ed974d54c2928bcb5e2fe Mon Sep 17 00:00:00 2001 From: Pascal Deklerck Date: Sat, 15 Dec 2018 21:19:18 +0000 Subject: [PATCH 09/24] Update OAuth2Storage.php - fix email retrieval in getUser (cherry picked from commit 6a825cc504901b6c09724e487f43b5012805c6a0) --- Zotlabs/Identity/OAuth2Storage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zotlabs/Identity/OAuth2Storage.php b/Zotlabs/Identity/OAuth2Storage.php index bbf61cf2b..a4ba9c526 100644 --- a/Zotlabs/Identity/OAuth2Storage.php +++ b/Zotlabs/Identity/OAuth2Storage.php @@ -64,7 +64,7 @@ class OAuth2Storage extends \OAuth2\Storage\Pdo { return( [ 'webfinger' => channel_reddress($x), 'portable_id' => $x['channel_hash'], - 'email' => $a['account_email'], + 'email' => $a[0]['account_email'], 'username' => $x['channel_address'], 'user_id' => $x['channel_id'], 'name' => $x['channel_name'], From c85534635890dab0497977a5beb9aa17f4510821 Mon Sep 17 00:00:00 2001 From: phani00 Date: Mon, 17 Dec 2018 10:08:45 +0000 Subject: [PATCH 10/24] remove my dark theme fixes. (cherry picked from commit 70a766171117fd94c7e0ca228d3b879f7f307e5f) --- view/theme/redbasic/schema/dark.css | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/view/theme/redbasic/schema/dark.css b/view/theme/redbasic/schema/dark.css index e958d9ee7..c00ddca90 100644 --- a/view/theme/redbasic/schema/dark.css +++ b/view/theme/redbasic/schema/dark.css @@ -322,7 +322,9 @@ a, a:visited, a:link, .fakelink, .fakelink:visited, .fakelink:link { .text-dark { color: #aaa !important; } -a.text-dark:focus, a.text-dark:hover { + +/* phani: fix 1 */ +/*a.text-dark:focus, a.text-dark:hover { color: #ddd !important; } @@ -335,7 +337,8 @@ a.text-dark:focus, a.text-dark:hover { .badge-warning a.text-dark:focus, .badge-warning a.text-dark:hover { color: red !important; text-decoration: none; -} +}*/ + .group-selected, .fileas-selected, .categories-selected, .search-selected, a.active { color: #fff !important; @@ -492,10 +495,10 @@ pre { background-color: #222; } +/* phani: fix 2 */ /* change color of [hl] tag: */ -div.wall-item-body span /*strong:only-of-type */{ +/*div.wall-item-body span { color: #1212b6; padding: 2px 3px; -/* font-weight: 500; */ white-space: nowrap; -} +}*/ From 66b56416b6ad40a682395d26398535508ef79022 Mon Sep 17 00:00:00 2001 From: phani00 Date: Mon, 17 Dec 2018 15:28:15 +0000 Subject: [PATCH 11/24] new fix for dark theme change implementation of hl-tags in include/bbcode.php insert class='default-highlight' instead of background-color: 'yellow' into span add span.default-highlight definition to view/theme/redbasic/css/style.css this works for all schemas incl. dark. (cherry picked from commit aace8a14cee2f173b7a11bb2bfcbcebbe0084863) --- include/bbcode.php | 3 ++- view/theme/redbasic/css/style.css | 10 ++++++++ view/theme/redbasic/schema/dark.css | 40 ++++++++++++----------------- 3 files changed, 28 insertions(+), 25 deletions(-) diff --git a/include/bbcode.php b/include/bbcode.php index c5d6ef998..a0d41ccf0 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -1021,7 +1021,8 @@ function bbcode($Text, $options = []) { } // Check for colored text if (strpos($Text,'[/hl]') !== false) { - $Text = preg_replace("(\[hl\](.*?)\[\/hl\])ism", "$1", $Text); + $Text = preg_replace("(\[hl\](.*?)\[\/hl\])ism", "$1", $Text); +// $Text = preg_replace("(\[hl\](.*?)\[\/hl\])ism", "$1", $Text); $Text = preg_replace("(\[hl=(.*?)\](.*?)\[\/hl\])ism", "$2", $Text); } diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index f2c1b7a48..ba0cc7cd2 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -1803,3 +1803,13 @@ dl.bb-dl > dd > li { .hover-fx-show:hover .hover-fx-hide { opacity: 1; } + +/* default highlighted text if not specified by schema: */ +span.default-highlight { + background-color: yellow; + color: #111; + margin: 0 2px; + padding: 2px 4px 2px 5px; + border-radius: 4px; + white-space: nowrap; +} diff --git a/view/theme/redbasic/schema/dark.css b/view/theme/redbasic/schema/dark.css index c00ddca90..a0b9b12d3 100644 --- a/view/theme/redbasic/schema/dark.css +++ b/view/theme/redbasic/schema/dark.css @@ -323,23 +323,6 @@ a, a:visited, a:link, .fakelink, .fakelink:visited, .fakelink:link { color: #aaa !important; } -/* phani: fix 1 */ -/*a.text-dark:focus, a.text-dark:hover { - color: #ddd !important; -} - -.badge-warning { - background-color: #ffc927; -} -.badge-warning a.text-dark { - color: #333 !important; -} -.badge-warning a.text-dark:focus, .badge-warning a.text-dark:hover { - color: red !important; - text-decoration: none; -}*/ - - .group-selected, .fileas-selected, .categories-selected, .search-selected, a.active { color: #fff !important; text-decoration: underline !important; @@ -495,10 +478,19 @@ pre { background-color: #222; } -/* phani: fix 2 */ -/* change color of [hl] tag: */ -/*div.wall-item-body span { - color: #1212b6; - padding: 2px 3px; - white-space: nowrap; -}*/ + +/* category badge fix: */ +a.text-dark:focus, a.text-dark:hover { + color: #ddd !important; +} + +.badge-warning { +/* background-color: #ffc927; */ +} +.badge-warning a.text-dark { + color: #333 !important; +} +.badge-warning a.text-dark:focus, .badge-warning a.text-dark:hover { + color: red !important; + text-decoration: none; +} From 163754a46ccf81bfd22fa53751e875751130aeed Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Tue, 18 Dec 2018 09:43:06 +0000 Subject: [PATCH 12/24] make mod channel deal with b64 encoded mid\s ; (cherry picked from commit bc6d384ca91bf754c10ead1d787bf1452c20e9d4) --- Zotlabs/Module/Channel.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Zotlabs/Module/Channel.php b/Zotlabs/Module/Channel.php index f1537ed15..5f221ef20 100644 --- a/Zotlabs/Module/Channel.php +++ b/Zotlabs/Module/Channel.php @@ -80,6 +80,11 @@ class Channel extends Controller { $mid = ((x($_REQUEST,'mid')) ? $_REQUEST['mid'] : ''); + if(strpos($mid,'b64.') === 0) + $decoded = @base64url_decode(substr($mid,4)); + if($decoded) + $mid = $decoded; + $datequery = ((x($_GET,'dend') && is_a_date_arg($_GET['dend'])) ? notags($_GET['dend']) : ''); $datequery2 = ((x($_GET,'dbegin') && is_a_date_arg($_GET['dbegin'])) ? notags($_GET['dbegin']) : ''); @@ -331,6 +336,9 @@ class Channel extends Controller { if((! $update) && (! $load)) { + if($decoded) + $mid = 'b64.' . base64url_encode($mid); + // This is ugly, but we can't pass the profile_uid through the session to the ajax updater, // because browser prefetching might change it on us. We have to deliver it with the page. From 4d47b098e5f643b985f53309815d0f27f8933d51 Mon Sep 17 00:00:00 2001 From: phani00 Date: Tue, 18 Dec 2018 11:37:51 +0000 Subject: [PATCH 13/24] remove some fancy formatting. (cherry picked from commit aaab905e726c126a36453f4ae08c39c3045bf412) --- include/bbcode.php | 1 - view/theme/redbasic/css/style.css | 4 ---- 2 files changed, 5 deletions(-) diff --git a/include/bbcode.php b/include/bbcode.php index a0d41ccf0..817986da0 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -1022,7 +1022,6 @@ function bbcode($Text, $options = []) { // Check for colored text if (strpos($Text,'[/hl]') !== false) { $Text = preg_replace("(\[hl\](.*?)\[\/hl\])ism", "$1", $Text); -// $Text = preg_replace("(\[hl\](.*?)\[\/hl\])ism", "$1", $Text); $Text = preg_replace("(\[hl=(.*?)\](.*?)\[\/hl\])ism", "$2", $Text); } diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index ba0cc7cd2..c7948cad1 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -1808,8 +1808,4 @@ dl.bb-dl > dd > li { span.default-highlight { background-color: yellow; color: #111; - margin: 0 2px; - padding: 2px 4px 2px 5px; - border-radius: 4px; - white-space: nowrap; } From 4256bea41835384ea8a334883b24512713a03859 Mon Sep 17 00:00:00 2001 From: phani00 Date: Tue, 18 Dec 2018 13:02:50 +0000 Subject: [PATCH 14/24] change hl text color to the default text color in non-dark schema. looks good, except in dark, where i can change it in dark.css. (cherry picked from commit b97143e9db5c002145e2811cad4a1e12a9eaa259) --- view/theme/redbasic/css/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index c7948cad1..303987c53 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -1807,5 +1807,5 @@ dl.bb-dl > dd > li { /* default highlighted text if not specified by schema: */ span.default-highlight { background-color: yellow; - color: #111; + color: #4d4d4d; } From feda1e6d84dc04341f8c348ac53c103fd97e8303 Mon Sep 17 00:00:00 2001 From: phani00 Date: Tue, 18 Dec 2018 16:54:39 +0000 Subject: [PATCH 15/24] remove color from style.css (default) but add a little padding; add color & border radius to dark.css. (cherry picked from commit 2354bb5427d5d6b384c2e5b0f8fb9e676249e77b) --- view/theme/redbasic/css/style.css | 2 +- view/theme/redbasic/schema/dark.css | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index 303987c53..b406e710c 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -1807,5 +1807,5 @@ dl.bb-dl > dd > li { /* default highlighted text if not specified by schema: */ span.default-highlight { background-color: yellow; - color: #4d4d4d; + padding: 2px 4px; } diff --git a/view/theme/redbasic/schema/dark.css b/view/theme/redbasic/schema/dark.css index a0b9b12d3..bf55fec72 100644 --- a/view/theme/redbasic/schema/dark.css +++ b/view/theme/redbasic/schema/dark.css @@ -494,3 +494,9 @@ a.text-dark:focus, a.text-dark:hover { color: red !important; text-decoration: none; } + +/* fix color for highlithed text */ +span.default-highlight { + color: #333; + border-radius: 4px; +} From a09beb38335d3dff6d4d414027791a30a1cef684 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Mon, 17 Dec 2018 12:28:18 +0000 Subject: [PATCH 16/24] Remove scale_external_images() (cherry picked from commit a2959c6e9e795c0c8c6e87b70d8d0a935ae272f9) --- include/markdown.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/markdown.php b/include/markdown.php index 64f0a0854..2513a7d77 100644 --- a/include/markdown.php +++ b/include/markdown.php @@ -91,8 +91,6 @@ function markdown_to_bb($s, $use_zrl = false, $options = []) { // remove duplicate adjacent code tags $s = preg_replace("/(\[code\])+(.*?)(\[\/code\])+/ism","[code]$2[/code]", $s); - // Don't show link to full picture (until it is fixed) - $s = scale_external_images($s, false); /** * @hooks markdown_to_bb From 01448c152c95bdb90b429710498d034f127983d1 Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Mon, 17 Dec 2018 12:28:58 +0000 Subject: [PATCH 17/24] Remove scale_external_images() (cherry picked from commit 1541f67eab5f541d1f61001fc4e42132a9ac09f8) --- include/network.php | 93 --------------------------------------------- 1 file changed, 93 deletions(-) diff --git a/include/network.php b/include/network.php index a9a7cd03e..5f45d8eb8 100644 --- a/include/network.php +++ b/include/network.php @@ -705,99 +705,6 @@ function sxml2array ( $xmlObject, $out = array () ) } -/** - * @brief Scales an external image. - * - * @param string $s - * @param string $include_link default true - * @param string $scale_replace default false - * @return string - */ -function scale_external_images($s, $include_link = true, $scale_replace = false) { - - // Picture addresses can contain special characters - $s = htmlspecialchars_decode($s, ENT_COMPAT); - - $matches = null; - $c = preg_match_all('/\[([zi])mg(.*?)\](.*?)\[\/[zi]mg\]/ism', $s, $matches, PREG_SET_ORDER); - if($c) { - require_once('include/photo/photo_driver.php'); - - foreach($matches as $mtch) { - logger('data: ' . $mtch[2] . ' ' . $mtch[3]); - - if(substr($mtch[2],0,1) == '=') { - $owidth = intval(substr($mtch[2],1)); - if($owidth > 0 && $owidth < 1024) - continue; - } - - $hostname = str_replace('www.','',substr(z_root(),strpos(z_root(),'://')+3)); - if(stristr($mtch[3],$hostname)) - continue; - - // $scale_replace, if passed, is an array of two elements. The - // first is the name of the full-size image. The second is the - // name of a remote, scaled-down version of the full size image. - // This allows Friendica to display the smaller remote image if - // one exists, while still linking to the full-size image - if($scale_replace) - $scaled = str_replace($scale_replace[0], $scale_replace[1], $mtch[3]); - else - $scaled = $mtch[3]; - - if(! strpbrk(substr($scaled, 0, 1), 'zhfmt')) - continue; - - $i = z_fetch_url($scaled, true); - - $cache = get_config('system', 'itemcache'); - if (($cache != '') and is_dir($cache)) { - $cachefile = $cache . '/' . hash('md5', $scaled); - file_put_contents($cachefile, $i['body']); - } - - // guess mimetype from headers or filename - - $type = guess_image_type($mtch[3], $i['header']); - if(strpos($type, 'image') === false) - continue; - - if($i['success']) { - $ph = photo_factory($i['body'], $type); - - if(! is_object($ph)) - continue; - - if($ph->is_valid()) { - $orig_width = $ph->getWidth(); - $orig_height = $ph->getHeight(); - - if($orig_width > 1024 || $orig_height > 1024) { - $tag = (($match[1] == 'z') ? 'zmg' : 'img'); - $linktag = (($match[1] == 'z') ? 'zrl' : 'url'); - $ph->scaleImage(1024); - $new_width = $ph->getWidth(); - $new_height = $ph->getHeight(); - logger('data: ' . $orig_width . '->' . $new_width . 'w ' . $orig_height . '->' . $new_height . 'h' . ' match: ' . $mtch[0], LOGGER_DEBUG); - $s = str_replace($mtch[0],'[' . $tag . '=' . $new_width . 'x' . $new_height. ']' . $scaled . '[/' . $tag . ']' - . "\n" . (($include_link) - ? '[' . $linktag . '=' . $mtch[3] . ']' . t('view full size') . '[/' . $linktag . ']' . "\n" - : ''),$s); - logger('new string: ' . $s, LOGGER_DEBUG); - } - } - } - } - } - - // replace the special char encoding - - $s = htmlspecialchars($s, ENT_COMPAT, 'UTF-8'); - - return $s; -} - /** * @brief xml2array() will convert the given XML text to an array in the XML structure. * From 04a2dc075f23a5fafba1f1ce74e49ece98ea73e0 Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 22 Dec 2018 20:08:44 +0100 Subject: [PATCH 18/24] manualy remove scale_external_images() due to merge conflicts --- include/text.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/text.php b/include/text.php index 29daa74e8..5add633a2 100644 --- a/include/text.php +++ b/include/text.php @@ -3331,8 +3331,6 @@ function cleanup_bbcode($body) { $body = preg_replace('/\[\/code\]\s*\[code\]/ism',"\n",$body); - $body = scale_external_images($body,false); - return $body; } From 880b22604badd278a5aff92fff499eb96d0c060a Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 22 Dec 2018 20:17:20 +0100 Subject: [PATCH 19/24] manualy Fix cURL with HTTP/2 due to merge conflicts --- include/network.php | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/include/network.php b/include/network.php index 5f45d8eb8..63fe9d9c4 100644 --- a/include/network.php +++ b/include/network.php @@ -116,13 +116,8 @@ function z_fetch_url($url, $binary = false, $redirects = 0, $opts = array()) { @curl_setopt($ch, CURLOPT_USERPWD, $opts['http_auth']); } - if(array_key_exists('http_version',$opts)) { + if(array_key_exists('http_version',$opts)) @curl_setopt($ch,CURLOPT_HTTP_VERSION,$opts['http_version']); - } - else { - @curl_setopt($ch,CURLOPT_HTTP_VERSION,CURL_HTTP_VERSION_1_1); - } - if(x($opts,'cookiejar')) @curl_setopt($ch, CURLOPT_COOKIEJAR, $opts['cookiejar']); @@ -161,7 +156,7 @@ function z_fetch_url($url, $binary = false, $redirects = 0, $opts = array()) { // Pull out multiple headers, e.g. proxy and continuation headers // allow for HTTP/2.x without fixing code - while(preg_match('/^HTTP\/[1-2].+? [1-5][0-9][0-9]/',$base)) { + while(preg_match('/^HTTP\/[1-3](\.\d)? [1-5][0-9][0-9]/',$base)) { $chunk = substr($base,0,strpos($base,"\r\n\r\n")+4); $header .= $chunk; $base = substr($base,strlen($chunk)); @@ -294,12 +289,8 @@ function z_post_url($url, $params, $redirects = 0, $opts = array()) { @curl_setopt($ch, CURLOPT_USERPWD, $opts['http_auth']); } - if(array_key_exists('http_version',$opts)) { + if(array_key_exists('http_version',$opts)) @curl_setopt($ch,CURLOPT_HTTP_VERSION,$opts['http_version']); - } - else { - @curl_setopt($ch,CURLOPT_HTTP_VERSION,CURL_HTTP_VERSION_1_1); - } if(x($opts,'cookiejar')) @curl_setopt($ch, CURLOPT_COOKIEJAR, $opts['cookiejar']); @@ -333,8 +324,7 @@ function z_post_url($url, $params, $redirects = 0, $opts = array()) { // Pull out multiple headers, e.g. proxy and continuation headers // allow for HTTP/2.x without fixing code - - while(preg_match('/^HTTP\/[1-2].+? [1-5][0-9][0-9]/',$base)) { + while(preg_match('/^HTTP\/[1-3](\.\d)? [1-5][0-9][0-9]/',$base)) { $chunk = substr($base,0,strpos($base,"\r\n\r\n")+4); $header .= $chunk; $base = substr($base,strlen($chunk)); From 0bfda6d4c85cb90ef4e29f8f69995a69794a616e Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sat, 22 Dec 2018 18:47:46 +0000 Subject: [PATCH 20/24] revert padding for text highlight. It is messing with indent punctuation and decreases legibility of the highlighted text. (cherry picked from commit fac3579fb0124a13c5066c660e8a2bd89ed1e144) --- view/theme/redbasic/css/style.css | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index b406e710c..18c3db665 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -1806,6 +1806,5 @@ dl.bb-dl > dd > li { /* default highlighted text if not specified by schema: */ span.default-highlight { - background-color: yellow; - padding: 2px 4px; + background-color: yellow; } From 1b5175d01834796ee80134fd214ada71dd409dbd Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 19 Dec 2018 09:05:18 +0000 Subject: [PATCH 21/24] check if we deal with an array before sizeof() (cherry picked from commit 339c9cceeca1e9b54aa320aea48d164d1cc22e36) --- Zotlabs/Module/Linkinfo.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Zotlabs/Module/Linkinfo.php b/Zotlabs/Module/Linkinfo.php index 7c7dc0e88..8b7defa39 100644 --- a/Zotlabs/Module/Linkinfo.php +++ b/Zotlabs/Module/Linkinfo.php @@ -138,8 +138,8 @@ class Linkinfo extends \Zotlabs\Web\Controller { } $image = ""; - - if(sizeof($siteinfo["images"]) > 0){ + + if(is_array($siteinfo["images"]) && (sizeof($siteinfo["images"]) > 0)){ /* Execute below code only if image is present in siteinfo */ $total_images = 0; @@ -161,7 +161,7 @@ class Linkinfo extends \Zotlabs\Web\Controller { $total_images ++; if($max_images && $max_images >= $total_images) break; - } + } } if(strlen($text)) { From 4f08f4b84cae885dc3ce37be7761546fddeb311c Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 19 Dec 2018 10:08:28 +0000 Subject: [PATCH 22/24] use count() instead of sizeof() (cherry picked from commit 774dd6d5e333ac1988f1f3d830627cd7af68908e) --- 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 8b7defa39..32b4c0281 100644 --- a/Zotlabs/Module/Linkinfo.php +++ b/Zotlabs/Module/Linkinfo.php @@ -139,7 +139,7 @@ class Linkinfo extends \Zotlabs\Web\Controller { $image = ""; - if(is_array($siteinfo["images"]) && (sizeof($siteinfo["images"]) > 0)){ + if(is_array($siteinfo["images"]) && count($siteinfo["images"])){ /* Execute below code only if image is present in siteinfo */ $total_images = 0; From fca464071f51042872fd472b30604a54a60109f8 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sat, 22 Dec 2018 20:00:01 +0000 Subject: [PATCH 23/24] update changelog (cherry picked from commit cdb85f130933b2abe9da80119696f5d1d55bebc4) --- CHANGELOG | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index a3dd1336b..5d0f35cc1 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,21 @@ +Hubzilla 3.8.8 (2018-12-22) + - Fix issue with linkinfo + - Fix cURL with HTTP/2 + - Remove scale_external_images() + - Style highlight bbcode via css + - Make mod channel deal with b64 encoded mid's + - Fix email retrieval in OAuth2Storage + - Add reinstall option to util/addons + - Remove deprecated caching protection from mod photo + - Add missing check for observer in mod like + - Articles: default to logged in channel if channel name is not passed + - Wiki: fix preview issue with hyperlinks + - Cart: backport fixes from osada + - Gallery: provide file extensions for better compatibility + - Hsse: fix issue when linkinfo data was inserted + - Diaspora: remove deprecated scale_external_images() + + Hubzilla 3.8.7 (2018-12-14) - Fix issue with linkdropper in comment area - Fix regression wit app ordering From 414b7e28d33e12692401c0babacbb3461160e270 Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 22 Dec 2018 21:02:49 +0100 Subject: [PATCH 24/24] bump version --- boot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boot.php b/boot.php index 73ed18bd7..2530feeca 100755 --- a/boot.php +++ b/boot.php @@ -50,7 +50,7 @@ require_once('include/attach.php'); require_once('include/bbcode.php'); define ( 'PLATFORM_NAME', 'hubzilla' ); -define ( 'STD_VERSION', '3.8.7' ); +define ( 'STD_VERSION', '3.8.8' ); define ( 'ZOT_REVISION', '6.0a' ); define ( 'DB_UPDATE_VERSION', 1225 );