Compare commits

...

24 Commits
9.0 ... 9.0.2

Author SHA1 Message Date
Mario
0c1d0f7498 version 9.0.2 2024-06-07 09:25:15 +00:00
Mario
81ba070e1a update changelog
(cherry picked from commit bd5f77dbeb)

Co-authored-by: Mario <mario@mariovavti.com>
2024-06-07 09:23:32 +00:00
Mario
a7812657f1 update changelog
(cherry picked from commit d862a6f075)

Co-authored-by: Mario <mario@mariovavti.com>
2024-06-07 09:23:02 +00:00
Mario
18725c47a0 move button class to the right dom
(cherry picked from commit 59b8c8ad48)

Co-authored-by: Mario <mario@mariovavti.com>
2024-06-07 09:12:32 +00:00
Mario
75e1b70584 php warnings/errors
(cherry picked from commit 10d1cbd3ce)

Co-authored-by: Mario <mario@mariovavti.com>
2024-06-04 09:09:41 +00:00
Mario
1dc73935d9 deal with inReplyTo array
(cherry picked from commit 2145207ad2)

Co-authored-by: Mario <mario@mariovavti.com>
2024-06-04 09:08:32 +00:00
Mario
7d7b43c5b9 hotfix to mitigate queueworker crash
(cherry picked from commit a4d63ab9a3)

Co-authored-by: Mario <mario@mariovavti.com>
2024-06-04 09:06:50 +00:00
Mario
b5223a4efb add pdl for mod home
(cherry picked from commit fe43e0994f)
2024-03-27 10:01:33 +00:00
Mario
d71c2c245f reduce default directory result set
(cherry picked from commit f85d2d3423)
2024-03-26 14:59:45 +00:00
Mario
526729c0f1 changelog
(cherry picked from commit 418b1eaf78)
2024-03-26 10:06:05 +00:00
Mario
1cd3369f6a version 9.0.1 2024-03-26 09:53:38 +00:00
Mario
c26ae553e6 if the updated item contains an open modal, the modal we be replaced with the new data but the backdrop will stay because it is attached to the end of the page -> remove it
(cherry picked from commit e0ac7b7f9f)
2024-03-26 09:28:25 +00:00
Mario
8d78698d00 deprecated bootstrap namespace in list mode
(cherry picked from commit 80d1e07908)
2024-03-25 21:53:25 +00:00
Mario
d5c189753a wrong dreport link in blog mode
(cherry picked from commit f72f5c7321)
2024-03-25 21:53:06 +00:00
Mario
9861e7a0c4 more bootstrap override
(cherry picked from commit a5d483fb5d)
2024-03-25 21:52:42 +00:00
Mario
6d5fa9205c more remove additional linebreaks after block element plus test
(cherry picked from commit 53354a1930)
2024-03-25 21:52:14 +00:00
Mario
0fee7804fb allow to run additional site specific commands at the end of util/udall
(cherry picked from commit c052b7fa99)
2024-03-25 21:51:49 +00:00
Mario
4002dbaa8b Merge branch 'master' of https://framagit.org/hubzilla/core 2024-03-25 17:32:11 +00:00
Mario
57e32a7912 add observer to the permissions query. this should not be necessary but it makes it clear why it should be included in the cache key 2024-03-25 17:31:53 +00:00
Mario
b6a72d6e4e tilt the piin
(cherry picked from commit 637f39f282)
2024-03-25 17:19:32 +00:00
Mario
6e592ed200 add the observer hash to the cache key in categories_widget() 2024-03-25 17:18:26 +00:00
Mario
6c033fc776 Merge branch 'fix-category-widget-template' into 'dev'
Fix smarty deprecation warning in category widget.

See merge request hubzilla/core!2116

(cherry picked from commit 2ff84ab25a)

