aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Zotlabs/Module/Admin/Site.php3
-rwxr-xr-xboot.php2
-rwxr-xr-xinclude/items.php12
-rw-r--r--include/text.php12
-rw-r--r--tests/unit/AutonameTest.php7
5 files changed, 30 insertions, 6 deletions
diff --git a/Zotlabs/Module/Admin/Site.php b/Zotlabs/Module/Admin/Site.php
index b7c558ce7..880dbbe4b 100644
--- a/Zotlabs/Module/Admin/Site.php
+++ b/Zotlabs/Module/Admin/Site.php
@@ -220,9 +220,10 @@ class Site {
$realm = get_directory_realm();
// directory server should not be set or settable unless we are a directory client
+ // avoid older redmatrix servers which don't have modern encryption
if($dirmode == DIRECTORY_MODE_NORMAL) {
- $x = q("select site_url from site where site_flags in (%d,%d) and site_realm = '%s' and site_dead = 0",
+ $x = q("select site_url from site where site_flags in (%d,%d) and site_realm = '%s' and site_dead = 0 and site_project != 'redmatrix'",
intval(DIRECTORY_MODE_SECONDARY),
intval(DIRECTORY_MODE_PRIMARY),
dbesc($realm)
diff --git a/boot.php b/boot.php
index 7530f3123..dbc5e6dcc 100755
--- a/boot.php
+++ b/boot.php
@@ -84,8 +84,6 @@ define ( 'DIRECTORY_FALLBACK_MASTER', 'https://gravizot.de');
$DIRECTORY_FALLBACK_SERVERS = array(
'https://hubzilla.zottel.net',
- 'https://my.federated.social',
- //'https://hubzilla.nl',
'https://gravizot.de'
);
diff --git a/include/items.php b/include/items.php
index 5a98fbbd4..790b91c88 100755
--- a/include/items.php
+++ b/include/items.php
@@ -2464,7 +2464,7 @@ function tag_deliver($uid, $item_id) {
// this is an update (edit) to a post which was already processed by us and has a second delivery chain
// Just start the second delivery chain to deliver the updated post
// after resetting ownership and permission bits
-
+ logger('updating edited tag_deliver post for ' . $u[0]['channel_address']);
start_delivery_chain($u[0], $item, $item_id, 0);
return;
}
@@ -2767,6 +2767,16 @@ function tgroup_check($uid, $item) {
return false;
}
+
+ // see if we already have this item. Maybe it is being updated.
+
+ $r = q("select id from item where mid = '%s' and uid = %d limit 1",
+ dbesc($item['mid']),
+ intval($uid)
+ );
+ if($r)
+ return true;
+
if(! perm_is_allowed($uid,$item['author_xchan'],'tag_deliver'))
return false;
diff --git a/include/text.php b/include/text.php
index 6014f7437..d4cfecd75 100644
--- a/include/text.php
+++ b/include/text.php
@@ -2019,15 +2019,27 @@ function item_post_type($item) {
return $post_type;
}
+// This needs to be fixed to use quoted tag strings
function undo_post_tagging($s) {
+
$matches = null;
+ // undo tags and mentions
$cnt = preg_match_all('/([@#])(\!*)\[zrl=(.*?)\](.*?)\[\/zrl\]/ism',$s,$matches,PREG_SET_ORDER);
if($cnt) {
foreach($matches as $mtch) {
$s = str_replace($mtch[0], $mtch[1] . $mtch[2] . str_replace(' ','_',$mtch[4]),$s);
}
}
+ // undo forum tags
+ $cnt = preg_match_all('/\!\[zrl=(.*?)\](.*?)\[\/zrl\]/ism',$s,$matches,PREG_SET_ORDER);
+ if($cnt) {
+ foreach($matches as $mtch) {
+ $s = str_replace($mtch[0], '!' . str_replace(' ','_',$mtch[2]),$s);
+ }
+ }
+
+
return $s;
}
diff --git a/tests/unit/AutonameTest.php b/tests/unit/AutonameTest.php
index 33e237bb9..314849b39 100644
--- a/tests/unit/AutonameTest.php
+++ b/tests/unit/AutonameTest.php
@@ -62,13 +62,16 @@ class AutonameTest extends TestCase {
/**
* test with a length, that may be too short
+ * length is maximum - autoname can return something shorter.
*/
public function testAutonameLength1() {
$autoname1=autoname(1);
- $this->assertEquals(1, strlen($autoname1));
+ $test = ((strlen($autoname1) < 2) ? 1 : 0);
+ $this->assertEquals(1, $test);
$autoname2=autoname(1);
- $this->assertEquals(1, strlen($autoname2));
+ $test = ((strlen($autoname2) < 2) ? 1 : 0);
+ $this->assertEquals(1, $test));
// The following test is problematic, with only 26 possibilities
// generating the same thing twice happens often aka