]> git.mxchange.org Git - friendica.git/commitdiff
Fix corrupt registration emails
authorHypolite Petovan <mrpetovan@gmail.com>
Fri, 15 Jun 2018 03:42:08 +0000 (23:42 -0400)
committerHypolite Petovan <mrpetovan@gmail.com>
Fri, 15 Jun 2018 03:42:08 +0000 (23:42 -0400)
- Use double quotes for line break-containing translation string
- Simplify HTML/plaintext email body conversion

include/enotify.php

index 7eb2c80ebc5964d5a89f70b8966c233f55874ba3..57e7b2df0831b962e9fb8cc10303f8dcfa0c6014 100644 (file)
@@ -366,7 +366,7 @@ function notification($params)
                                        '[url='.$params['source_link'].']'.$params['source_name'].'[/url]'
                                );
 
-                               $body = L10n::t('Full Name:     %1$s\nSite Location:    %2$s\nLogin Name:       %3$s ' . "\x28" . '%4$s' . "\x29",
+                               $body = L10n::t("Full Name:     %s\nSite Location:      %s\nLogin Name: %s (%s)",
                                        $params['source_name'],
                                        $siteurl, $params['source_mail'],
                                        $params['source_nick']
@@ -562,11 +562,8 @@ function notification($params)
                        }
                }
 
-               // textversion keeps linebreaks
-               $textversion = strip_tags(str_replace("<br>", "\n", html_entity_decode(BBCode::convert(stripslashes(str_replace(["\\r\\n", "\\r", "\\n"], "\n",
-                       $body))),ENT_QUOTES, 'UTF-8')));
-               $htmlversion = html_entity_decode(BBCode::convert(stripslashes(str_replace(["\\r\\n", "\\r", "\\n\\n", "\\n"],
-                       "<br />\n", $body))), ENT_QUOTES, 'UTF-8');
+               $textversion = BBCode::toPlaintext($body);
+               $htmlversion = BBCode::convert($body);
 
                $datarray = [];
                $datarray['banner'] = $banner;