Moved config files to config/*inc.php.dist

release-0.6
thomascube 19 years ago
parent 539cd47824
commit 15fee7b8dd

@ -3,10 +3,10 @@
/* /*
+-----------------------------------------------------------------------+ +-----------------------------------------------------------------------+
| RoundCube Webmail IMAP Client | | RoundCube Webmail IMAP Client |
| Version 0.1-20050811 | | Version 0.1-20050929 |
| | | |
| Copyright (C) 2005, RoundCube Dev. - Switzerland | | Copyright (C) 2005, RoundCube Dev. - Switzerland |
| All rights reserved. | | Licensed under the GNU GPL |
| | | |
| Redistribution and use in source and binary forms, with or without | | Redistribution and use in source and binary forms, with or without |
| modification, are permitted provided that the following conditions | | modification, are permitted provided that the following conditions |

@ -3,7 +3,7 @@
// +-----------------------------------------------------------------------+ // +-----------------------------------------------------------------------+
// | Copyright (c) 2002-2003 Richard Heyes | // | Copyright (c) 2002-2003 Richard Heyes |
// | Copyright (c) 2003-2005 The PHP Group | // | Copyright (c) 2003-2005 The PHP Group |
// | Licensed under the GNU GPL | // | All rights reserved. |
// | | // | |
// | Redistribution and use in source and binary forms, with or without | // | Redistribution and use in source and binary forms, with or without |
// | modification, are permitted provided that the following conditions | // | modification, are permitted provided that the following conditions |
@ -51,8 +51,8 @@ require_once('Mail/mimePart.php');
* in the mime_mail.class by Tobias Ratschiller <tobias@dnet.it> and * in the mime_mail.class by Tobias Ratschiller <tobias@dnet.it> and
* Sascha Schumann <sascha@schumann.cx> * Sascha Schumann <sascha@schumann.cx>
* *
* Function _encodeHeaders() changed by Thomas Bruederli <roundcube@gmail.com> * @notes Replaced method _encodeHeaders by the version of ed@avi.ru
* in order to be read correctly by Google Gmail * See http://pear.php.net/bugs/bug.php?id=30 for details
* *
* @author Richard Heyes <richard.heyes@heyes-computing.net> * @author Richard Heyes <richard.heyes@heyes-computing.net>
* @author Tomas V.V.Cox <cox@idecnet.com> * @author Tomas V.V.Cox <cox@idecnet.com>
@ -119,6 +119,7 @@ class Mail_mime
$this->_build_params = array( $this->_build_params = array(
'text_encoding' => '7bit', 'text_encoding' => '7bit',
'html_encoding' => 'quoted-printable', 'html_encoding' => 'quoted-printable',
'header_encoding' => 'quoted-printable',
'7bit_wrap' => 998, '7bit_wrap' => 998,
'html_charset' => 'ISO-8859-1', 'html_charset' => 'ISO-8859-1',
'text_charset' => 'ISO-8859-1', 'text_charset' => 'ISO-8859-1',
@ -292,7 +293,12 @@ class Mail_mime
if (!$fd = fopen($file_name, 'rb')) { if (!$fd = fopen($file_name, 'rb')) {
return PEAR::raiseError('Could not open ' . $file_name); return PEAR::raiseError('Could not open ' . $file_name);
} }
$cont = fread($fd, filesize($file_name)); $filesize = filesize($file_name);
if ($filesize == 0){
$cont = "";
}else{
$cont = fread($fd, $filesize);
}
fclose($fd); fclose($fd);
return $cont; return $cont;
} }
@ -463,9 +469,9 @@ class Mail_mime
if (!empty($this->_html_images) AND isset($this->_htmlbody)) { if (!empty($this->_html_images) AND isset($this->_htmlbody)) {
foreach ($this->_html_images as $value) { foreach ($this->_html_images as $value) {
$regex = '#src\s*=\s*(["\']?)' . preg_quote($value['name']) . $regex = '#(\s)((?i)src|background|href(?-i))\s*=\s*(["\']?)' . preg_quote($value['name'], '#') .
'(["\'])?#'; '\3#';
$rep = 'src=\1cid:' . $value['cid'] .'\2'; $rep = '\1\2=\3cid:' . $value['cid'] .'\3';
$this->_htmlbody = preg_replace($regex, $rep, $this->_htmlbody = preg_replace($regex, $rep,
$this->_htmlbody $this->_htmlbody
); );
@ -673,45 +679,34 @@ class Mail_mime
*/ */
function _encodeHeaders($input) function _encodeHeaders($input)
{ {
$enc_prefix = '=?' . $this->_build_params['head_charset'] . '?Q?';
foreach ($input as $hdr_name => $hdr_value) { foreach ($input as $hdr_name => $hdr_value) {
if (preg_match('/(\w*[\x80-\xFF]+\w*)/', $hdr_value)) { preg_match_all('/([\w\-]*[\x80-\xFF]+[\w\-]*(\s+[\w\-]*[\x80-\xFF]+[\w\-]*)*)\s*/',
$enc_value = preg_replace('/([\x80-\xFF])/e', '"=".strtoupper(dechex(ord("\1")))', $hdr_value); $hdr_value, $matches);
// check for <email address> in string foreach ($matches[1] as $value) {
if (preg_match('/<[a-z0-9\-\.\+\_]+@[a-z0-9]([a-z0-9\-].?)*[a-z0-9]\\.[a-z]{2,5}>/i', $enc_value) && ($p = strrpos($enc_value, '<'))) { switch ($head_encoding = $this->_build_params['head_encoding']) {
$hdr_value = $enc_prefix . substr($enc_value, 0, $p-1) . '?= ' . substr($enc_value, $p, strlen($enc_value)-$p); case 'base64':
} else { $symbol = 'B';
$hdr_value = $enc_prefix . $enc_value . '?='; $replacement = base64_encode($value);
} break;
}
$input[$hdr_name] = $hdr_value;
}
return $input; default:
if ($head_encoding != 'quoted-printable') {
PEAR::raiseError('Invalid header encoding specified; using `quoted-printable` instead',
NULL,
PEAR_ERROR_TRIGGER,
E_USER_WARNING);
} }
/* replaced 2005/07/08 by roundcube@gmail.com $symbol = 'Q';
$replacement = preg_replace('/([\s_=\?\x80-\xFF])/e', '"=" . strtoupper(dechex(ord("\1")))', $value);
function _encodeHeaders_old($input) }
{ $hdr_value = str_replace($value, '=?' . $this->_build_params['head_charset'] . '?' . $symbol . '?' . $replacement . '?=', $hdr_value);
foreach ($input as $hdr_name => $hdr_value) {
preg_match_all('/(\w*[\x80-\xFF]+\w*)/', $hdr_value, $matches);
foreach ($matches[1] as $value) {
$replacement = preg_replace('/([\x80-\xFF])/e',
'"=" .
strtoupper(dechex(ord("\1")))',
$value);
$hdr_value = str_replace($value, '=?' .
$this->_build_params['head_charset'] .
'?Q?' . $replacement . '?=',
$hdr_value);
} }
$input[$hdr_name] = $hdr_value; $input[$hdr_name] = $hdr_value;
} }
return $input; return $input;
} }
*/
/** /**
* Set the object's end-of-line and define the constant if applicable * Set the object's end-of-line and define the constant if applicable

@ -3,7 +3,7 @@
// +-----------------------------------------------------------------------+ // +-----------------------------------------------------------------------+
// | Copyright (c) 2002-2003 Richard Heyes | // | Copyright (c) 2002-2003 Richard Heyes |
// | Copyright (c) 2003-2005 The PHP Group | // | Copyright (c) 2003-2005 The PHP Group |
// | Licensed under the GNU GPL | // | All rights reserved. |
// | | // | |
// | Redistribution and use in source and binary forms, with or without | // | Redistribution and use in source and binary forms, with or without |
// | modification, are permitted provided that the following conditions | // | modification, are permitted provided that the following conditions |
@ -296,6 +296,7 @@ class Mail_mimeDecode extends PEAR
} }
$default_ctype = (strtolower($content_type['value']) === 'multipart/digest') ? 'message/rfc822' : 'text/plain'; $default_ctype = (strtolower($content_type['value']) === 'multipart/digest') ? 'message/rfc822' : 'text/plain';
$parts = $this->_boundarySplit($body, $content_type['other']['boundary']); $parts = $this->_boundarySplit($body, $content_type['other']['boundary']);
for ($i = 0; $i < count($parts); $i++) { for ($i = 0; $i < count($parts); $i++) {
list($part_header, $part_body) = $this->_splitBodyHeader($parts[$i]); list($part_header, $part_body) = $this->_splitBodyHeader($parts[$i]);
@ -498,14 +499,8 @@ class Mail_mimeDecode extends PEAR
} }
$tmp = explode('--' . $boundary, $input); $tmp = explode('--' . $boundary, $input);
$count = count($tmp);
// when boundaries are set correctly we should have at least 3 parts;
// if not, return the last one (tbr)
if ($count<3)
return array($tmp[$count-1]);
for ($i = 1; $i < $count - 1; $i++) { for ($i = 1; $i < count($tmp) - 1; $i++) {
$parts[] = $tmp[$i]; $parts[] = $tmp[$i];
} }

@ -1,7 +1,7 @@
<?php <?php
// +-----------------------------------------------------------------------+ // +-----------------------------------------------------------------------+
// | Copyright (c) 2002-2003 Richard Heyes | // | Copyright (c) 2002-2003 Richard Heyes |
// | Licensed under the GNU GPL | // | All rights reserved. |
// | | // | |
// | Redistribution and use in source and binary forms, with or without | // | Redistribution and use in source and binary forms, with or without |
// | modification, are permitted provided that the following conditions | // | modification, are permitted provided that the following conditions |

Loading…
Cancel
Save