Zeile 6 | Zeile 6 |
---|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* $Id: class_mailhandler.php 4267 2008-11-10 21:28:36Z Tikitiki $
| * $Id: class_mailhandler.php 4324 2009-03-05 21:23:18Z Tikitiki $
|
*/
/**
| */
/**
|
Zeile 48 | Zeile 48 |
---|
* @var string */ var $subject;
|
* @var string */ var $subject;
|
| /** * The unaltered subject of mail. * * @var string */ var $orig_subject;
|
/** * The message of the mail.
| /** * The message of the mail.
|
Zeile 123 | Zeile 130 |
---|
{ $this->return_email = ""; }
|
{ $this->return_email = ""; }
|
|
|
$this->set_to($to); $this->set_subject($subject); if($charset)
| $this->set_to($to); $this->set_subject($subject); if($charset)
|
Zeile 165 | Zeile 172 |
---|
if($this->parse_format == "html" || $this->parse_format == "both") { $this->set_html_headers($message, $message_text);
|
if($this->parse_format == "html" || $this->parse_format == "both") { $this->set_html_headers($message, $message_text);
|
}
| }
|
else { $this->message = $message;
| else { $this->message = $message;
|
Zeile 175 | Zeile 182 |
---|
/** * Sets and formats the email subject.
|
/** * Sets and formats the email subject.
|
*
| *
|
* @param string subject */ function set_subject($subject)
|
* @param string subject */ function set_subject($subject)
|
{ $this->subject = $this->utf8_encode($this->cleanup($subject)); }
| { $this->orig_subject = $this->cleanup($subject); $this->subject = $this->utf8_encode($this->orig_subject); }
|
/** * Sets and formats the recipient address.
| /** * Sets and formats the recipient address.
|
Zeile 191 | Zeile 199 |
---|
function set_to($to) { $to = $this->cleanup($to);
|
function set_to($to) { $to = $this->cleanup($to);
|
|
|
$this->to = $this->cleanup($to); }
| $this->to = $this->cleanup($to); }
|
Zeile 205 | Zeile 213 |
---|
/** * Sets the alternative headers, text/html and text/plain.
|
/** * Sets the alternative headers, text/html and text/plain.
|
*
| *
|
* @param string message */ function set_html_headers($message, $message_text="")
| * @param string message */ function set_html_headers($message, $message_text="")
|
Zeile 245 | Zeile 253 |
---|
/** * Sets the common headers.
|
/** * Sets the common headers.
|
*/
| */
|
function set_common_headers() { global $mybb;
| function set_common_headers() { global $mybb;
|
Zeile 321 | Zeile 329 |
---|
global $db; $mail_error = array(
|
global $db; $mail_error = array(
|
"subject" => $db->escape_string($this->subject),
| "subject" => $db->escape_string($this->orig_subject),
|
"message" => $db->escape_string($this->message), "toaddress" => $db->escape_string($this->to), "fromaddress" => $db->escape_string($this->from),
| "message" => $db->escape_string($this->message), "toaddress" => $db->escape_string($this->to), "fromaddress" => $db->escape_string($this->from),
|
Zeile 358 | Zeile 366 |
---|
*/ function utf8_encode($string) {
|
*/ function utf8_encode($string) {
|
$encoded_string = $string; if(strtolower($this->charset) == 'utf-8' && preg_match('/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f-\xff]/', $string))
| if(strtolower($this->charset) == 'utf-8' && preg_match('/[^\x20-\x7E]/', $string))
|
{
|
{
|
// Define start delimimter, end delimiter and spacer $end = "?="; $start = "=?" . $this->charset . "?B?"; $spacer = $end . ' ' . $start;
| $chunk_size = 47; // Derived from floor((75 - strlen("=?UTF-8?B??=")) * 0.75); $len = strlen($string); $output = ''; $pos = 0;
|
|
|
// Determine length of encoded text within chunks and ensure length is even (should NOT use the my_strlen functions) $length = 75 - strlen($start) - strlen($end); $length = floor($length/4) * 4;
// Encode the string and split it into chunks with spacers after each chunk $encoded_string = base64_encode($encoded_string); $encoded_string = chunk_split($encoded_string, $length, $spacer);
| while($pos < $len) { $newpos = min($pos + $chunk_size, $len);
while(ord($string[$newpos]) >= 0x80 && ord($string[$newpos]) < 0xC0) { // Reduce len until it's safe to split UTF-8. $newpos--; }
|
|
|
// Remove trailing spacer and add start and end delimiters $spacer = preg_quote($spacer); $encoded_string = preg_replace("/" . $spacer . "$/", "", $encoded_string); $encoded_string = $start . $encoded_string . $end;
| $chunk = substr($string, $pos, $newpos - $pos); $pos = $newpos;
$output .= " =?UTF-8?B?".base64_encode($chunk)."?=\n"; } return trim($output);
|
}
|
}
|
return $encoded_string; }
| return $string; }
|
} ?>
| } ?>
|