mirror of
https://framagit.org/hubzilla/core.git
synced 2026-06-21 17:07:39 -04:00
Compare commits
22 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c5f33baf27 | ||
|
|
2efcdd92e0 | ||
|
|
38fda98b6d | ||
|
|
f9fd195c24 | ||
|
|
01e82090b2 | ||
|
|
39602ede37 | ||
|
|
98a311ae40 | ||
|
|
5c398b3e8f | ||
|
|
83e585ee9b | ||
|
|
e386499bfa | ||
|
|
4552630bf8 | ||
|
|
2d8065a780 | ||
|
|
b94da93c74 | ||
|
|
695045f197 | ||
|
|
376733bd08 | ||
|
|
4c7c5137c5 | ||
|
|
930b9820f2 | ||
|
|
b2fa63f2c8 | ||
|
|
1390e1db39 | ||
|
|
e7768ae954 | ||
|
|
38d977e546 | ||
|
|
3e38a24f0a |
14
CHANGELOG
14
CHANGELOG
@@ -1,3 +1,17 @@
|
||||
Hubzilla 7.2.2 (2022-04-26)
|
||||
- Fix item_verified not set due to data structure changes
|
||||
|
||||
|
||||
Hubzilla 7.2.1 (2022-04-25)
|
||||
- Fix changing profile image from new member widget - issue #1671
|
||||
- Fix regression with incoming poll answers from activitypub introduced in 7.2
|
||||
- Fix addons not removed from the DB when removed from the filesystem
|
||||
- Fix regression in attaching images for activitypub introduced in 7.2
|
||||
- Move activitypub addressing from core to the pubcrawl addon
|
||||
- Fix hub re-install issues
|
||||
- Fediwordle: slightly improved algorithm
|
||||
|
||||
|
||||
Hubzilla 7.2 (2022-03-29)
|
||||
- Streamline comment policy with downstream project
|
||||
- Add new function is_local_url()
|
||||
|
||||
@@ -530,71 +530,18 @@ class Activity {
|
||||
$ret['attachment'] = $a;
|
||||
}
|
||||
|
||||
$public = (($i['item_private']) ? false : true);
|
||||
$top_level = (($i['mid'] === $i['parent_mid']) ? true : false);
|
||||
|
||||
if ($public) {
|
||||
|
||||
if (intval($i['item_private']) === 0) {
|
||||
$ret['to'] = [ACTIVITY_PUBLIC_INBOX];
|
||||
$ret['cc'] = [z_root() . '/followers/' . substr($i['author']['xchan_addr'], 0, strpos($i['author']['xchan_addr'], '@'))];
|
||||
}
|
||||
else {
|
||||
|
||||
// private activity
|
||||
|
||||
if ($top_level) {
|
||||
$ret['to'] = self::map_acl($i);
|
||||
}
|
||||
else {
|
||||
$ret['to'] = [];
|
||||
if ($ret['tag']) {
|
||||
foreach ($ret['tag'] as $mention) {
|
||||
if (is_array($mention) && array_key_exists('href', $mention) && $mention['href']) {
|
||||
$h = q("select * from hubloc where hubloc_id_url = '%s' limit 1",
|
||||
dbesc($mention['href'])
|
||||
);
|
||||
if ($h) {
|
||||
if ($h[0]['hubloc_network'] === 'activitypub') {
|
||||
$addr = $h[0]['hubloc_hash'];
|
||||
}
|
||||
else {
|
||||
$addr = $h[0]['hubloc_id_url'];
|
||||
}
|
||||
if (!in_array($addr, $ret['to'])) {
|
||||
$ret['to'][] = $addr;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$d = q("select hubloc.* from hubloc left join item on hubloc_hash = owner_xchan where item.id = %d limit 1",
|
||||
intval($i['parent'])
|
||||
);
|
||||
if ($d) {
|
||||
if ($d[0]['hubloc_network'] === 'activitypub') {
|
||||
$addr = $d[0]['hubloc_hash'];
|
||||
}
|
||||
else {
|
||||
$addr = $d[0]['hubloc_id_url'];
|
||||
}
|
||||
if (!in_array($addr, $ret['to'])) {
|
||||
$ret['cc'][] = $addr;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$mentions = self::map_mentions($i);
|
||||
if (count($mentions) > 0) {
|
||||
if (!$ret['to']) {
|
||||
$ret['to'] = $mentions;
|
||||
}
|
||||
else {
|
||||
$ret['to'] = array_values(array_unique(array_merge($ret['to'], $mentions)));
|
||||
}
|
||||
}
|
||||
$hookinfo = [
|
||||
'item' => $i,
|
||||
'encoded' => $ret
|
||||
];
|
||||
|
||||
return $ret;
|
||||
call_hooks('encode_item', $hookinfo);
|
||||
|
||||
return $hookinfo['encoded'];
|
||||
|
||||
}
|
||||
|
||||
@@ -941,73 +888,18 @@ class Activity {
|
||||
$ret['attachment'] = $a;
|
||||
}
|
||||
|
||||
// addressing madness
|
||||
|
||||
$public = (($i['item_private']) ? false : true);
|
||||
$top_level = (($reply) ? false : true);
|
||||
|
||||
if ($public) {
|
||||
if (intval($i['item_private']) === 0) {
|
||||
$ret['to'] = [ACTIVITY_PUBLIC_INBOX];
|
||||
$ret['cc'] = [z_root() . '/followers/' . substr($i['author']['xchan_addr'], 0, strpos($i['author']['xchan_addr'], '@'))];
|
||||
}
|
||||
else {
|
||||
|
||||
// private activity
|
||||
|
||||
if ($top_level) {
|
||||
$ret['to'] = self::map_acl($i);
|
||||
}
|
||||
else {
|
||||
$ret['to'] = [];
|
||||
if ($ret['tag']) {
|
||||
foreach ($ret['tag'] as $mention) {
|
||||
if (is_array($mention) && array_key_exists('href', $mention) && $mention['href']) {
|
||||
$h = q("select * from hubloc where hubloc_id_url = '%s' limit 1",
|
||||
dbesc($mention['href'])
|
||||
);
|
||||
if ($h) {
|
||||
if ($h[0]['hubloc_network'] === 'activitypub') {
|
||||
$addr = $h[0]['hubloc_hash'];
|
||||
}
|
||||
else {
|
||||
$addr = $h[0]['hubloc_id_url'];
|
||||
}
|
||||
if (!in_array($addr, $ret['to'])) {
|
||||
$ret['to'][] = $addr;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$d = q("select hubloc.* from hubloc left join item on hubloc_hash = owner_xchan where item.id = %d limit 1",
|
||||
intval($i['parent'])
|
||||
);
|
||||
if ($d) {
|
||||
if ($d[0]['hubloc_network'] === 'activitypub') {
|
||||
$addr = $d[0]['hubloc_hash'];
|
||||
}
|
||||
else {
|
||||
$addr = $d[0]['hubloc_id_url'];
|
||||
}
|
||||
if (!in_array($addr, $ret['to'])) {
|
||||
$ret['cc'][] = $addr;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$mentions = self::map_mentions($i);
|
||||
if (count($mentions) > 0) {
|
||||
if (!$ret['to']) {
|
||||
$ret['to'] = $mentions;
|
||||
}
|
||||
else {
|
||||
$ret['to'] = array_values(array_unique(array_merge($ret['to'], $mentions)));
|
||||
}
|
||||
}
|
||||
$hookinfo = [
|
||||
'item' => $i,
|
||||
'encoded' => $ret
|
||||
];
|
||||
|
||||
return $ret;
|
||||
call_hooks('encode_activity', $hookinfo);
|
||||
|
||||
return $hookinfo['encoded'];
|
||||
}
|
||||
|
||||
// Returns an array of URLS for any mention tags found in the item array $i.
|
||||
@@ -2942,7 +2834,7 @@ class Activity {
|
||||
}
|
||||
|
||||
if ($p && $p[0]['obj_type'] === 'Question') {
|
||||
if ($item['obj_type'] === 'Note' && $item['title'] && (!$item['content'])) {
|
||||
if ($item['obj_type'] === ACTIVITY_OBJ_COMMENT && $item['title'] && (!$item['body'])) {
|
||||
$item['obj_type'] = 'Answer';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1292,7 +1292,7 @@ class Libzot {
|
||||
}
|
||||
}
|
||||
|
||||
if ($AS->data['hubloc']) {
|
||||
if ($AS->meta['hubloc']) {
|
||||
$arr['item_verified'] = true;
|
||||
}
|
||||
|
||||
@@ -2010,7 +2010,7 @@ class Libzot {
|
||||
$arr['owner_xchan'] = $a['signature']['signer'];
|
||||
}
|
||||
|
||||
if ($AS->data['hubloc'] || $arr['author_xchan'] === $arr['owner_xchan']) {
|
||||
if ($AS->meta['hubloc'] || $arr['author_xchan'] === $arr['owner_xchan']) {
|
||||
$arr['item_verified'] = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -202,7 +202,7 @@ class Queue {
|
||||
|
||||
if($channel && $base) {
|
||||
$h = q("SELECT hubloc_sitekey, site_crypto FROM hubloc LEFT JOIN site ON hubloc_url = site_url
|
||||
WHERE site_url = '%s' AND hubloc_network = 'zot6' ORDER BY hubloc_id DESC LIMIT 1",
|
||||
WHERE site_url = '%s' AND hubloc_network = 'zot6' AND hubloc_deleted = 0 ORDER BY hubloc_primary DESC, hubloc_id DESC LIMIT 1",
|
||||
dbesc($base)
|
||||
);
|
||||
if($h) {
|
||||
|
||||
@@ -403,6 +403,10 @@ class Profile_photo extends Controller {
|
||||
foreach ($r as $rr) {
|
||||
if ($rr['is_default']) {
|
||||
$default_profile_id = intval($rr['id']);
|
||||
|
||||
if (!$profile_id) {
|
||||
$profile_id = $default_profile_id;
|
||||
}
|
||||
}
|
||||
|
||||
if ($profile_id === intval($rr['id'])) {
|
||||
|
||||
@@ -8,21 +8,21 @@ use Zotlabs\Web\HTTPSig;
|
||||
class Zot_probe extends \Zotlabs\Web\Controller {
|
||||
|
||||
function get() {
|
||||
|
||||
|
||||
$o .= '<h3>Zot6 Probe Diagnostic</h3>';
|
||||
|
||||
|
||||
$o .= '<form action="zot_probe" method="get">';
|
||||
$o .= 'Lookup URI: <input type="text" style="width: 250px;" name="addr" value="' . $_GET['addr'] .'" /><br>';
|
||||
$o .= '<input type="submit" name="submit" value="Submit" /></form>';
|
||||
|
||||
$o .= '<input type="submit" name="submit" value="Submit" /></form>';
|
||||
|
||||
$o .= '<br /><br />';
|
||||
|
||||
|
||||
if(x($_GET,'addr')) {
|
||||
$addr = $_GET['addr'];
|
||||
|
||||
|
||||
$x = Zotfinger::exec($addr);
|
||||
|
||||
|
||||
$o .= '<pre>' . htmlspecialchars(print_array($x)) . '</pre>';
|
||||
|
||||
$headers = 'Accept: application/x-zot+json, application/jrd+json, application/json';
|
||||
@@ -38,10 +38,10 @@ class Zot_probe extends \Zotlabs\Web\Controller {
|
||||
|
||||
$o .= '<pre>' . htmlspecialchars(json_encode(json_decode($x['body']),JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES)) . '</pre>' . EOL;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return $o;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
2
boot.php
2
boot.php
@@ -60,7 +60,7 @@ require_once('include/bbcode.php');
|
||||
require_once('include/items.php');
|
||||
|
||||
define('PLATFORM_NAME', 'hubzilla');
|
||||
define('STD_VERSION', '7.2');
|
||||
define('STD_VERSION', '7.2.2');
|
||||
define('ZOT_REVISION', '6.0');
|
||||
|
||||
define('DB_UPDATE_VERSION', 1252);
|
||||
|
||||
@@ -87,7 +87,7 @@ function deletenode(&$doc, $node)
|
||||
function html2bbcode($message)
|
||||
{
|
||||
|
||||
if(!is_string($message) && !$message)
|
||||
if(!is_string($message))
|
||||
return;
|
||||
|
||||
$message = str_replace("\r", "", $message);
|
||||
@@ -104,11 +104,14 @@ function html2bbcode($message)
|
||||
$message = preg_replace('=<(\w+):(.+?)>=', '<removeme>', $message);
|
||||
$message = preg_replace('=</(\w+):(.+?)>=', '</removeme>', $message);
|
||||
|
||||
$message = mb_convert_encoding($message, 'HTML-ENTITIES', "UTF-8");
|
||||
|
||||
if(!$message)
|
||||
return;
|
||||
|
||||
$doc = new DOMDocument();
|
||||
$doc->preserveWhiteSpace = false;
|
||||
|
||||
$message = mb_convert_encoding($message, 'HTML-ENTITIES', "UTF-8");
|
||||
|
||||
@$doc->loadHTML($message);
|
||||
|
||||
deletenode($doc, 'style');
|
||||
|
||||
@@ -275,13 +275,16 @@ function plugins_sync() {
|
||||
if(! array_walk($plugins_arr,'array_trim'))
|
||||
return;
|
||||
|
||||
App::$plugins = $plugins_arr;
|
||||
|
||||
$installed_arr = [];
|
||||
|
||||
if(count($installed)) {
|
||||
foreach($installed as $i) {
|
||||
if(! in_array($i, $plugins_arr)) {
|
||||
if (! file_exists('addon/' . $i . '/' . $i . '.php')) {
|
||||
q("DELETE FROM addon WHERE aname = '%s' ",
|
||||
dbesc($i)
|
||||
);
|
||||
}
|
||||
elseif(! in_array($i, $plugins_arr)) {
|
||||
unload_plugin($i);
|
||||
}
|
||||
else {
|
||||
@@ -298,6 +301,8 @@ function plugins_sync() {
|
||||
}
|
||||
}
|
||||
|
||||
App::$plugins = $installed_arr;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user