]> git.mxchange.org Git - friendica-addons.git/blobdiff - notifyall/NotifyAllEmail.php
Merge pull request '[bluesky] Fix double dollar sign in bluesky_fetch_notifications...
[friendica-addons.git] / notifyall / NotifyAllEmail.php
index 96a57a67fd01f3922c3d440c1eb4732cc10abf28..7a00a2c976ac44fb83a9d05e7512791d7dc88828 100644 (file)
@@ -1,11 +1,31 @@
 <?php
+/**
+ * @copyright Copyright (C) 2020, Friendica
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
 
 namespace Friendica\Addon\notifyall;
 
 use Friendica\App\BaseURL;
 use Friendica\Content\Text\BBCode;
-use Friendica\Core\Config\IConfig;
+use Friendica\Core\Config\Capability\IManageConfigValues;
 use Friendica\Core\L10n;
+use Friendica\Model\User;
 use Friendica\Object\Email;
 
 /**
@@ -13,7 +33,7 @@ use Friendica\Object\Email;
  */
 class NotifyAllEmail extends Email
 {
-       public function __construct(L10n $l10n, IConfig $config, BaseURL $baseUrl, string $text)
+       public function __construct(L10n $l10n, IManageConfigValues $config, BaseURL $baseUrl, string $text)
        {
                $sitename = $config->get('config', 'sitename');
 
@@ -24,16 +44,16 @@ class NotifyAllEmail extends Email
                }
 
                if (!$config->get('config', 'sender_email')) {
-                       $sender_email = 'noreply@' . $baseUrl->getHostname();
+                       $sender_email = 'noreply@' . $baseUrl->getHost();
                } else {
                        $sender_email = $config->get('config', 'sender_email');
                }
 
                $subject = $_REQUEST['subject'];
 
-               $textversion = strip_tags(html_entity_decode(BBCode::convert(stripslashes(str_replace(["\\r", "\\n"], ["", "\n"], $text))), ENT_QUOTES, 'UTF-8'));
+               $textversion = strip_tags(html_entity_decode(BBCode::convertForUriId(User::getSystemUriId(), stripslashes(str_replace(["\\r", "\\n"], ["", "\n"], $text))), ENT_QUOTES, 'UTF-8'));
 
-               $htmlversion = BBCode::convert(stripslashes(str_replace(["\\r", "\\n"], ["", "<br />\n"], $text)));
+               $htmlversion = BBCode::convertForUriId(User::getSystemUriId(), stripslashes(str_replace(["\\r", "\\n"], ["", "<br />\n"], $text)));
 
                parent::__construct($sender_name, $sender_email, $sender_email, '', $subject, $htmlversion, $textversion);
        }