Compare commits

..

16 Commits

Author SHA1 Message Date
Mario Vavti
a2ba81afe1 version 10.4.4 2025-10-06 23:27:14 +02:00
Mario
a15254a1e2 remove check for current user and apply update 2025-10-06 23:16:22 +02:00
Mario
3a50b185ce fix heading
(cherry picked from commit 57e2904cc0)

Co-authored-by: Mario <mario@mariovavti.com>
2025-10-02 10:02:37 +00:00
Mario
77866625cc fix path
(cherry picked from commit b49c844a23)

Co-authored-by: Mario <mario@mariovavti.com>
2025-10-02 09:58:06 +00:00
Mario
f6275fdb79 Ãadd en tos which seems to have been lost in transition
(cherry picked from commit 2c55ee5a73)

Co-authored-by: Mario <mario@mariovavti.com>
2025-10-02 09:52:05 +00:00
Mario
1ab1da5816 CI: Tell mysql cli to skip ssl checks
(cherry picked from commit 120292bd6c)

Co-authored-by: Harald Eilertsen <haraldei@anduin.net>
2025-09-02 06:34:44 +00:00
Mario
aaa863cda7 Merge branch 'dev' 2025-08-15 08:45:45 +00:00
Mario
3c722f9aa7 changelog 2025-08-15 08:45:05 +00:00
Mario
14f28907bc version 10.4.3 2025-08-15 08:38:40 +00:00
Mario
185f53d298 bump version 2025-08-14 17:46:21 +00:00
Mario
3ae42d471a vote: minor refactor tto catch dubble votes early 2025-08-12 09:13:55 +00:00
Mario
0a817f952e mark our own vote seen because it will not be marked seen later 2025-08-11 23:28:59 +00:00
Mario
bc7f8b15a8 dismiss our own votes from select query. they are not flagged with item_hidden because otherwise they would not be delivered to the poll owner. received votes are (and should be) flagged with item_hidden so that they are not being relayed. 2025-08-11 23:13:26 +00:00
Mario
02111ad649 start transition deprecated AS1 item.verb vocabulary to AS2 on demand 2025-08-11 22:36:35 +00:00
Mario
6f00964d47 fix regression in retrieving channel address in wtagblock() and whitespace fixes
(cherry picked from commit eafa1d56c3)

Co-authored-by: Mario <mario@mariovavti.com>
2025-08-08 17:49:10 +00:00
Mario
eafa1d56c3 fix regression in retrieving channel address in wtagblock() and whitespace fixes 2025-08-08 14:03:28 +00:00
10 changed files with 132 additions and 46 deletions

View File

@@ -53,10 +53,10 @@ before_script:
HZ_TEST_DB_DATABASE: $MYSQL_DATABASE
script:
# Import hubzilla's DB schema
- echo "USE $MYSQL_DATABASE; $(cat ./install/schema_mysql.sql)" | mysql --user=root --password="$MYSQL_ROOT_PASSWORD" --host="$DB_HOST" "$MYSQL_DATABASE"
- echo "USE $MYSQL_DATABASE; $(cat ./install/schema_mysql.sql)" | mysql --user=root --password="$MYSQL_ROOT_PASSWORD" --host="$DB_HOST" --skip-ssl "$MYSQL_DATABASE"
# Show databases and relations/tables of hubzilla's database
- echo "SHOW DATABASES;" | mysql --user=root --password="$MYSQL_ROOT_PASSWORD" --host="$DB_HOST" "$MYSQL_DATABASE"
- echo "USE $MYSQL_DATABASE; SHOW TABLES;" | mysql --user=root --password="$MYSQL_ROOT_PASSWORD" --host="$DB_HOST" "$MYSQL_DATABASE"
- echo "SHOW DATABASES;" | mysql --user=root --password="$MYSQL_ROOT_PASSWORD" --host="$DB_HOST" --skip-ssl "$MYSQL_DATABASE"
- echo "USE $MYSQL_DATABASE; SHOW TABLES;" | mysql --user=root --password="$MYSQL_ROOT_PASSWORD" --host="$DB_HOST" --skip-ssl "$MYSQL_DATABASE"
# Run the actual tests
- touch dbfail.out
- vendor/bin/phpunit -d memory_limit=256M --configuration tests/phpunit.xml --no-progress --stop-on-error --coverage-text --colors=never --log-junit tests/results/junit.xml || exit_code=$?

