projects
/
squirrelmail.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
in sqgetGlobalVar, reset $value if it is not found.
[squirrelmail.git]
/
functions
/
imap_general.php
diff --git
a/functions/imap_general.php
b/functions/imap_general.php
index a43bc242f99a24972f621fd7dfe3078cc8fb673d..c3ef35da2b40d0c6b061e98b12d27d519dcc981e 100755
(executable)
--- a/
functions/imap_general.php
+++ b/
functions/imap_general.php
@@
-3,7
+3,7
@@
/**
* imap_general.php
*
/**
* imap_general.php
*
- * Copyright (c) 1999-200
4
The SquirrelMail Project Team
+ * Copyright (c) 1999-200
5
The SquirrelMail Project Team
* Licensed under the GNU GPL. For full terms see the file COPYING.
*
* This implements all functions that do general imap functions.
* Licensed under the GNU GPL. For full terms see the file COPYING.
*
* This implements all functions that do general imap functions.
@@
-72,7
+72,7
@@
function sqimap_run_command ($imap_stream, $query, $handle_errors, &$response,
$read = sqimap_read_data ($imap_stream, $tag, $handle_errors, $response,
$message, $query,$filter,$outputstream,$no_return);
$read = sqimap_read_data ($imap_stream, $tag, $handle_errors, $response,
$message, $query,$filter,$outputstream,$no_return);
- if (empty($read)) { //Imap server dropped its connection
+ if (empty($read)) { //Imap server dropped its connection
$response = '';
$message = '';
return false;
$response = '';
$message = '';
return false;
@@
-219,20
+219,20
@@
function sqimap_fread($imap_stream,$iSize,$filter=false,
if ($iRemaining < $iBufferSize) {
$iBufferSize = $iRemaining;
}
if ($iRemaining < $iBufferSize) {
$iBufferSize = $iRemaining;
}
- if (
!$sRead
) {
+ if (
$sRead == ''
) {
$results = false;
break;
}
$results = false;
break;
}
- if ($sReadRem) {
+ if ($sReadRem
!= ''
) {
$sRead = $sReadRem . $sRead;
$sReadRem = '';
}
$sRead = $sReadRem . $sRead;
$sReadRem = '';
}
- if ($filter && $sRead) {
+ if ($filter && $sRead
!= ''
) {
// in case the filter is base64 decoding we return a remainder
$sReadRem = $filter($sRead);
}
// in case the filter is base64 decoding we return a remainder
$sReadRem = $filter($sRead);
}
- if ($outputstream && $sRead) {
+ if ($outputstream && $sRead
!= ''
) {
if (is_resource($outputstream)) {
fwrite($outputstream,$sRead);
} else if ($outputstream == 'php://stdout') {
if (is_resource($outputstream)) {
fwrite($outputstream,$sRead);
} else if ($outputstream == 'php://stdout') {
@@
-320,7
+320,7
@@
function sqimap_retrieve_imap_response($imap_stream, $tag, $handle_errors,
$resultlist = array();
$data = array();
$read = sqimap_fgets($imap_stream);
$resultlist = array();
$data = array();
$read = sqimap_fgets($imap_stream);
- $i =
$k =
0;
+ $i = 0;
while ($read) {
$char = $read{0};
switch ($char)
while ($read) {
$char = $read{0};
switch ($char)
@@
-375,7
+375,7
@@
function sqimap_retrieve_imap_response($imap_stream, $tag, $handle_errors,
}
$read = sqimap_fgets($imap_stream);
if ($read === false) { /* error */
}
$read = sqimap_fgets($imap_stream);
if ($read === false) { /* error */
- break
3; /* switch
switch while */
+ break
2; /*
switch while */
}
break;
} // end case $tag{0}
}
break;
} // end case $tag{0}
@@
-548,7
+548,7
@@
function sqimap_read_data ($imap_stream, $tag_uid, $handle_errors,
* @return imap-stream resource identifier
*/
function sqimap_create_stream($server,$port,$tls=false) {
* @return imap-stream resource identifier
*/
function sqimap_create_stream($server,$port,$tls=false) {
- global $
username, $use_imap_tls, $
squirrelmail_language;
+ global $squirrelmail_language;
if ($tls == true) {
if ((check_php_version(4,3)) and (extension_loaded('openssl'))) {
if ($tls == true) {
if ((check_php_version(4,3)) and (extension_loaded('openssl'))) {
@@
-816,7
+816,7
@@
function sqimap_get_delimiter ($imap_stream = false) {
} else {
fputs ($imap_stream, ". LIST \"INBOX\" \"\"\r\n");
$read = sqimap_read_data($imap_stream, '.', true, $a, $b);
} else {
fputs ($imap_stream, ". LIST \"INBOX\" \"\"\r\n");
$read = sqimap_read_data($imap_stream, '.', true, $a, $b);
- $read = $read['.'][0];
//sqimap_read_data() now returns a tag array of response array
+ $read = $read['.'][0]; //sqimap_read_data() now returns a tag array of response array
$quote_position = strpos ($read[0], '"');
$sqimap_delimiter = substr ($read[0], $quote_position+1, 1);
}
$quote_position = strpos ($read[0], '"');
$sqimap_delimiter = substr ($read[0], $quote_position+1, 1);
}
@@
-831,9
+831,9
@@
function sqimap_get_delimiter ($imap_stream = false) {
*/
function sqimap_encode_mailbox_name($what)
{
*/
function sqimap_encode_mailbox_name($what)
{
-
if (ereg("[\"\\\r\n]", $what))
-
return '{' . strlen($what) . "}\r\n" . $what;
/* 4.3 literal form */
-
return '"' . $what . '"';
/* 4.3 quoted string form */
+ if (ereg("[\"\\\r\n]", $what))
+
return '{' . strlen($what) . "}\r\n" . $what;
/* 4.3 literal form */
+
return '"' . $what . '"';
/* 4.3 quoted string form */
}
/**
}
/**