mirror of
https://framagit.org/hubzilla/core.git
synced 2026-06-25 02:29:11 -04:00
Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a2ba81afe1 | ||
|
|
a15254a1e2 | ||
|
|
3a50b185ce | ||
|
|
77866625cc | ||
|
|
f6275fdb79 | ||
|
|
1ab1da5816 | ||
|
|
aaa863cda7 | ||
|
|
3c722f9aa7 | ||
|
|
14f28907bc | ||
|
|
185f53d298 | ||
|
|
3ae42d471a | ||
|
|
0a817f952e | ||
|
|
bc7f8b15a8 | ||
|
|
02111ad649 | ||
|
|
6f00964d47 | ||
|
|
eafa1d56c3 |
@@ -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=$?
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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]);
|
||||
|
||||
@@ -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
29
Zotlabs/Update/_1264.php
Normal 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;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
4
boot.php
4
boot.php
@@ -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
9
doc/en/TermsOfService.md
Normal file
@@ -0,0 +1,9 @@
|
||||
### Privacy Policy
|
||||
|
||||
#include doc/en/gdpr1.md;
|
||||
|
||||
|
||||
### Terms of Service
|
||||
|
||||
#include doc/en/SiteTOS.md;
|
||||
|
||||
@@ -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'])) {
|
||||
|
||||
@@ -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'])
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user