aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Zotlabs/Module/Admin.php2
-rw-r--r--Zotlabs/Module/Filestorage.php2
-rw-r--r--Zotlabs/Update/_1218.php4
-rw-r--r--Zotlabs/Update/_1219.php26
-rwxr-xr-xboot.php2
-rw-r--r--include/markdown.php5
-rwxr-xr-xinclude/plugin.php2
7 files changed, 36 insertions, 7 deletions
diff --git a/Zotlabs/Module/Admin.php b/Zotlabs/Module/Admin.php
index 2df8dc25d..6edced9b5 100644
--- a/Zotlabs/Module/Admin.php
+++ b/Zotlabs/Module/Admin.php
@@ -109,7 +109,7 @@ class Admin extends \Zotlabs\Web\Controller {
// available channels, primary and clones
$channels = array();
- $r = q("SELECT COUNT(*) AS total, COUNT(CASE WHEN channel_primary = 1 THEN 1 ELSE NULL END) AS main, COUNT(CASE WHEN channel_primary = 0 THEN 1 ELSE NULL END) AS clones FROM channel WHERE channel_removed = 0");
+ $r = q("SELECT COUNT(*) AS total, COUNT(CASE WHEN channel_primary = 1 THEN 1 ELSE NULL END) AS main, COUNT(CASE WHEN channel_primary = 0 THEN 1 ELSE NULL END) AS clones FROM channel WHERE channel_removed = 0 and channel_system = 0");
if ($r) {
$channels['total'] = array('label' => t('Channels'), 'val' => $r[0]['total']);
$channels['main'] = array('label' => t('Primary'), 'val' => $r[0]['main']);
diff --git a/Zotlabs/Module/Filestorage.php b/Zotlabs/Module/Filestorage.php
index cd9ab601d..23bd63f95 100644
--- a/Zotlabs/Module/Filestorage.php
+++ b/Zotlabs/Module/Filestorage.php
@@ -128,7 +128,7 @@ class Filestorage extends \Zotlabs\Web\Controller {
}
}
- if(json_return)
+ if($json_return)
json_return_and_die([ 'success' => true ]);
goaway(dirname($url));
diff --git a/Zotlabs/Update/_1218.php b/Zotlabs/Update/_1218.php
index 67d8b49a5..07c7dba20 100644
--- a/Zotlabs/Update/_1218.php
+++ b/Zotlabs/Update/_1218.php
@@ -7,9 +7,9 @@ class _1218 {
function run() {
if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) {
- $r1 = q("ALTER TABLE hubloc add hubloc_id_url text NOT NULL");
+ $r1 = q("ALTER TABLE hubloc add hubloc_id_url text NOT NULL DEFAULT ''");
$r2 = q("create index \"hubloc_id_url\" on hubloc (\"hubloc_id_url\")");
- $r3 = q("ALTER TABLE hubloc add hubloc_site_id text NOT NULL");
+ $r3 = q("ALTER TABLE hubloc add hubloc_site_id text NOT NULL DEFAULT ''");
$r4 = q("create index \"hubloc_site_id\" on hubloc (\"hubloc_site_id\")");
$r = $r1 && $r2 && $r3 && $r4;
diff --git a/Zotlabs/Update/_1219.php b/Zotlabs/Update/_1219.php
new file mode 100644
index 000000000..be2534001
--- /dev/null
+++ b/Zotlabs/Update/_1219.php
@@ -0,0 +1,26 @@
+<?php
+
+namespace Zotlabs\Update;
+
+class _1219 {
+
+ function run() {
+ q("START TRANSACTION");
+
+ $r = q("DELETE FROM xchan WHERE
+ xchan_hash like '%s' AND
+ xchan_network = 'activitypub'",
+ dbesc(z_root()) . '%'
+ );
+
+ if($r) {
+ q("COMMIT");
+ return UPDATE_SUCCESS;
+ }
+ else {
+ q("ROLLBACK");
+ return UPDATE_FAILED;
+ }
+ }
+
+}
diff --git a/boot.php b/boot.php
index 8518a17f6..6c56a7dc0 100755
--- a/boot.php
+++ b/boot.php
@@ -54,7 +54,7 @@ define ( 'STD_VERSION', '3.7.1' );
define ( 'ZOT_REVISION', '6.0a' );
-define ( 'DB_UPDATE_VERSION', 1218 );
+define ( 'DB_UPDATE_VERSION', 1219 );
define ( 'PROJECT_BASE', __DIR__ );
diff --git a/include/markdown.php b/include/markdown.php
index f4944e2cc..e5f5b9369 100644
--- a/include/markdown.php
+++ b/include/markdown.php
@@ -255,6 +255,9 @@ function bb_to_markdown($Text, $options = []) {
$Text = html2markdown($Text);
+ //html2markdown adds backslashes infront of hashes after a new line. remove them
+ $Text = str_replace("\n\#", "\n#", $Text);
+
// It also adds backslashes to our attempt at getting around the html entity preservation for some weird reason.
//$Text = str_replace(array('&\\_lt\\_;','&\\_gt\\_;','&\\_amp\\_;'),array('&lt;','&gt;','&amp;'),$Text);
@@ -374,4 +377,4 @@ class TableConverter implements ConverterInterface
{
return array('table', 'tr', 'thead', 'td', 'tbody');
}
-} \ No newline at end of file
+}
diff --git a/include/plugin.php b/include/plugin.php
index 23cb2b5f6..ea3c67c2f 100755
--- a/include/plugin.php
+++ b/include/plugin.php
@@ -432,7 +432,7 @@ function insert_hook($hook, $fn, $version = 0, $priority = 0) {
function call_hooks($name, &$data = null) {
$a = 0;
- if((is_array(App::$hooks)) && (array_key_exists($name, App::$hooks))) {
+ if (isset(App::$hooks[$name])) {
foreach(App::$hooks[$name] as $hook) {
$origfn = $hook[1];
if($hook[0])