b139e5bb Fix smarty deprecation warning in category widget.
2024-03-25 14:21:39 +00:00
Mario
7c4362db53 make sure we preserve linefeeds in the actual content of lists and tables also add tests
(cherry picked from commit 3c0d6339bb)
2024-03-24 17:00:56 +00:00
Mario
f7bf9ede72 revert default to activity type Article until we have a more stable solution to override it for platforms which do not support it
(cherry picked from commit ecdd9a4d6e)
2024-03-23 11:20:44 +00:00
22 changed files with 128 additions and 41 deletions

View File

@@ -1,3 +1,26 @@
Hubzilla 9.0.2 (2024-06-07)
- Fix buttons in event viewer
- Fix some PHP warnings and errors
- Fix issue when inReplyTo field is an array
- Fix possible queueworker crash
- Fix missing pdl file for mod home
- Reduced default directory result set
- Fix fatal error in likebanner addon
- Fix fatal error in hilite addon
Hubzilla 9.0.1 (2024-03-26)
- Fix an issue where after an update initiated from a modal the modal backdrop would remain
- Fix bootstrap namespace in conv list templates
- Fix link to delivery report in conv list templates
- Slightly improved handling of linefeeds in some bbcode block elements and added tests
- Fix categories_widget() cache not being observer aware
- Allow to run additional site specific commands at the end of util/udall in util/udall_extra
- Fix linefeeds in table and list content removed
- Pubcrawl: do not attrmpt to sign wall to wall messages - they will appear misattributed in mastodons
- Pubcrawl: default to Note activity type for now
Hubzilla 9.0 (2024-03-22)
- Refactor browser to browser encryption based on sodium plus library
- Added developer docs for the refactored test system

View File

