aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib/LDSignatures.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2022-02-13 18:58:12 +0000
committerMario <mario@mariovavti.com>2022-02-13 18:58:12 +0000
commita7ec1805e3f5836641503d1f8cb6ccc1d8c885fa (patch)
tree048628b0da961a7cfda32dce7ed3572875e22907 /Zotlabs/Lib/LDSignatures.php
parent4b06bc552f04fc78545a450343cc59e236791a66 (diff)
downloadvolse-hubzilla-a7ec1805e3f5836641503d1f8cb6ccc1d8c885fa.tar.gz
volse-hubzilla-a7ec1805e3f5836641503d1f8cb6ccc1d8c885fa.tar.bz2
volse-hubzilla-a7ec1805e3f5836641503d1f8cb6ccc1d8c885fa.zip
address deprecation warnings
Diffstat (limited to 'Zotlabs/Lib/LDSignatures.php')
-rw-r--r--Zotlabs/Lib/LDSignatures.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/Zotlabs/Lib/LDSignatures.php b/Zotlabs/Lib/LDSignatures.php
index 1c2095f10..00042bc7a 100644
--- a/Zotlabs/Lib/LDSignatures.php
+++ b/Zotlabs/Lib/LDSignatures.php
@@ -75,22 +75,23 @@ class LDSignatures {
}
static function hash($obj) {
-
- return hash('sha256',self::normalise($obj));
+ return hash('sha256', self::normalise($obj));
}
static function normalise($data) {
+ $ret = '';
+
if(is_string($data)) {
$data = json_decode($data);
}
if(! is_object($data))
- return '';
+ return $ret;
jsonld_set_document_loader('jsonld_document_loader');
try {
- $d = jsonld_normalize($data,[ 'algorithm' => 'URDNA2015', 'format' => 'application/nquads' ]);
+ $ret = jsonld_normalize($data,[ 'algorithm' => 'URDNA2015', 'format' => 'application/nquads' ]);
}
catch (\Exception $e) {
// Don't log the exception - this can exhaust memory
@@ -98,7 +99,7 @@ class LDSignatures {
logger('normalise error: ' . print_r($data,true));
}
- return $d;
+ return $ret;
}
static function salmon_sign($data,$channel) {