diff options
author | zotlabs <mike@macgirvin.com> | 2020-01-30 15:58:36 -0800 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2020-01-30 15:58:36 -0800 |
commit | b8d7647c48f9683909476d14c6f94195980b15a2 (patch) | |
tree | bed30f592e179da1a842114370bdd402cafb2495 | |
parent | 989443a5698adf5e7a93f874048699526aa103a7 (diff) | |
parent | c50a311ff32d7361d0809d87b03be1b4ec25b783 (diff) | |
download | volse-hubzilla-b8d7647c48f9683909476d14c6f94195980b15a2.tar.gz volse-hubzilla-b8d7647c48f9683909476d14c6f94195980b15a2.tar.bz2 volse-hubzilla-b8d7647c48f9683909476d14c6f94195980b15a2.zip |
Merge branch 'dev' of https://framagit.org/hubzilla/core into dev
-rw-r--r-- | Zotlabs/Lib/System.php | 11 | ||||
-rw-r--r-- | include/bbcode.php | 9 |
2 files changed, 17 insertions, 3 deletions
diff --git a/Zotlabs/Lib/System.php b/Zotlabs/Lib/System.php index 7bf1343bb..3cc46fbda 100644 --- a/Zotlabs/Lib/System.php +++ b/Zotlabs/Lib/System.php @@ -5,9 +5,14 @@ namespace Zotlabs\Lib; class System { static public function get_platform_name() { - if(is_array(\App::$config) && is_array(\App::$config['system']) && array_key_exists('platform_name',\App::$config['system'])) - return \App::$config['system']['platform_name']; - return PLATFORM_NAME; + static $platform_name = ''; + if(empty($platform_name)) { + if(is_array(\App::$config) && is_array(\App::$config['system']) && array_key_exists('platform_name',\App::$config['system'])) + $platform_name = \App::$config['system']['platform_name']; + else + $platform_name = PLATFORM_NAME; + } + return $platform_name; } static public function get_site_name() { diff --git a/include/bbcode.php b/include/bbcode.php index 301ffbd24..f3ecbd9e9 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -1237,9 +1237,18 @@ function bbcode($Text, $options = []) { if (strpos($Text,'[/img]') !== false) { $Text = preg_replace("/\[img\](.*?)\[\/img\]/ism", '<img style="max-width: 100%;" src="$1" alt="' . t('Image/photo') . '" />', $Text); } + // [img=pathtoimage]image description[/img] + if (strpos($Text,'[/img]') !== false) { + $Text = preg_replace("/\[img=http(.*?)\](.*?)\[\/img\]/ism", '<img style="max-width: 100%;" src="http$1" alt="$2" title="$2"/>', $Text); + } + // [zmg]pathtoimage[/zmg] if (strpos($Text,'[/zmg]') !== false) { $Text = preg_replace("/\[zmg\](.*?)\[\/zmg\]/ism", '<img class="zrl" style="max-width: 100%;" src="$1" alt="' . t('Image/photo') . '" />', $Text); } + // [zmg=pathtoimage]image description[/zmg] + if (strpos($Text,'[/zmg]') !== false) { + $Text = preg_replace("/\[zmg=http(.*?)\](.*?)\[\/zmg\]/ism", '<img class="zrl" style="max-width: 100%;" src="http$1" alt="$2" title="$2"/>', $Text); + } // [img float={left, right}]pathtoimage[/img] if (strpos($Text,'[/img]') !== false) { |