View File

@@ -1,3 +1,10 @@
Hubzilla 10.4.3 (2025-08-15)
- Refactor module vote to prohibit double votes at the sender side
- Fix vote answers counted as comments
- Start transition of deprecated AS1 item.verb vocabulary to AS2 on demand in mod channel, articles and cards
- Fix regression in retrieving channel address in wtagblock() and whitespace fixes
Hubzilla 10.4.2 (2025-08-08)
- Implement item_custom_display hook in mod HQ
- Refactor item fetching functions to reflect item_normal() changes

View File

@@ -386,8 +386,8 @@ class Channel extends Controller {
if ($noscript_content || $load) {
if ($mid) {
$r = q("SELECT *, parent AS item_id from item where $identifier = '%s' and uid = %d $item_normal
AND item_wall = 1 $permission_sql $sql_extra limit 1",
$r = q("SELECT item.parent AS item_id, item.verb from item where $identifier = '%s' and item.uid = %d $item_normal
AND item.item_wall = 1 $permission_sql $sql_extra limit 1",
dbesc($mid),
intval(App::$profile['profile_uid'])
);
@@ -396,7 +396,7 @@ class Channel extends Controller {
}
}
else {
$r = q("SELECT parent AS item_id, $ordering FROM item
$r = q("SELECT item.parent AS item_id, item.verb, $ordering FROM item
LEFT JOIN abook ON (item.author_xchan = abook.abook_xchan $abook_uids)
WHERE item.uid = %d
AND item.id = item.parent
@@ -417,6 +417,11 @@ class Channel extends Controller {
}
}
if ($r) {
// 11.08.2025 start transition deprecated AS1 item.verb vocabulary to AS2 on demand.
// Keep this until we officially deprecate AS1 data.
AS1_to_AS2_verbs($r);
$thr_parents = null;
if ($mid) {
$thr_parents = get_recursive_thr_parents($r[0]);

View File

@@ -20,27 +20,35 @@ class Vote extends Controller {
json_return_and_die($ret);
}
$fetch = null;
$id = argv(1);
$response = $_REQUEST['answer'];
if ($id) {
$fetch = q("select * from item where id = %d limit 1",
intval($id)
);
if (!$id) {
$ret['message'] = t('Missing poll id.');
json_return_and_die($ret);
}
$answer = q("select * from item where parent = %d and uid = %d and obj_type = 'Answer' limit 1",
intval($id),
intval($channel['channel_id'])
);
if ($fetch && $fetch[0]['obj_type'] === 'Question') {
$obj = json_decode($fetch[0]['obj'],true);
if ($answer) {
$ret['message'] = t('You have already submitted your vote for this poll.');
json_return_and_die($ret);
}
else {
$poll = q("select * from item where id = %d limit 1",
intval($id)
);
if (!$poll && $poll[0]['obj_type'] !== 'Question') {
$ret['message'] = t('Poll not found.');
json_return_and_die($ret);
}
$response = $_REQUEST['answer'];
$obj = json_decode($poll[0]['obj'],true);
$valid = false;
if ($obj['oneOf']) {
@@ -81,17 +89,18 @@ class Vote extends Controller {
$item['aid'] = $channel['channel_account_id'];
$item['uid'] = $channel['channel_id'];
$item['item_origin'] = 1;
$item['parent'] = $fetch[0]['id'];
$item['parent_mid'] = $fetch[0]['mid'];
$item['thr_parent'] = $fetch[0]['mid'];
$item['parent'] = $poll[0]['id'];
$item['parent_mid'] = $poll[0]['mid'];
$item['thr_parent'] = $poll[0]['mid'];
$item['uuid'] = new_uuid();
$item['mid'] = z_root() . '/item/' . $item['uuid'];
$item['verb'] = 'Create';
$item['title'] = $res;
$item['author_xchan'] = $channel['channel_hash'];
$item['owner_xchan'] = $fetch[0]['author_xchan'];
$item['allow_cid'] = '<' . $fetch[0]['author_xchan'] . '>';
$item['owner_xchan'] = $poll[0]['author_xchan'];
$item['allow_cid'] = '<' . $poll[0]['author_xchan'] . '>';
$item['item_private'] = 1;
$item['item_unseen'] = 0;
$item['obj_type'] = 'Note';
$item['author'] = channelx_by_n($channel['channel_id']);
$item['obj'] = Activity::encode_item($item);
@@ -104,7 +113,7 @@ class Vote extends Controller {
$x = item_store($item);
retain_item($fetch[0]['id']);
retain_item($poll[0]['id']);
if($x['success']) {
Master::Summon(['Notifier', 'like', $x['item_id']]);
@@ -125,7 +134,7 @@ class Vote extends Controller {
}
$ret['success'] = true;
$ret['message'] = t('Response submitted. Updates may not appear instantly.');
$ret['message'] = t('Your vote has been submitted. Updates may not appear instantly.');
json_return_and_die($ret);
}
}

29
Zotlabs/Update/_1264.php Normal file
View File

@@ -0,0 +1,29 @@
<?php
namespace Zotlabs\Update;
use Zotlabs\Lib\Config;
class _1264 {
function run() {
dbq("START TRANSACTION");
$admin_email = trim(Config::Get('system','admin_email'));
$r = q("UPDATE account SET account_roles = 0 WHERE account_created > '2025-06-24 00:00:00' AND account_email <> '%s'",
dbesc($admin_email)
);
if($r) {
dbq("COMMIT");
return UPDATE_SUCCESS;
}
dbq("ROLLBACK");
return UPDATE_FAILED;
}
}

View File

@@ -70,10 +70,10 @@ require_once('include/security.php');
define('PLATFORM_NAME', 'hubzilla');
define('STD_VERSION', '10.4.2');
define('STD_VERSION', '10.4.4');
define('ZOT_REVISION', '6.0');
define('DB_UPDATE_VERSION', 1263);
define('DB_UPDATE_VERSION', 1264);
define('PROJECT_BASE', __DIR__);

9
doc/en/TermsOfService.md Normal file
View File

@@ -0,0 +1,9 @@
### Privacy Policy
#include doc/en/gdpr1.md;
### Terms of Service
#include doc/en/SiteTOS.md;

View File

@@ -145,10 +145,6 @@ function check_account_invite($invite_code) {
}
function check_account_admin($arr) {
if (is_site_admin()) {
return true;
}
$admin_email = trim(Config::Get('system','admin_email'));
if (strlen($admin_email) && $admin_email === trim($arr['reg_email'])) {

View File

@@ -272,7 +272,6 @@ function item_forwardable($item) {
str_contains($item['postopts'], 'nodeliver') ||
// actor not fetchable
(isset($item['author']['xchan_network']) && in_array($item['author']['xchan_network'], ['rss', 'anon', 'token']))
) {
return false;
}
@@ -5387,6 +5386,7 @@ function item_by_item_id(int $id, int $parent, int $type = ITEM_TYPE_POST): arra
item.id = %d
AND item.uid = %d
AND item.verb IN ('Create', 'Update', 'EmojiReact')
AND item.obj_type NOT IN ('Answer')
$item_normal_sql",
intval($id),
intval(local_channel())
@@ -5472,6 +5472,7 @@ function items_by_parent_ids(array $parents, null|array $thr_parents = null, str
FROM item
WHERE item.parent IN ($ids)
AND item.verb IN ('Create', 'Update', 'EmojiReact')
AND item.obj_type NOT IN ('Answer')
AND item.item_thread_top = 0
$thr_parent_sql
$permission_sql
@@ -5550,6 +5551,7 @@ function item_reaction_sql(string $ids, string $permission_sql = '', string $joi
$observer_sql
FROM item
WHERE item.verb IN ($verbs_str)
AND item.obj_type NOT IN ('Answer')
AND item.item_thread_top = 0
AND item.parent IN ($ids)
$item_normal_sql
@@ -5625,6 +5627,7 @@ function items_by_thr_parent(string $mid, int $parent, int|null $offset = null):
item.thr_parent = '%s'
AND item.uid = %d
AND item.verb IN ('Create', 'Update', 'EmojiReact')
AND item.obj_type NOT IN ('Answer')
AND item.item_thread_top = 0
$item_normal_sql
$order_sql",
@@ -5652,6 +5655,7 @@ function items_by_thr_parent(string $mid, int $parent, int|null $offset = null):
item.thr_parent = '%s'
AND item.uid = %d
AND item.verb IN ('Create', 'Update', 'EmojiReact')
AND item.obj_type NOT IN ('Answer')
AND item.item_thread_top = 0
$permission_sql
$item_normal_sql
@@ -5771,3 +5775,29 @@ function get_recursive_thr_parents(array $item): array|null
return $thr_parents;
}
/**
* @brief updates most common AS1 verbs to their AS2 equivalent.
* @param array $items an array of items where at least item_id (the parent id) and verb should be set.
*
*/
function AS1_to_AS2_verbs($items) {
$replaceable = [
ACTIVITY_POST
];
foreach($items as $item) {
if (isset($item['verb'], $item['item_id']) && in_array($item['verb'], $replaceable)) {
q("UPDATE item
SET verb = CASE
WHEN verb = 'http://activitystrea.ms/schema/1.0/post' THEN 'Create'
WHEN verb = 'http://activitystrea.ms/schema/1.0/like' THEN 'Like'
WHEN verb = 'http://activitystrea.ms/schema/1.0/dislike' THEN 'Dislike'
ELSE verb -- Keep the current
END
WHERE parent = %d",
intval($item['item_id'])
);
}
}
}

View File

@@ -487,14 +487,14 @@ function wtagblock($uid,$count = 0,$authors = '',$owner = '', $flags = 0,$restri
intval($uid)
);
$channel = App::get_channel();
$url = z_root() . '/channel/' . $channel['channel_address'].'/?f=&tag=';
$tpl = get_markup_template('tagcloud.tpl');
$o .= replace_macros($tpl, [
'$title' => t('Tags'),
'$baseurl' => $url,
'$tags' => $r,
]);
$url = z_root() . '/channel/' . $c[0]['channel_address'].'/?f=&tag=';
$tpl = get_markup_template('tagcloud.tpl');
$o .= replace_macros($tpl, [
'$title' => t('Tags'),
'$baseurl' => $url,
'$tags' => $r,
]);
}
return $o;
@@ -511,13 +511,14 @@ function catblock($uid,$count = 0,$authors = '',$owner = '', $flags = 0,$restric
intval($uid)
);
$url = z_root() . '/channel/' . $c[0]['channel_address'].'/?f=&cat=';
$tpl = get_markup_template('tagcloud.tpl');
$o .= replace_macros($tpl, [
'$title' => t('Categories'),
'$baseurl' => $url,
'$tags' => $r,
]);
$url = z_root() . '/channel/' . $c[0]['channel_address'].'/?f=&cat=';
$tpl = get_markup_template('tagcloud.tpl');
$o .= replace_macros($tpl, [
'$title' => t('Categories'),
'$baseurl' => $url,
'$tags' => $r,
]);
}
return $o;