]> git.mxchange.org Git - friendica.git/commitdiff
email header encoding everywhere
authorfriendica <info@friendica.com>
Fri, 4 Jan 2013 23:47:29 +0000 (15:47 -0800)
committerfriendica <info@friendica.com>
Fri, 4 Jan 2013 23:47:29 +0000 (15:47 -0800)
boot.php
include/items.php
include/user.php
mod/dfrn_confirm.php
mod/invite.php
mod/lostpass.php
mod/register.php
mod/regmod.php

index 380dfb0ce816b3dd0048a669fe4608bf99e3f779..a0febceeb56f0c0ede46ec610d7d3bfcf880e0b1 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -847,9 +847,10 @@ if(! function_exists('check_config')) {
                                                                        '$error' => sprintf( t('Update %s failed. See error logs.'), $x)
                                                                ));
                                                                $subject=sprintf(t('Update Error at %s'), $a->get_baseurl());
-                                                                       
+                                                               require_once('include/email.php');
+                                                               $subject = email_header_encode($subject,'UTF-8');       
                                                                mail($a->config['admin_email'], $subject, $email_msg,
-                                                                       'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] . "\n"
+                                                                       'From: ' . 'Administrator' . '@' . $_SERVER['SERVER_NAME'] . "\n"
                                                                        . 'Content-type: text/plain; charset=UTF-8' . "\n"
                                                                        . 'Content-transfer-encoding: 8bit' );
                                                                //try the logger
index 7eb090136f6bd2d9c3fc5c36dd20f83e9319613c..b465c444ed5cdbec262771edb77949338306adfd 100755 (executable)
@@ -5,7 +5,7 @@ require_once('include/oembed.php');
 require_once('include/salmon.php');
 require_once('include/crypto.php');
 require_once('include/Photo.php');
-
+require_once('include/email.php');
 
 function get_feed_for(&$a, $dfrn_id, $owner_nick, $last_update, $direction = 0) {
 
@@ -3370,9 +3370,9 @@ function new_follower($importer,$contact,$datarray,$item,$sharing = false) {
                                        '$sitename' => $a->config['sitename']
                                ));
                                $res = mail($r[0]['email'], 
-                                       (($sharing) ? t('A new person is sharing with you at ') : t("You have a new follower at ")) . $a->config['sitename'],
+                                       email_header_encode((($sharing) ? t('A new person is sharing with you at ') : t("You have a new follower at ")) . $a->config['sitename'],'UTF-8'),
                                        $email,
-                                       'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] . "\n"
+                                       'From: ' . 'Administrator' . '@' . $_SERVER['SERVER_NAME'] . "\n"
                                        . 'Content-type: text/plain; charset=UTF-8' . "\n"
                                        . 'Content-transfer-encoding: 8bit' );
                        
index 282bbdbba24761acc46d6a9bfeb78b25cf725678..6f4ab30215a109f3187b14061831b96b95523bbc 100644 (file)
@@ -7,6 +7,7 @@ require_once('include/text.php');
 require_once('include/pgettext.php');
 require_once('include/datetime.php');
 
+
 function create_user($arr) {
 
        // Required: { username, nickname, email } or { openid_url }
index f02119807f83b8e53e558ff8193711404ddeafaf..769036c5e0b694627bdfba20a4669c6cd5be9e58 100644 (file)
@@ -746,10 +746,11 @@ function dfrn_confirm_post(&$a,$handsfree = null) {
                                '$dfrn_url' => $r[0]['url'],
                                '$uid' => $newuid )
                        );