@@ -11,6 +11,7 @@ class Cache_query {
if(! $argc == 3)
return;
$r = null;
$key = $argv[1];
$pid = get_config('procid', $key, false);
@@ -28,8 +29,10 @@ class Cache_query {
$arr = json_decode(base64_decode($argv[0]), true);
$r = call_user_func_array('q', $arr);
if($r)
if(is_array($r)) {
Cache::set($key, serialize($r));
}
del_config('procid', $key);

View File

@@ -762,7 +762,12 @@ class Activity {
$ptr = [$ptr];
}
foreach ($ptr as $att) {
if (!is_array($att)) {
continue;
}
$entry = [];
if (array_key_exists('href', $att) && $att['href']) {
$entry['href'] = $att['href'];
} elseif (array_key_exists('url', $att) && $att['url']) {
@@ -1085,12 +1090,16 @@ class Activity {
static function encode_person($p, $extended = true) {
$ret = (($extended) ? [] : '');
if (!is_array($p)) {
return $ret;
}
$c = ((array_key_exists('channel_id', $p)) ? $p : channelx_by_hash($p['xchan_hash']));
$id = (($c) ? channel_url($c) : ((filter_var($p['xchan_hash'], FILTER_VALIDATE_URL)) ? $p['xchan_hash'] : $p['xchan_url']));
$ret = (($extended) ? [] : '');
if (!$id) {
return $ret;
}
@@ -1727,9 +1736,12 @@ class Activity {
foreach ($links as $link) {
if (is_array($link) && array_key_exists('mediaType', $link) && $link['mediaType'] === 'text/html') {
$profile = $link['href'];
} elseif (is_string($link)) {
$profile = $link;
break;
}
}
if (!$profile) {
if (!$profile && isset($links[0]['href'])) {
$profile = $links[0]['href'];
}
}

View File

@@ -148,7 +148,7 @@ class ActivityStreams {
// Determine if this is a followup or response activity
$this->parent_id = $this->get_property_obj('inReplyTo');
$this->parent_id = ((is_array($this->get_property_obj('inReplyTo'))) ? $this->get_property_obj('inReplyTo')['id'] : $this->get_property_obj('inReplyTo'));
if (!$this->parent_id && isset($this->obj['inReplyTo'])) {
$this->parent_id = ((is_array($this->obj['inReplyTo'])) ? $this->obj['inReplyTo']['id'] : $this->obj['inReplyTo']);

View File

@@ -118,7 +118,7 @@ class Directory extends Controller {
$safe_mode = 1;
$type = 0;
$r = suggestion_query(local_channel(),get_observer_hash(),0,60);
$r = suggestion_query(local_channel(), get_observer_hash(), 0, 30);
if(! $r) {
notice( t('No default suggestions were found.') . EOL);

View File

@@ -153,9 +153,13 @@ class Dirsearch extends Controller {
}
$perpage = $_REQUEST['n'] ?? 60;
$page = ((isset($_REQUEST['p']) && $_REQUEST['p']) ? intval($_REQUEST['p'] - 1) : 0);
$startrec = (($page+1) * $perpage) - $perpage;
$perpage = $_REQUEST['n'] ?? 30;
if ($perpage > 30) {
$perpage = 30;
}
$page = ((isset($_REQUEST['p']) && $_REQUEST['p']) ? intval($_REQUEST['p'] - 1) : 0);
$startrec = (($page+1) * $perpage) - $perpage;
$limit = $_REQUEST['limit'] ?? 0;
$return_total = $_REQUEST['return_total'] ?? 0;

View File

@@ -404,7 +404,7 @@ class Item extends Controller {
$pagetitle = ((x($_REQUEST, 'pagetitle')) ? escape_tags($_REQUEST['pagetitle']) : '');
$layout_mid = ((x($_REQUEST, 'layout_mid')) ? escape_tags($_REQUEST['layout_mid']) : '');
$plink = ((x($_REQUEST, 'permalink')) ? escape_tags($_REQUEST['permalink']) : '');
$obj_type = ((x($_REQUEST, 'obj_type')) ? escape_tags($_REQUEST['obj_type']) : 'Article');
$obj_type = ((x($_REQUEST, 'obj_type')) ? escape_tags($_REQUEST['obj_type']) : 'Note');
// allow API to bulk load a bunch of imported items with sending out a bunch of posts.
$nopush = ((x($_REQUEST, 'nopush')) ? intval($_REQUEST['nopush']) : 0);

View File

@@ -64,7 +64,7 @@ require_once('include/selectors.php');
require_once('include/activities.php');
define('PLATFORM_NAME', 'hubzilla');
define('STD_VERSION', '9.0');
define('STD_VERSION', '9.0.2');
define('ZOT_REVISION', '6.0');
define('DB_UPDATE_VERSION', 1263);

View File

@@ -1059,8 +1059,8 @@ function bb_fix_lf($match) {
// be converted to '<br />' and turn your neatly crafted tables into a whole lot of
// empty space.
$new_content = str_replace(["\n\r", "\n", "\r"], '', $match[1]);
return str_replace($match[1], $new_content, $match[0]);
$new_content = preg_replace("/\]\s+\[/",'][', $match[1]);
return str_replace($match[1], trim($new_content, "\r\n"), $match[0]);
}
function bbtopoll($s) {
@@ -1286,6 +1286,11 @@ function bbcode($text, $options = []) {
if (strpos($text,'[pre]') !== false) {
$text = preg_replace_callback("/\[pre\](.*?)\[\/pre\]/ism", 'bb_spacefy',$text);
}
if (strpos($text,'</pre>') !== false) {
$text = str_replace(["</pre>\r", "</pre>\n"], '</pre>', $text);
}
if (strpos($text,'[summary]') !== false) {
$text = preg_replace_callback("/\[summary\](.*?)\[\/summary\]/ism", 'bb_spacefy',$text);
}
@@ -1553,6 +1558,20 @@ function bbcode($text, $options = []) {
$text = preg_replace_callback("/\[checklist\](.*?)\[\/checklist\]/ism", 'bb_checklist', $text);
}
if (strpos($text,'[/table]') !== false) {
$text = str_replace(["[/table]\r", "[/table]\n"], '[/table]', $text);
$text = preg_replace_callback("/\[table\](.*?)\[\/table\]/ism",'bb_fix_lf',$text);
$text = preg_replace("/\[table\](.*?)\[\/table\]/sm", '<table>$1</table>', $text);
$text = preg_replace_callback("/\[table border=1\](.*?)\[\/table\]/ism",'bb_fix_lf',$text);
$text = preg_replace("/\[table border=1\](.*?)\[\/table\]/sm", '<table class="table table-responsive table-bordered" >$1</table>', $text);
$text = preg_replace_callback("/\[table border=0\](.*?)\[\/table\]/ism",'bb_fix_lf',$text);
$text = preg_replace("/\[table border=0\](.*?)\[\/table\]/sm", '<table class="table table-responsive" >$1</table>', $text);
}
if (strpos($text,'[th]') !== false) {
$text = preg_replace("/\[th\](.*?)\[\/th\]/sm", '<th>$1</th>', $text);
}
@@ -1565,13 +1584,6 @@ function bbcode($text, $options = []) {
$text = preg_replace("/\[tr\](.*?)\[\/tr\]/sm", '<tr>$1</tr>', $text);
}
if (strpos($text,'[/table]') !== false) {
$text = preg_replace_callback("/\[table\](.*?)\[\/table\]/ism",'bb_fix_lf',$text);
$text = preg_replace("/\[table\](.*?)\[\/table\]/sm", '<table>$1</table>', $text);
$text = preg_replace("/\[table border=1\](.*?)\[\/table\]/sm", '<table class="table table-responsive table-bordered" >$1</table>', $text);
$text = preg_replace("/\[table border=0\](.*?)\[\/table\]/sm", '<table class="table table-responsive" >$1</table>', $text);
}
$text = str_replace('[hr]', '<hr />', $text);
// This is actually executed in prepare_body()

View File

@@ -1,6 +1,7 @@
<?php /** @file */
use Zotlabs\Lib\Cache;
use Zotlabs\Daemon\Master;
function findpeople_widget() {
@@ -66,11 +67,12 @@ function categories_widget($baseurl,$selected = '') {
require_once('include/security.php');
$sql_extra = item_permissions_sql(App::$profile['profile_uid']);
$observer = get_observer_hash();
$sql_extra = item_permissions_sql(App::$profile['profile_uid'], $observer);
$item_normal = item_normal();
$key = __FUNCTION__ . "-" . App::$profile['profile_uid'];
$key = __FUNCTION__ . '_' . md5(App::$profile['profile_uid'] . $observer);
$content = Cache::get($key, '5 MINUTE');
if (! $content) {
@@ -96,7 +98,7 @@ function categories_widget($baseurl,$selected = '') {
dbesc(ACTIVITY_UPDATE)
];
\Zotlabs\Daemon\Master::Summon([ 'Cache_query', $key, base64_encode(json_encode($arr)) ]);
Master::Summon([ 'Cache_query', $key, base64_encode(json_encode($arr)) ]);
}
if (!$content) {

View File

@@ -6,7 +6,7 @@
// To do this we need to escape these characters if they appear in our tag.
use Zotlabs\Lib\Cache;
use Zotlabs\Daemon\Master;
function file_tag_encode($s) {
return str_replace(array('<','>','[',']'),array('%3c','%3e','%5b','%5d'),$s);
@@ -357,7 +357,7 @@ function pub_tagadelic($net, $site, $limit, $recent, $safemode, $type) {
}
}
$key = __FUNCTION__ . "-" . md5($site . $recent . $safemode . $limit . $type);
$key = __FUNCTION__ . '_' . md5($site . $recent . $safemode . $limit . $type);
$content = Cache::get($key, '5 MINUTE');
if(! $content) {
@@ -377,7 +377,7 @@ function pub_tagadelic($net, $site, $limit, $recent, $safemode, $type) {
(intval($count) ? "LIMIT $count" : '')
];
\Zotlabs\Daemon\Master::Summon([ 'Cache_query', $key, base64_encode(json_encode($arr)) ]);
Master::Summon([ 'Cache_query', $key, base64_encode(json_encode($arr)) ]);
}
$r = unserialize($content);

View File

@@ -107,17 +107,33 @@ class BBCodeTest extends UnitTestCase {
"[code]\ntestvar = \"this is a test\"\necho \"the message is \$testvar\"\n[/code]",
'<pre><code>testvar = "this is a test"<br />echo "the message is $testvar"</code></pre>',
],
'code block with surroundin linebreaks \n' => [
"some text\n[code]\ntestvar = \"this is a test\"\necho \"the message is \$testvar\"\n[/code]\nsome more text",
'some text<br /><pre><code>testvar = "this is a test"<br />echo "the message is $testvar"</code></pre>some more text',
],
'list with linebreaks \n' => [
"some text\n[list]\n[*] item1\n[*] item2\n[/list]\nsome more text",
'some text<br /><ul class="listbullet"><li> item1<li> item2</ul>some more text'
],
'list with linebreaks \n in text' => [
"some text\n[list]\n[*] item1\nsome text[*] item2\nsome text[/list]\nsome more text",
'some text<br /><ul class="listbullet"><li> item1<br />some text<li> item2<br />some text</ul>some more text'
],
'list with linebreaks \r' => [
"some text\r[list]\r[*] item1\r[*] item2\r[/list]\rsome more text",
'some text<br /><ul class="listbullet"><li> item1<li> item2</ul>some more text'
],
'list with linebreaks \r in text' => [
"some text\r[list]\r[*] item1\rsome text\r[*] item2\rsome text\r[/list]\rsome more text",
'some text<br /><ul class="listbullet"><li> item1<br />some text<li> item2<br />some text</ul>some more text'
],
'list with linebreaks \r\n' => [
"some text\r\n[list]\r\n[*] item1\r\n[*] item2\r\n[/list]\r\nsome more text",
'some text<br /><ul class="listbullet"><li> item1<li> item2</ul>some more text'
],
'list with linebreaks \r\n in text' => [
"some text\r\n[list]\r\n[*] item1\r\nsome text[*] item2\r\nsome text[/list]\r\nsome more text",
'some text<br /><ul class="listbullet"><li> item1<br />some text<li> item2<br />some text</ul>some more text'
]
];
}

View File

@@ -5,7 +5,7 @@ if [ ! -d .git ]; then
fi
git pull
if [ -d extend ] ; then
if [ -d extend ]; then
for a in theme addon widget ; do
if [ -d extend/$a ]; then
for b in `ls extend/$a` ; do
@@ -15,3 +15,8 @@ if [ -d extend ] ; then
fi
done
fi
# Allow to run additional site specific commands
if [ -f util/udall_extra ]; then
source util/udall_extra
fi

View File

@@ -1,9 +1,9 @@
<?php return array(
'root' => array(
'name' => 'zotlabs/hubzilla',
'pretty_version' => 'dev-9.0RC',
'version' => 'dev-9.0RC',
'reference' => 'a18e873d08e733225c70b0ace31c3cbb025ff906',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => '3c0d6339bb12bd7fbf65ba7a79078e39737b4387',
'type' => 'application',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
@@ -338,9 +338,9 @@
'dev_requirement' => false,
),
'zotlabs/hubzilla' => array(
'pretty_version' => 'dev-9.0RC',
'version' => 'dev-9.0RC',
'reference' => 'a18e873d08e733225c70b0ace31c3cbb025ff906',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => '3c0d6339bb12bd7fbf65ba7a79078e39737b4387',
'type' => 'application',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),

View File

@@ -62,6 +62,6 @@ a {
text-decoration: none !important;
}
ol, ul, dl {
ol, ul, dl, pre {
margin-bottom: 0;
}

View File

@@ -1046,6 +1046,8 @@ function liveUpdate(notify_id) {
in_progress = false;
$('#image_counter').html('');
// remove modal backdrop in case the update was triggered from a modal
$('.modal-backdrop').remove();
})
.done( function( instance ) {
//console.log('all images successfully loaded');

4
view/pdl/mod_home.pdl Normal file
View File

@@ -0,0 +1,4 @@
[region=content]
$content
[/region]

View File

@@ -996,6 +996,10 @@ img.mail-conv-sender-photo {
margin-top: 2em;
}
.wall-item-pinned i {
transform: rotate(45deg);
}
.wall-item-content-wrapper {
background-color: var(--bs-tertiary-bg);
}

View File

@@ -6,7 +6,7 @@
</div>
{{$event.html}}
<div class="event-buttons">
{{if $event.item.plink}}<a href="{{$event.plink.0}}" title="{{$event.plink.1}}" class="plink-event-link"><i class="fa fa-external-link btn btn-outline-secondary" ></i></a>{{/if}}
{{if $event.item.plink}}<a href="{{$event.plink.0}}" title="{{$event.plink.1}}" class="btn btn-sm btn-outline-secondary border-0 plink-event-link"><i class="fa fa-external-link"></i></a>{{/if}}
</div>
<div class="clear"></div>
</div>

View File

@@ -5,7 +5,7 @@
<ul class="nav nav-pills flex-column">
<li class="nav-item"><a href="{{$base}}" class="nav-link{{if $sel_all}} active{{/if}}">{{$all}}</a></li>
{{foreach $terms as $term}}
<li class="nav-item"><a href="{{$base}}/?cat={{$term.name|urlencode}}" class="nav-link{{if $term.selected}} active{{/if}}">{{$term.name}}</a></li>
<li class="nav-item"><a href="{{$base}}/?cat={{$term.name|escape:'url'}}" class="nav-link{{if $term.selected}} active{{/if}}">{{$term.name}}</a></li>
{{/foreach}}
</ul>

View File

@@ -205,11 +205,11 @@
{{/if}}
{{if $item.edpost && $item.dreport}}
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="dreport/{{$item.mid}}">{{$item.dreport}}</a>
<a class="dropdown-item" href="dreport/{{$item.dreport_link}}">{{$item.dreport}}</a>
{{/if}}
{{if $item.settings}}
<div class="dropdown-divider"></div>
<a class="dropdown-item conversation-settings-link" href="" data-toggle="modal" data-target="#conversation_settings">{{$item.settings}}</a>
<a class="dropdown-item conversation-settings-link" href="" data-bs-toggle="modal" data-bs-target="#conversation_settings">{{$item.settings}}</a>
{{/if}}
</div>
</div>

View File

@@ -6,9 +6,9 @@
</div>
{{$event.html}}
<div class="event-buttons">
{{if $event.item.plink}}<a href="{{$event.plink.0}}" title="{{$event.plink.1}}" class="plink-event-link"><i class="fa fa-external-link btn btn-outline-secondary" ></i></a>{{/if}}
{{if $event.edit}}<a href="{{$event.edit.0}}" title="{{$event.edit.1}}" class="edit-event-link"><i class="fa fa-pencil btn btn-outline-secondary"></i></a>{{/if}}
{{if $event.drop}}<a href="{{$event.drop.0}}" title="{{$event.drop.1}}" class="drop-event-link"><i class="fa fa-trash-o btn btn-outline-secondary"></i></a>{{/if}}
{{if $event.item.plink}}<a href="{{$event.plink.0}}" title="{{$event.plink.1}}" class="btn btn-sm btn-outline-secondary border-0 plink-event-link"><i class="fa fa-external-link" ></i></a>{{/if}}
{{if $event.edit}}<a href="{{$event.edit.0}}" title="{{$event.edit.1}}" class="btn btn-sm btn-outline-secondary border-0 edit-event-link"><i class="fa fa-pencil"></i></a>{{/if}}
{{if $event.drop}}<a href="{{$event.drop.0}}" title="{{$event.drop.1}}" class="btn btn-sm btn-outline-secondary border-0 drop-event-link"><i class="fa fa-trash-o"></i></a>{{/if}}
</div>
<div class="clear"></div>
</div>