diff options
| author | Meik Sievertsen <acydburn@phpbb.com> | 2007-01-04 16:07:38 +0000 |
|---|---|---|
| committer | Meik Sievertsen <acydburn@phpbb.com> | 2007-01-04 16:07:38 +0000 |
| commit | 3a8c3971da12623aeb86c67c34fe0b962d672ad9 (patch) | |
| tree | f1110b30cc9bbe41b2b7126b172d38b7e7394cf4 /phpBB/includes/functions_messenger.php | |
| parent | fbef3990e74034f5cf205867a2b37e0e13a98997 (diff) | |
| download | forums-3a8c3971da12623aeb86c67c34fe0b962d672ad9.tar forums-3a8c3971da12623aeb86c67c34fe0b962d672ad9.tar.gz forums-3a8c3971da12623aeb86c67c34fe0b962d672ad9.tar.bz2 forums-3a8c3971da12623aeb86c67c34fe0b962d672ad9.tar.xz forums-3a8c3971da12623aeb86c67c34fe0b962d672ad9.zip | |
- use var_export instead of our format_array function [Bug #6748]
- fix dumb error in column naming [Bug #6750]
- Make sure to catch some special conditions for cpf translation as well as correctly removing/adding default values on language installation/removing [Bug #6752]
git-svn-id: file:///svn/phpbb/trunk@6839 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions_messenger.php')
| -rw-r--r-- | phpBB/includes/functions_messenger.php | 54 |
1 files changed, 15 insertions, 39 deletions
diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index 190975a96b..b802d13a0d 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -401,7 +401,9 @@ class messenger } else { - $result = @$config['email_function_name']($mail_to, mail_encode($this->subject), implode("\n", preg_split("/\r?\n/", wordwrap($this->msg))), $headers); + ob_start(); + $result = $config['email_function_name']($mail_to, mail_encode($this->subject), implode("\n", preg_split("/\r?\n/", wordwrap($this->msg))), $headers); + $err_msg = ob_get_clean(); } if (!$result) @@ -623,7 +625,16 @@ class queue $err_msg = ''; $to = (!$to) ? 'Undisclosed-Recipient:;' : $to; - $result = ($config['smtp_delivery']) ? smtpmail($addresses, mail_encode($subject), wordwrap($msg), $err_msg, $headers) : @$config['email_function_name']($to, mail_encode($subject), implode("\n", preg_split("/\r?\n/", wordwrap($msg))), $headers); + if ($config['smtp_delivery']) + { + $result = smtpmail($addresses, mail_encode($subject), wordwrap($msg), $err_msg, $headers); + } + else + { + ob_start(); + $result = $config['email_function_name']($to, mail_encode($subject), implode("\n", preg_split("/\r?\n/", wordwrap($msg))), $headers); + $err_msg = ob_get_clean(); + } if (!$result) { @@ -671,12 +682,10 @@ class queue } else { - $file = '<?php $this->queue_data=' . $this->format_array($this->queue_data) . '; ?>'; - if ($fp = @fopen($this->cache_file, 'w')) { @flock($fp, LOCK_EX); - fwrite($fp, $file); + fwrite($fp, "<?php\n\$this->queue_data = " . var_export($this->queue_data) . ";\n?>"); @flock($fp, LOCK_UN); fclose($fp); } @@ -711,48 +720,15 @@ class queue } } } - - $file = '<?php $this->queue_data = ' . $this->format_array($this->data) . '; ?>'; if ($fp = @fopen($this->cache_file, 'w')) { @flock($fp, LOCK_EX); - fwrite($fp, $file); + fwrite($fp, "<?php\n\$this->queue_data = " . var_export($this->data) . ";\n?>"); @flock($fp, LOCK_UN); fclose($fp); } } - - /** - * Format array - * @access private - */ - function format_array($array) - { - $lines = array(); - foreach ($array as $k => $v) - { - if (is_array($v)) - { - $lines[] = "'$k'=>" . $this->format_array($v); - } - else if (is_int($v)) - { - $lines[] = "'$k'=>$v"; - } - else if (is_bool($v)) - { - $lines[] = "'$k'=>" . (($v) ? 'true' : 'false'); - } - else - { - $lines[] = "'$k'=>'" . str_replace("'", "\'", str_replace('\\', '\\\\', $v)) . "'"; - } - } - - return 'array(' . implode(',', $lines) . ')'; - } - } /** |