-       
-                       $res = mail($r[0]['email'], sprintf( t("Connection accepted at %s") , $a->config['sitename']),
+                       require_once('include/email.php');
+
+                       $res = mail($r[0]['email'], email_header_encode( sprintf( t("Connection accepted at %s") , $a->config['sitename']),'UTF-8'),
                                $email_tpl,
-                               'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] . "\n"
+                               'From: ' . 'Administrator' . '@' . $_SERVER['SERVER_NAME'] . "\n"
                                . 'Content-type: text/plain; charset=UTF-8' . "\n"
                                . 'Content-transfer-encoding: 8bit' );
 
index 2dbf93c590bd8e1480a18ee1485a852085a871d2..384161c6d34616ab3667654a17de6e86a394375b 100644 (file)
@@ -7,6 +7,8 @@
  *
  */
 
+require_once('include/email.php');
+
 function invite_post(&$a) {
 
        if(! local_user()) {
@@ -56,7 +58,7 @@ function invite_post(&$a) {
                else
                        $nmessage = $message;
 
-               $res = mail($recip, sprintf( t('Please join us on Friendica'), $a->config['sitename']), 
+               $res = mail($recip, email_header_encode( t('Please join us on Friendica'),'UTF-8'), 
                        $nmessage, 
                        "From: " . $a->user['email'] . "\n"
                        . 'Content-type: text/plain; charset=UTF-8' . "\n"
index 57e6d696537c24b3e5440d751b5e1fa6c4e6625a..cc31efd973f663c9ee9697129efa65a0f44a1146 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 
+require_once('include/email.php');
 
 function lostpass_post(&$a) {
 
@@ -40,9 +41,9 @@ function lostpass_post(&$a) {
                        '$reset_link' => $a->get_baseurl() . '/lostpass?verify=' . $new_password
        ));
 
-       $res = mail($email, sprintf( t('Password reset requested at %s'),$a->config['sitename']),
+       $res = mail($email, email_header_encode(sprintf( t('Password reset requested at %s'),$a->config['sitename']),'UTF-8'),
                        $email_tpl,
-                       'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] . "\n"
+                       'From: ' . 'Administrator' . '@' . $_SERVER['SERVER_NAME'] . "\n"
                        . 'Content-type: text/plain; charset=UTF-8' . "\n"
                        . 'Content-transfer-encoding: 8bit' );
 
@@ -103,8 +104,10 @@ function lostpass_content(&$a) {
                        '$new_password' => $new_password,
                        '$uid' => $newuid ));
 
-                       $res = mail($email,"Your password has changed at {$a->config['sitename']}",$email_tpl,
-                               'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] . "\n"
+                       $subject = sprintf( t('Your password has been changed at %s'), $a->config['sitename']);
+
+                       $res = mail($email, email_header_encode( $subject, 'UTF-8'), $email_tpl,
+                               'From: ' . 'Administrator' . '@' . $_SERVER['SERVER_NAME'] . "\n"
                                . 'Content-type: text/plain; charset=UTF-8' . "\n"
                                . 'Content-transfer-encoding: 8bit' );
 
index f4c6570877ff2dc7e681d02c452a1db588b06306..3532f92e8d132e65d6b17578325c557ae314fc3a 100644 (file)
@@ -1,5 +1,7 @@
 <?php
 
+require_once('include/email.php');
+
 if(! function_exists('register_post')) {
 function register_post(&$a) {
 
@@ -86,9 +88,9 @@ function register_post(&$a) {
                                '$password' => $result['password'],
                                '$uid' => $user['uid'] ));
 
-               $res = mail($user['email'], sprintf(t('Registration details for %s'), $a->config['sitename']),
+               $res = mail($user['email'], email_header_encode( sprintf( t('Registration details for %s'), $a->config['sitename']),'UTF-8'),
                        $email_tpl, 
-                               'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] . "\n"
+                               'From: ' . 'Administrator' . '@' . $_SERVER['SERVER_NAME'] . "\n"
                                . 'Content-type: text/plain; charset=UTF-8' . "\n"
                                . 'Content-transfer-encoding: 8bit' );
 
@@ -140,9 +142,9 @@ function register_post(&$a) {
                                '$hash' => $hash
                 ));
 
-               $res = mail($a->config['admin_email'], sprintf(t('Registration request at %s'), $a->config['sitename']),
+               $res = mail($a->config['admin_email'], email_header_encode( sprintf(t('Registration request at %s'), $a->config['sitename']),'UTF-8'),
                        $email_tpl,
-                               'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] . "\n"
+                               'From: ' . 'Administrator' . '@' . $_SERVER['SERVER_NAME'] . "\n"
                                . 'Content-type: text/plain; charset=UTF-8' . "\n"
                                . 'Content-transfer-encoding: 8bit' );
 
index 21f41eb01ccc3c854443f22e3465ba50cc3797fa..5ed7642005628546069db335f818a55e97fe5971 100644 (file)
@@ -1,5 +1,7 @@
 <?php
 
+require_once('include/email.php');
+
 function user_allow($hash) {
 
        $a = get_app();
@@ -49,9 +51,9 @@ function user_allow($hash) {
                        '$uid' => $user[0]['uid']
        ));
 
-       $res = mail($user[0]['email'], sprintf(t('Registration details for %s'), $a->config['sitename']),
+       $res = mail($user[0]['email'], email_header_encode( sprintf(t('Registration details for %s'), $a->config['sitename']), 'UTF-8'),
                $email_tpl,
-                       'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] . "\n"
+                       'From: ' . 'Administrator' . '@' . $_SERVER['SERVER_NAME'] . "\n"
                        . 'Content-type: text/plain; charset=UTF-8' . "\n"
                        . 'Content-transfer-encoding: 8bit' );