From 9bdaa8092efa79575b4cec818f4b453cabe9be28 Mon Sep 17 00:00:00 2001 From: Philipp Date: Thu, 12 Oct 2023 21:33:03 +0200 Subject: [PATCH 1/3] Upgrade phpunit version in PHP-CI --- .woodpecker/.phpunit.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.woodpecker/.phpunit.yml b/.woodpecker/.phpunit.yml index 893d433a..f198ba2a 100644 --- a/.woodpecker/.phpunit.yml +++ b/.woodpecker/.phpunit.yml @@ -5,11 +5,11 @@ matrix: - PHP_MAJOR_VERSION: 7.4 PHP_VERSION: 7.4.33 - PHP_MAJOR_VERSION: 8.0 - PHP_VERSION: 8.0.29 + PHP_VERSION: 8.0.30 - PHP_MAJOR_VERSION: 8.1 - PHP_VERSION: 8.1.21 + PHP_VERSION: 8.1.23 - PHP_MAJOR_VERSION: 8.2 - PHP_VERSION: 8.2.8 + PHP_VERSION: 8.2.11 # This forces PHP Unit executions at the "opensocial" labeled location (because of much more power...) labels: From 6948a15f1c5563928e5e2a108621038ce4bdb76a Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 18 Oct 2023 20:16:59 +0000 Subject: [PATCH 2/3] Langfilter: Use two letter code for the language / Bluesky: Remove callstack --- bluesky/bluesky.php | 5 ++--- langfilter/langfilter.php | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/bluesky/bluesky.php b/bluesky/bluesky.php index 6e6ad609..2d497e8c 100644 --- a/bluesky/bluesky.php +++ b/bluesky/bluesky.php @@ -32,7 +32,6 @@ use Friendica\Core\Hook; use Friendica\Core\Logger; use Friendica\Core\Protocol; use Friendica\Core\Renderer; -use Friendica\Core\System; use Friendica\Core\Worker; use Friendica\Database\DBA; use Friendica\DI; @@ -1235,7 +1234,7 @@ function bluesky_add_media(stdClass $embed, array $item, int $fetch_uid, int $le function bluesky_get_uri(stdClass $post): string { if (empty($post->cid)) { - Logger::info('Invalid URI', ['post' => $post, 'callstack' => System::callstack(10, 0, true)]); + Logger::info('Invalid URI', ['post' => $post]); return ''; } return $post->uri . ':' . $post->cid; @@ -1337,7 +1336,7 @@ function bluesky_fetch_post(string $uri, int $uid): string function bluesky_process_thread(stdClass $thread, int $uid, array $cdata, int $level): string { if (empty($thread->post)) { - Logger::info('Invalid post', ['post' => $thread, 'callstack' => System::callstack(10, 0, true)]); + Logger::info('Invalid post', ['post' => $thread]); return ''; } $uri = bluesky_get_uri($thread->post); diff --git a/langfilter/langfilter.php b/langfilter/langfilter.php index 9cb57a6c..e5efa8fb 100644 --- a/langfilter/langfilter.php +++ b/langfilter/langfilter.php @@ -163,7 +163,7 @@ function langfilter_prepare_body_content_filter(&$hook_data) return; } - $lang = $iso639->languageByCode1($iso2); + $lang = $iso639->languageByCode1(substr($iso2, 0, 2)); } else { $opts = $hook_data['item']['postopts']; if (!$opts) { From 43c46ae6d975f386421fe60b802411dec93e228a Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Fri, 20 Oct 2023 17:50:31 +0200 Subject: [PATCH 3/3] [smileybutton] Add explicit conversion from float to int Address part of https://github.com/friendica/friendica/issues/13157#issuecomment-1771572442 --- smileybutton/smileybutton.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/smileybutton/smileybutton.php b/smileybutton/smileybutton.php index fc20888f..1df717b7 100644 --- a/smileybutton/smileybutton.php +++ b/smileybutton/smileybutton.php @@ -90,7 +90,7 @@ function smileybutton_jot_tool(string &$body) for ($x = 0; $x < count($params['texts']); $x++) { $icon = $params['icons'][$x]; $s .= '' . $icon . ''; - if (($x + 1) % (sqrt(count($params['texts'])) + 1) == 0) { + if (($x + 1) % (floor(sqrt(count($params['texts']))) + 1) == 0) { $s .= ''; } }