Merge ../rebble.net into dev

This commit is contained in:
Mike Macgirvin 2023-04-12 04:08:29 -07:00
commit f4779a8c66
4 changed files with 20 additions and 3 deletions

View file

@ -2571,6 +2571,23 @@ class Channel
return (($channel) ? z_root() . '/channel/' . $channel['channel_address'] : z_root());
}
public static function keyId($channel)
{
// data validation - if this is wrong, log the call stack so we can find the issue
if (! is_array($channel)) {
btlogger('not a channel array: ' . print_r($channel, true));
}
if ($channel['channel_address'] === App::get_hostname() || intval($channel['channel_system'])) {
return z_root() . '?operation=getkey';
}
return (($channel) ? z_root() . '/channel/' . $channel['channel_address'] : z_root()) . '?operation=getkey';
}
public static function is_group($uid)
{
$role = get_pconfig($uid, 'system', 'permissions_role');

View file

@ -384,7 +384,7 @@ class Queue
$headers['Host'] = $m['host'];
$headers['(request-target)'] = 'post ' . get_request_string($outq['outq_posturl']);
$xhead = HTTPSig::create_sig($headers, $channel['channel_prvkey'], Channel::url($channel));
$xhead = HTTPSig::create_sig($headers, $channel['channel_prvkey'], Channel::keyId($channel));
if (strpos($outq['outq_posturl'], 'http') !== 0) {
logger('bad url: ' . $outq['outq_posturl']);
self::remove($outq['outq_hash']);

View file

@ -50,7 +50,7 @@ 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));
$h = HTTPSig::create_sig($headers, $channel['channel_prvkey'], Channel::keyId($channel));
HTTPSig::set_headers($h);
echo $ret;

View file

@ -377,7 +377,7 @@ function photo_upload($channel, $observer, $args)
$title = ((isset($args['title']) && $args['title']) ? $args['title'] : $args['filename']);
$desc = htmlspecialchars($alt_desc);
$desc = htmlspecialchars($alt_desc, double_encode: false);
$found_tags = linkify_tags($args['body'], $channel_id);