aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2024-01-01 21:21:04 +0100
committerMario Vavti <mario@mariovavti.com>2024-01-01 21:21:04 +0100
commit9e2a253ddaf4d114bbfb5a1ad80f8790f4feadd9 (patch)
treeec69eb97c566eb7816d95348f53a04ba1f4f2f5b
parentb629eb56578e1d83662aeec3be5a31457654e27d (diff)
parentf2f9cfaf28508f66c1e948e7d1a9bf6b0c637d9d (diff)
downloadvolse-hubzilla-9e2a253ddaf4d114bbfb5a1ad80f8790f4feadd9.tar.gz
volse-hubzilla-9e2a253ddaf4d114bbfb5a1ad80f8790f4feadd9.tar.bz2
volse-hubzilla-9e2a253ddaf4d114bbfb5a1ad80f8790f4feadd9.zip
Merge branch 'dev'
-rw-r--r--Zotlabs/Lib/Config.php2
-rw-r--r--Zotlabs/Photo/PhotoGd.php6
-rw-r--r--Zotlabs/Text/Tagadelic.php4
-rw-r--r--Zotlabs/Zot6/Receiver.php1
-rw-r--r--boot.php4
-rw-r--r--include/plugin.php2
-rw-r--r--include/system_unavailable.php7
-rw-r--r--include/text.php34
8 files changed, 29 insertions, 31 deletions
diff --git a/Zotlabs/Lib/Config.php b/Zotlabs/Lib/Config.php
index 5e735be34..933f4bff3 100644
--- a/Zotlabs/Lib/Config.php
+++ b/Zotlabs/Lib/Config.php
@@ -51,8 +51,6 @@ class Config {
}
App::$config[$family]['config_loaded'] = true;
}
-
-
}
}
diff --git a/Zotlabs/Photo/PhotoGd.php b/Zotlabs/Photo/PhotoGd.php
index c54fa6a7d..6854be0ab 100644
--- a/Zotlabs/Photo/PhotoGd.php
+++ b/Zotlabs/Photo/PhotoGd.php
@@ -17,11 +17,11 @@ class PhotoGd extends PhotoDriver {
$t = [];
$t['image/jpeg'] = 'jpg';
- if(imagetypes() & IMG_PNG)
+ if(\imagetypes() & IMG_PNG)
$t['image/png'] = 'png';
- if(imagetypes() & IMG_GIF)
+ if(\imagetypes() & IMG_GIF)
$t['image/gif'] = 'gif';
- if(imagetypes() & IMG_WEBP)
+ if(\imagetypes() & IMG_WEBP)
$t['image/webp'] = 'webp';
return $t;
diff --git a/Zotlabs/Text/Tagadelic.php b/Zotlabs/Text/Tagadelic.php
index 55ecf2d75..b96b60d3e 100644
--- a/Zotlabs/Text/Tagadelic.php
+++ b/Zotlabs/Text/Tagadelic.php
@@ -24,7 +24,7 @@ class Tagadelic {
$x ++;
}
- usort($tags,'self::tags_sort');
+ usort($tags, [self::class, 'tags_sort']);
$range = max(.01, $max - $min) * 1.0001;
@@ -41,4 +41,4 @@ class Tagadelic {
return((strtolower($a[0]) < strtolower($b[0])) ? -1 : 1);
}
-} \ No newline at end of file
+}
diff --git a/Zotlabs/Zot6/Receiver.php b/Zotlabs/Zot6/Receiver.php
index b276cbe31..feaef4c9a 100644
--- a/Zotlabs/Zot6/Receiver.php
+++ b/Zotlabs/Zot6/Receiver.php
@@ -22,6 +22,7 @@ class Receiver {
protected $prvkey;
protected $rawdata;
protected $sigdata;
+ protected $hub;
function __construct($handler, $localdata = null) {
diff --git a/boot.php b/boot.php
index 0de5cb6d9..ee847fae8 100644
--- a/boot.php
+++ b/boot.php
@@ -680,8 +680,8 @@ function sys_boot() {
* Load configs from db. Overwrite configs from .htconfig.php
*/
- load_config('system');
- load_config('feature');
+ Config::Load('system');
+ Config::Load('feature');
App::$session = new Zotlabs\Web\Session();
App::$session->init();
diff --git a/include/plugin.php b/include/plugin.php
index f1d501001..2a35b72de 100644
--- a/include/plugin.php
+++ b/include/plugin.php
@@ -190,7 +190,7 @@ function reload_plugins() {
$plugins = get_config('system', 'addon');
if(strlen($plugins)) {
$r = dbq("SELECT * FROM addon WHERE installed = 1");
- if(count($r))
+ if($r)
$installed = $r;
else
$installed = array();
diff --git a/include/system_unavailable.php b/include/system_unavailable.php
index 4e0e6717b..e927bc633 100644
--- a/include/system_unavailable.php
+++ b/include/system_unavailable.php
@@ -3,7 +3,10 @@
require_once("include/network.php");
function system_down() {
-http_status(503, 'Service Unavailable');
+// Set $skiplog to true here. Otherwise we will run into a loop
+// when system_unavailable() -> system_down() is called from Zotlabs\Lib\Config::Load()
+// but the DB is not available.
+http_status(503, 'Service Unavailable', true);
echo <<< EOT
<html>
<head><title>System Unavailable</title></head>
@@ -12,4 +15,4 @@ Apologies but this site is unavailable at the moment. Please try again later.
</body>
</html>
EOT;
-} \ No newline at end of file
+}
diff --git a/include/text.php b/include/text.php
index 27dd94bc5..fc30ed8aa 100644
--- a/include/text.php
+++ b/include/text.php
@@ -904,6 +904,8 @@ function get_tags($s) {
$ret[] = $mtch;
}
}
+
+
if(preg_match_all('/([@#\!]\".*?\")/',$s,$match)) {
foreach($match[1] as $mtch) {
$ret[] = $mtch;
@@ -936,6 +938,8 @@ function get_tags($s) {
// or quote remnants from the quoted strings we already picked out earlier
if(strpos($mtch,'&quot'))
continue;
+ if(strpos($mtch,'"'))
+ continue;
$ret[] = $mtch;
}
@@ -1639,6 +1643,7 @@ function format_hashtags(&$item) {
$s = '';
$terms = isset($item['term']) ? get_terms_oftype($item['term'], array(TERM_HASHTAG, TERM_COMMUNITYTAG)) : [];
+
if($terms) {
foreach($terms as $t) {
$term = htmlspecialchars($t['term'], ENT_COMPAT, 'UTF-8', false) ;
@@ -3834,30 +3839,21 @@ function featured_sort($a,$b) {
}
-// Be aware that punify will convert domain names and pathnames
-
-
-function punify($s) {
- require_once('vendor/simplepie/simplepie/idn/idna_convert.class.php');
- $x = new idna_convert(['encoding' => 'utf8']);
- return $x->encode($s);
-
+function unpunify($s) {
+ if (function_exists('idn_to_utf8') && isset($s)) {
+ return idn_to_utf8($s);
+ }
+ return $s;
}
-/**
- * Be aware that unpunify() will only convert domain names and not pathnames.
- *
- * @param string $s
- * @return string
- */
-function unpunify($s) {
- require_once('vendor/simplepie/simplepie/idn/idna_convert.class.php');
- $x = new idna_convert(['encoding' => 'utf8']);
- return $x->decode($s);
+function punify($s) {
+ if (function_exists('idn_to_ascii') && isset($s)) {
+ return idn_to_ascii($s);
+ }
+ return $s;
}
-
function unique_multidim_array($array, $key) {
$temp_array = array();
$i = 0;