From d7d6a43655734a1ebeb0d70481452447baf5a80e Mon Sep 17 00:00:00 2001
From: Art4
Date: Tue, 26 Nov 2024 07:55:01 +0000
Subject: [PATCH 01/28] Add checks for CLD2Detector ans CLD2Encoding classes
---
cld/cld.php | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/cld/cld.php b/cld/cld.php
index 5ca4c932..83361e2b 100644
--- a/cld/cld.php
+++ b/cld/cld.php
@@ -22,6 +22,16 @@ function cld_detect_languages(array &$data)
return;
}
+ if (!class_exists('CLD2Detector')) {
+ Logger::warning('CLD2Detector class does not exist.');
+ return;
+ }
+
+ if (!class_exists('CLD2Encoding')) {
+ Logger::warning('CLD2Encoding class does not exist.');
+ return;
+ }
+
$cld2 = new \CLD2Detector();
$cld2->setEncodingHint(CLD2Encoding::UTF8); // optional, hints about text encoding
--
2.45.2
From fc0dda0cd9b607dc8d87f73644108f922f6bb1e1 Mon Sep 17 00:00:00 2001
From: Art4
Date: Tue, 26 Nov 2024 08:23:27 +0000
Subject: [PATCH 02/28] refactor convert addon, replace each() calls with
foreach loop
---
convert/convert.php | 20 ++++++++------------
1 file changed, 8 insertions(+), 12 deletions(-)
diff --git a/convert/convert.php b/convert/convert.php
index 57ce6ea8..2c97e2aa 100644
--- a/convert/convert.php
+++ b/convert/convert.php
@@ -6,7 +6,6 @@
* Author: Mike Macgirvin
*/
-use Friendica\App;
use Friendica\Core\Hook;
function convert_install() {
@@ -26,7 +25,7 @@ function convert_content() {
// @TODO Let's one day rewrite this to a modern composer package
include 'UnitConvertor.php';
- class TP_Converter extends UnitConvertor
+ $conv = new class('en') extends UnitConvertor
{
public function __construct(string $lang = 'en')
{
@@ -43,7 +42,7 @@ function convert_content() {
private function findBaseUnit($from, $to)
{
- while (list($skey, $sval) = each($this->bases)) {
+ foreach ($this->bases as $skey => $sval) {
if ($skey == $from || $to == $skey || in_array($to, $sval) || in_array($from, $sval)) {
return $skey;
}
@@ -63,7 +62,7 @@ function convert_content() {
$cells[] = $cell;
// We now have the base unit and value now lets produce the table;
- while (list($key, $val) = each($this->bases[$base_unit])) {
+ foreach ($this->bases[$base_unit] as $val) {
$cell ['value'] = $this->convert($value, $from_unit, $val, $precision) . ' ' . $val;
$cell ['class'] = ($val == $from_unit || $val == $to_unit) ? 'framedred' : '';
$cells[] = $cell;
@@ -86,9 +85,7 @@ function convert_content() {
return $string;
}
- }
-
- $conv = new TP_Converter('en');
+ };
$conversions = [
'Temperature' => ['base' => 'Celsius',
@@ -176,10 +173,10 @@ function convert_content() {
]
];
- while (list($key, $val) = each($conversions)) {
+ foreach ($conversions as $key => $val) {
$conv->addConversion($val['base'], $val['conv']);
$list[$key][] = $val['base'];
- while (list($ukey, $uval) = each($val['conv'])) {
+ foreach ($val['conv'] as $ukey => $uval) {
$list[$key][] = $ukey;
}
}
@@ -202,10 +199,9 @@ function convert_content() {
$o .= '';
$o .= '
';
--
2.45.2
From 07993f70985713ac692d73fa0ad78fecffbb2432 Mon Sep 17 00:00:00 2001
From: Art4
Date: Sat, 30 Nov 2024 19:30:39 +0000
Subject: [PATCH 14/28] Fix errors in js_upload addon
---
.../file-uploader/tests/action-acceptance.php | 16 ++++++++--------
.../tests/action-handler-queue-test.php | 8 ++++----
.../file-uploader/tests/action-handler-test.php | 8 ++++----
3 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/js_upload/file-uploader/tests/action-acceptance.php b/js_upload/file-uploader/tests/action-acceptance.php
index fc9583f2..172b8857 100644
--- a/js_upload/file-uploader/tests/action-acceptance.php
+++ b/js_upload/file-uploader/tests/action-acceptance.php
@@ -2,12 +2,12 @@
usleep(100000);
-$fileName;
-$fileSize;
+$fileName = '';
+$fileSize = 0;;
if (isset($_GET['qqfile'])){
$fileName = $_GET['qqfile'];
-
+
// xhr request
$headers = apache_request_headers();
$fileSize = (int)$headers['Content-Length'];
@@ -34,13 +34,13 @@ if ($fileSize > 9 * 1024){
die ('{error: "server-error file size is bigger than 9kB"}');
}
-if (count($_GET)){
+if (count($_GET)){
array_merge($_GET, array('fileName'=>$fileName));
-
+
$response = array_merge($_GET, array('success'=>true, 'fileName'=>$fileName));
-
- // to pass data through iframe you will need to encode all html tags
- echo htmlspecialchars(json_encode($response), ENT_NOQUOTES);
+
+ // to pass data through iframe you will need to encode all html tags
+ echo htmlspecialchars(json_encode($response), ENT_NOQUOTES);
} else {
die ('{error: "server-error query params not passed"}');
}
diff --git a/js_upload/file-uploader/tests/action-handler-queue-test.php b/js_upload/file-uploader/tests/action-handler-queue-test.php
index ff13576d..78760d64 100644
--- a/js_upload/file-uploader/tests/action-handler-queue-test.php
+++ b/js_upload/file-uploader/tests/action-handler-queue-test.php
@@ -2,11 +2,11 @@
sleep(4);
-$fileName;
+$fileName = '';
if (isset($_GET['qqfile'])){
$fileName = $_GET['qqfile'];
-
+
// xhr request
$headers = apache_request_headers();
if ((int)$headers['Content-Length'] == 0){
@@ -14,7 +14,7 @@ if (isset($_GET['qqfile'])){
}
} elseif (isset($_FILES['qqfile'])){
$fileName = basename($_FILES['qqfile']['name']);
-
+
// form request
if ($_FILES['qqfile']['size'] == 0){
die ('{error: "file size is zero"}');
@@ -25,7 +25,7 @@ if (isset($_GET['qqfile'])){
if (count($_GET)){
$_GET['success'] = true;
- echo json_encode(array_merge($_GET));
+ echo json_encode(array_merge($_GET));
} else {
die ('{error: "query params not passed"}');
}
diff --git a/js_upload/file-uploader/tests/action-handler-test.php b/js_upload/file-uploader/tests/action-handler-test.php
index 24466b12..9fa72023 100644
--- a/js_upload/file-uploader/tests/action-handler-test.php
+++ b/js_upload/file-uploader/tests/action-handler-test.php
@@ -2,11 +2,11 @@
usleep(300);
-$fileName;
+$fileName = '';
if (isset($_GET['qqfile'])){
$fileName = $_GET['qqfile'];
-
+
// xhr request
$headers = apache_request_headers();
if ((int)$headers['Content-Length'] == 0){
@@ -14,7 +14,7 @@ if (isset($_GET['qqfile'])){
}
} elseif (isset($_FILES['qqfile'])){
$fileName = basename($_FILES['qqfile']['name']);
-
+
// form request
if ($_FILES['qqfile']['size'] == 0){
die ('{error: "file size is zero"}');
@@ -25,7 +25,7 @@ if (isset($_GET['qqfile'])){
if (count($_GET)){
//return query params
- echo json_encode(array_merge($_GET, array('fileName'=>$fileName)));
+ echo json_encode(array_merge($_GET, array('fileName'=>$fileName)));
} else {
die ('{error: "query params not passed"}');
}
--
2.45.2
From 04afbe36e3e62625debec212ec1f6782edbb8bd4 Mon Sep 17 00:00:00 2001
From: Art4
Date: Sat, 30 Nov 2024 19:32:07 +0000
Subject: [PATCH 15/28] Fix errors in keycloakpassword addon
---
keycloakpassword/keycloakpassword.php | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/keycloakpassword/keycloakpassword.php b/keycloakpassword/keycloakpassword.php
index bfff4ea4..e9809f86 100644
--- a/keycloakpassword/keycloakpassword.php
+++ b/keycloakpassword/keycloakpassword.php
@@ -6,7 +6,6 @@
* Author: Ryan
*/
-use Friendica\App;
use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\Core\Renderer;
@@ -92,7 +91,7 @@ function keycloakpassword_authenticate(array &$b)
$client_id,
$secret,
$endpoint . '/logout',
- [ 'refresh_token' => res['refresh_token'] ]
+ [ 'refresh_token' => $res['refresh_token'] ]
);
}
}
--
2.45.2
From fcec1a3d836b2134e318003bbd49e7a9a85cee30 Mon Sep 17 00:00:00 2001
From: Art4
Date: Sat, 30 Nov 2024 19:35:19 +0000
Subject: [PATCH 16/28] Fix errors in langfilter addon
---
langfilter/langfilter.php | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/langfilter/langfilter.php b/langfilter/langfilter.php
index e5efa8fb..2bf986f0 100644
--- a/langfilter/langfilter.php
+++ b/langfilter/langfilter.php
@@ -7,7 +7,6 @@
* License: MIT
*/
-use Friendica\App;
use Friendica\Content\Text\BBCode;
use Friendica\Core\Hook;
use Friendica\Core\Renderer;
@@ -148,6 +147,8 @@ function langfilter_prepare_body_content_filter(&$hook_data)
$iso639 = new Matriphe\ISO639\ISO639;
+ $confidence = null;
+
// Extract the language of the post
if (!empty($hook_data['item']['language'])) {
$languages = json_decode($hook_data['item']['language'], true);
--
2.45.2
From ace19814d7a934e46ef5303be3ff05cc6279ddc2 Mon Sep 17 00:00:00 2001
From: Art4
Date: Sat, 30 Nov 2024 19:37:58 +0000
Subject: [PATCH 17/28] Fix errors in leistungsschutzrecht addon
---
leistungsschutzrecht/leistungsschutzrecht.php | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/leistungsschutzrecht/leistungsschutzrecht.php b/leistungsschutzrecht/leistungsschutzrecht.php
index f6c65399..ec8091ac 100644
--- a/leistungsschutzrecht/leistungsschutzrecht.php
+++ b/leistungsschutzrecht/leistungsschutzrecht.php
@@ -6,7 +6,6 @@
* Author: Michael Vogel
*/
-use Friendica\App;
use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\DI;
@@ -149,7 +148,7 @@ function leistungsschutzrecht_is_member_site(string $url): bool
$cleanedurlpart = explode('%', $urldata['host']);
$hostname = explode('.', $cleanedurlpart[0]);
- if (empty($hostname)) {
+ if ($hostname === false || $hostname === '') {
return false;
}
--
2.45.2
From e86d15993b6794ea581624b34c0631685e8d14aa Mon Sep 17 00:00:00 2001
From: Art4
Date: Sat, 30 Nov 2024 19:41:11 +0000
Subject: [PATCH 18/28] Fix errors in libravatar addon
---
libravatar/Services/Libravatar.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libravatar/Services/Libravatar.php b/libravatar/Services/Libravatar.php
index 70fcfe39..e51ef070 100644
--- a/libravatar/Services/Libravatar.php
+++ b/libravatar/Services/Libravatar.php
@@ -401,9 +401,8 @@ class Services_Libravatar
*/
protected function srvGet($domain, $https = false)
{
-
// Are we going secure? Set up a fallback too.
- if (isset($https) && $https === true) {
+ if ($https === true) {
$subdomain = '_avatars-sec._tcp.';
$fallback = 'seccdn.';
} else {
@@ -426,6 +425,7 @@ class Services_Libravatar
$top = $srv[0];
$sum = 0;
+ $pri = [];
// Try to adhere to RFC2782's weighting algorithm, page 3
// "arrange all SRV RRs (that have not been ordered yet) in any order,
--
2.45.2
From 5f6f374f09f8c186422d245d523644020694395b Mon Sep 17 00:00:00 2001
From: Art4
Date: Sat, 30 Nov 2024 19:42:40 +0000
Subject: [PATCH 19/28] Fix errors in ljpost addon
---
ljpost/ljpost.php | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/ljpost/ljpost.php b/ljpost/ljpost.php
index 7acc6589..b416c605 100644
--- a/ljpost/ljpost.php
+++ b/ljpost/ljpost.php
@@ -8,7 +8,6 @@
* Author: Cat Gray
*/
-use Friendica\App;
use Friendica\Content\Text\BBCode;
use Friendica\Core\Hook;
use Friendica\Core\Logger;
@@ -203,10 +202,12 @@ EOT;
Logger::debug('ljpost: data: ' . $xml);
+ $x = '';
+
if ($lj_blog !== 'test') {
$x = DI::httpClient()->post($lj_blog, $xml, ['Content-Type' => 'text/xml'])->getBodyString();
}
- Logger::info('posted to livejournal: ' . ($x) ? $x : '');
+ Logger::info('posted to livejournal: ' . $x);
}
}
--
2.45.2
From c04016b7d3b4e24adfa8f43e9420c004e9b7d36f Mon Sep 17 00:00:00 2001
From: Art4
Date: Sat, 30 Nov 2024 19:48:49 +0000
Subject: [PATCH 20/28] fix errors in mailstream addon
---
mailstream/phpmailer/class.phpmailer.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mailstream/phpmailer/class.phpmailer.php b/mailstream/phpmailer/class.phpmailer.php
index ff3d81e3..dcf02361 100644
--- a/mailstream/phpmailer/class.phpmailer.php
+++ b/mailstream/phpmailer/class.phpmailer.php
@@ -3287,7 +3287,7 @@ class PHPMailer
$result = 'localhost.localdomain';
if (!empty($this->Hostname)) {
$result = $this->Hostname;
- } elseif (isset($_SERVER) and array_key_exists('SERVER_NAME', $_SERVER) and !empty($_SERVER['SERVER_NAME'])) {
+ } elseif (array_key_exists('SERVER_NAME', $_SERVER) and !empty($_SERVER['SERVER_NAME'])) {
$result = $_SERVER['SERVER_NAME'];
} elseif (function_exists('gethostname') && gethostname() !== false) {
$result = gethostname();
--
2.45.2
From 50912fdc173dbb5f82f6dc8414d0d5d40f7b0879 Mon Sep 17 00:00:00 2001
From: Art4
Date: Sat, 30 Nov 2024 19:50:06 +0000
Subject: [PATCH 21/28] Fix errors in nsfw addon
---
nsfw/nsfw.php | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/nsfw/nsfw.php b/nsfw/nsfw.php
index 4a54d899..674fc201 100644
--- a/nsfw/nsfw.php
+++ b/nsfw/nsfw.php
@@ -8,7 +8,6 @@
*
*/
-use Friendica\App;
use Friendica\Core\Hook;
use Friendica\Core\Renderer;
use Friendica\DI;
@@ -119,7 +118,9 @@ function nsfw_prepare_body_content_filter(&$hook_data)
$word_list = ['nsfw'];
}
- $found = false;
+ $found = false;
+ $tag_search = false;
+
if (count($word_list)) {
$body = $hook_data['item']['title'] . "\n" . nsfw_extract_photos($hook_data['item']['body']);
@@ -129,7 +130,6 @@ function nsfw_prepare_body_content_filter(&$hook_data)
continue;
}
- $tag_search = false;
switch ($word[0]) {
case '/'; // Regular expression
$found = @preg_match($word, $body);
--
2.45.2
From 3f89aa180610b0ce0ead35c082ad43e3c702bcde Mon Sep 17 00:00:00 2001
From: Art4
Date: Sat, 30 Nov 2024 19:51:18 +0000
Subject: [PATCH 22/28] Fix errors in pnut addon
---
pnut/lib/phpnut.php | 2 ++
1 file changed, 2 insertions(+)
diff --git a/pnut/lib/phpnut.php b/pnut/lib/phpnut.php
index 5794d795..89d5e5f8 100644
--- a/pnut/lib/phpnut.php
+++ b/pnut/lib/phpnut.php
@@ -1339,6 +1339,8 @@ class phpnut
*/
protected function updateUserImage(string $image, string $which='avatar')
{
+ $mimeType = '';
+
$test = @getimagesize($image);
if ($test && array_key_exists('mime', $test)) {
$mimeType = $test['mime'];
--
2.45.2
From 43ee267d38c1084cdac54f0872a902d788897631 Mon Sep 17 00:00:00 2001
From: Art4
Date: Sat, 30 Nov 2024 20:12:23 +0000
Subject: [PATCH 23/28] fix errors in pumpio addon
---
pumpio/pumpio.php | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/pumpio/pumpio.php b/pumpio/pumpio.php
index 5e053d7c..d7c2ac32 100644
--- a/pumpio/pumpio.php
+++ b/pumpio/pumpio.php
@@ -6,7 +6,6 @@
* Author: Michael Vogel
*/
-use Friendica\App;
use Friendica\Content\Text\BBCode;
use Friendica\Content\Text\HTML;
use Friendica\Core\Addon;
@@ -582,6 +581,8 @@ function pumpio_action(int $uid, string $uri, string $action, string $content =
$uri = $orig_post['uri'];
}
+ $objectType = '';
+
if (($orig_post['object-type'] != '') && (strstr($orig_post['object-type'], ActivityNamespace::ACTIVITY_SCHEMA))) {
$objectType = str_replace(ActivityNamespace::ACTIVITY_SCHEMA, '', $orig_post['object-type']);
} elseif (strstr($uri, '/api/comment/')) {
@@ -827,6 +828,7 @@ function pumpio_dounlike(int $uid, array $self, $post, string $own_id)
}
$contactid = 0;
+ $contact = [];
if (Strings::compareLink($post->actor->url, $own_id)) {
$contactid = $self['id'];
@@ -1430,6 +1432,8 @@ function pumpio_fetchallcomments($uid, $id)
Logger::notice('pumpio_fetchallcomments: fetching comment for user ' . $uid . ', URL ' . $url);
+ $item = new \stdClass();
+
if (pumpio_reachable($url)) {
$success = $client->CallAPI($url, 'GET', [], ['FailOnAccessError' => true], $item);
} else {
--
2.45.2
From fccf361ef121492aaf486ffca72eafbf4e558536 Mon Sep 17 00:00:00 2001
From: Art4
Date: Sat, 30 Nov 2024 20:13:41 +0000
Subject: [PATCH 24/28] fix errors in ratioed addon
---
ratioed/RatioedPanel.php | 1 +
1 file changed, 1 insertion(+)
diff --git a/ratioed/RatioedPanel.php b/ratioed/RatioedPanel.php
index e25c7f34..bd9b44dc 100644
--- a/ratioed/RatioedPanel.php
+++ b/ratioed/RatioedPanel.php
@@ -26,6 +26,7 @@ class RatioedPanel extends Active
$action = $this->parameters['action'] ?? '';
$uid = $this->parameters['uid'] ?? 0;
+ $user = [];
if ($uid) {
$user = User::getById($uid, ['username', 'blocked']);
--
2.45.2
From a41f8c13fea5cb52687fc35c1756c04c0620b510 Mon Sep 17 00:00:00 2001
From: Art4
Date: Sat, 30 Nov 2024 20:27:57 +0000
Subject: [PATCH 25/28] fix errors in statusnet addon
---
statusnet/library/codebirdsn.php | 13 +++++++------
statusnet/statusnet.php | 2 ++
2 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/statusnet/library/codebirdsn.php b/statusnet/library/codebirdsn.php
index 325bcb07..91e256be 100644
--- a/statusnet/library/codebirdsn.php
+++ b/statusnet/library/codebirdsn.php
@@ -31,11 +31,10 @@ use Friendica\Core\System;
/**
* Define constants
*/
-$constants = explode(' ', 'OBJECT ARRAY JSON');
-foreach ($constants as $i => $id) {
- $id = 'CODEBIRD_RETURNFORMAT_' . $id;
- defined($id) or define($id, $i);
-}
+defined('CODEBIRD_RETURNFORMAT_ARRAY') or define('CODEBIRD_RETURNFORMAT_ARRAY', 0);
+defined('CODEBIRD_RETURNFORMAT_JSON') or define('CODEBIRD_RETURNFORMAT_JSON', 1);
+defined('CODEBIRD_RETURNFORMAT_OBJECT') or define('CODEBIRD_RETURNFORMAT_OBJECT', 2);
+
$constants = array(
'CURLE_SSL_CERTPROBLEM' => 58,
'CURLE_SSL_CACERT' => 60,
@@ -788,6 +787,8 @@ class CodebirdSN
$possible_files = explode(' ', $possible_files[$method]);
+ $data = '';
+
$multipart_border = '--------------------' . $this->_nonce();
$multipart_request = '';
foreach ($params as $key => $value) {
@@ -917,7 +918,7 @@ class CodebirdSN
$authorization = 'Authorization: Bearer ' . self::$_oauth_bearer_token;
}
$request_headers = array();
- if (isset($authorization)) {
+ if ($authorization !== '') {
$request_headers[] = $authorization;
$request_headers[] = 'Expect:';
}
diff --git a/statusnet/statusnet.php b/statusnet/statusnet.php
index 4bc32050..48f9c254 100644
--- a/statusnet/statusnet.php
+++ b/statusnet/statusnet.php
@@ -366,6 +366,8 @@ function statusnet_post_hook(array &$b)
$otoken = DI::pConfig()->get($b['uid'], 'statusnet', 'oauthtoken');
$osecret = DI::pConfig()->get($b['uid'], 'statusnet', 'oauthsecret');
+ $iscomment = null;
+
if ($ckey && $csecret && $otoken && $osecret) {
$dent = new StatusNetOAuth($api, $ckey, $csecret, $otoken, $osecret);
$max_char = $dent->get_maxlength(); // max. length for a dent
--
2.45.2
From b6a47699bfc68e3c57af797053cf79efe4d96e78 Mon Sep 17 00:00:00 2001
From: Art4
Date: Sat, 30 Nov 2024 20:36:07 +0000
Subject: [PATCH 26/28] fix errors in tictac addon
---
tictac/tictac.php | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/tictac/tictac.php b/tictac/tictac.php
index 10103835..082b58c1 100644
--- a/tictac/tictac.php
+++ b/tictac/tictac.php
@@ -7,7 +7,6 @@
* Status: unsupported
*/
-use Friendica\App;
use Friendica\Core\Hook;
use Friendica\DI;
@@ -30,7 +29,12 @@ function tictac_module() {}
function tictac_content() {
- $o = '';
+ $o = '';
+ $dimen = 3;
+ $handicap = 0;
+ $mefirst = 0;
+ $yours = '';
+ $mine = '';
if($_POST['move']) {
$handicap = DI::args()->get(1);
@@ -45,9 +49,6 @@ function tictac_content() {
$handicap = DI::args()->get(1);
$dimen = 3;
}
- else {
- $dimen = 3;
- }
$o .= '' . DI::l10n()->t('3D Tic-Tac-Toe') . '
';
@@ -163,7 +164,7 @@ class tictac {
];
function __construct($dimen, $handicap, $mefirst, $yours, $mine) {
- $this->dimen = 3;
+ $this->dimen = $dimen;
$this->handicap = $handicap ? 1 : 0;
$this->mefirst = $mefirst ? 1 : 0;
$this->yours = str_replace('XXX','',$yours);
@@ -228,6 +229,8 @@ class tictac {
}
function parse_moves($player) {
+ $str = '';
+
if($player == 'me')
$str = $this->mine;
if($player == 'you')
--
2.45.2
From 15c21cebb1bccd48a598c61d06b25d6fd8a43eb9 Mon Sep 17 00:00:00 2001
From: Art4
Date: Sat, 30 Nov 2024 20:36:58 +0000
Subject: [PATCH 27/28] Fix errors in wppost addon
---
wppost/wppost.php | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/wppost/wppost.php b/wppost/wppost.php
index dba738de..f2ee5d21 100644
--- a/wppost/wppost.php
+++ b/wppost/wppost.php
@@ -259,9 +259,11 @@ EOT;
Logger::debug('wppost: data: ' . $xml);
+ $x = '';
+
if ($wp_blog !== 'test') {
$x = DI::httpClient()->post($wp_blog, $xml)->getBodyString();
}
- Logger::info('posted to wordpress: ' . (($x) ? $x : ''));
+ Logger::info('posted to wordpress: ' . $x);
}
}
--
2.45.2
From c15a72991f54cff7d3f9d11b65ab7e59d796759e Mon Sep 17 00:00:00 2001
From: Artur Weigandt
Date: Thu, 5 Dec 2024 18:23:51 +0100
Subject: [PATCH 28/28] Update mailstream/phpmailer/class.phpmailer.php
Co-authored-by: Hypolite Petovan
---
mailstream/phpmailer/class.phpmailer.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mailstream/phpmailer/class.phpmailer.php b/mailstream/phpmailer/class.phpmailer.php
index dcf02361..1d9df9af 100644
--- a/mailstream/phpmailer/class.phpmailer.php
+++ b/mailstream/phpmailer/class.phpmailer.php
@@ -3287,7 +3287,7 @@ class PHPMailer
$result = 'localhost.localdomain';
if (!empty($this->Hostname)) {
$result = $this->Hostname;
- } elseif (array_key_exists('SERVER_NAME', $_SERVER) and !empty($_SERVER['SERVER_NAME'])) {
+ } elseif (!empty($_SERVER['SERVER_NAME'])) {
$result = $_SERVER['SERVER_NAME'];
} elseif (function_exists('gethostname') && gethostname() !== false) {
$result = gethostname();
--
2.45.2