aboutsummaryrefslogtreecommitdiffstats
path: root/include/network.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2024-03-09 20:53:18 +0000
committerMario <mario@mariovavti.com>2024-03-09 20:53:18 +0000
commit46fa26502b285213f3438abb1e3bd1482eb55bf5 (patch)
treec40ee65fc9da26319e26758c80339124f5247bea /include/network.php
parentba1e705c6154d347000ab6c92ef59f7f6f60e886 (diff)
downloadvolse-hubzilla-46fa26502b285213f3438abb1e3bd1482eb55bf5.tar.gz
volse-hubzilla-46fa26502b285213f3438abb1e3bd1482eb55bf5.tar.bz2
volse-hubzilla-46fa26502b285213f3438abb1e3bd1482eb55bf5.zip
more work on emojis
Diffstat (limited to 'include/network.php')
-rw-r--r--include/network.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/include/network.php b/include/network.php
index d41ba198d..a5c14f9d1 100644
--- a/include/network.php
+++ b/include/network.php
@@ -423,7 +423,7 @@ function json_return_and_die($x, $content_type = 'application/json') {
killme();
}
-function as_return_and_die($obj, $channel) {
+function as_return_and_die($obj, $channel = []) {
$ret = Activity::build_packet($obj, $channel);
logger('data: ' . jindent($ret), LOGGER_DATA);
@@ -433,8 +433,10 @@ function as_return_and_die($obj, $channel) {
$headers['Digest'] = HTTPSig::generate_digest_header($ret);
$headers['(request-target)'] = strtolower($_SERVER['REQUEST_METHOD']) . ' ' . $_SERVER['REQUEST_URI'];
- $h = HTTPSig::create_sig($headers, $channel['channel_prvkey'], channel_url($channel));
- HTTPSig::set_headers($h);
+ if ($channel) {
+ $h = HTTPSig::create_sig($headers, $channel['channel_prvkey'], channel_url($channel));
+ HTTPSig::set_headers($h);
+ }
echo $ret;
killme();