From 2aa64ebdd0c794d35d66b251c5ef4272d8ab5749 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Tue, 26 Dec 2023 21:59:10 +0100 Subject: Fix some deprecation warnings. --- Zotlabs/Web/HTTPSig.php | 5 ++++- include/text.php | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Zotlabs/Web/HTTPSig.php b/Zotlabs/Web/HTTPSig.php index 36a00528e..439ca472b 100644 --- a/Zotlabs/Web/HTTPSig.php +++ b/Zotlabs/Web/HTTPSig.php @@ -27,9 +27,12 @@ class HTTPSig { * @param string $alg hash algorithm (one of 'sha256','sha512') * @return string The generated digest header string for $body */ - static function generate_digest_header($body, $alg = 'sha256') { + if ($body === null) { + $body = ''; + } + $digest = base64_encode(hash($alg, $body, true)); switch ($alg) { case 'sha512': diff --git a/include/text.php b/include/text.php index 27dd94bc5..5330e19c7 100644 --- a/include/text.php +++ b/include/text.php @@ -3838,6 +3838,10 @@ function featured_sort($a,$b) { function punify($s) { + if (empty($s)) { + return ''; + } + require_once('vendor/simplepie/simplepie/idn/idna_convert.class.php'); $x = new idna_convert(['encoding' => 'utf8']); return $x->encode($s); -- cgit v1.2.3