X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Fimap_general.php;h=131278e12da048249983740fff400a3d33130518;hb=6872a6750379b6c17cf6a6dfec6150ade78f52a0;hp=57d9c2d651cf4592dc8cde02b1f0727aab002380;hpb=3c021d16d007570391822b6cb060d60826af1bf5;p=squirrelmail.git
diff --git a/functions/imap_general.php b/functions/imap_general.php
index 57d9c2d6..131278e1 100755
--- a/functions/imap_general.php
+++ b/functions/imap_general.php
@@ -5,7 +5,7 @@
*
* This implements all functions that do general IMAP functions.
*
- * @copyright © 1999-2006 The SquirrelMail Project Team
+ * @copyright 1999-2018 The SquirrelMail Project Team
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
* @version $Id$
* @package squirrelmail
@@ -13,9 +13,8 @@
*/
/** Includes.. */
-require_once(SM_PATH . 'functions/page_header.php');
-require_once(SM_PATH . 'functions/auth.php');
-include_once(SM_PATH . 'functions/rfc822address.php');
+
+require_once(SM_PATH . 'functions/rfc822address.php');
/**
@@ -61,14 +60,16 @@ function sqimap_run_command_list ($imap_stream, $query, $handle_errors, &$respon
$message = $message[$tag];
$response = $response[$tag];
return $read[$tag];
+//FIXME: obey $handle_errors below!
} else {
global $squirrelmail_language, $color;
set_up_language($squirrelmail_language);
- require_once(SM_PATH . 'functions/display_messages.php');
+//FIXME: NO HTML IN CORE!
$string = "\n" .
_("ERROR: No available IMAP stream.") .
+//FIXME: NO HTML IN CORE!
"\n";
- error_box($string,$color);
+ error_box($string);
return false;
}
}
@@ -108,18 +109,35 @@ function sqimap_run_command ($imap_stream, $query, $handle_errors, &$response,
$message = $message[$tag];
if (!empty($read[$tag])) {
+ /* sqimap_read_data should be called for one response
+ but since it just calls sqimap_retrieve_imap_response
+ which handles multiple responses we need to check for
+ that and merge the $read[$tag] array IF they are
+ separated and IF it was a FETCH response. */
+
+ if (isset($read[$tag][1]) && is_array($read[$tag][1]) && isset($read[$tag][1][0])
+ && preg_match('/^\* \d+ FETCH/', $read[$tag][1][0])) {
+ $result = array();
+ foreach($read[$tag] as $index => $value) {
+ $result = array_merge($result, $read[$tag]["$index"]);
+ }
+ return $result;
+ }
+
return $read[$tag][0];
} else {
return $read[$tag];
}
+//FIXME: obey $handle_errors below!
} else {
global $squirrelmail_language, $color;
set_up_language($squirrelmail_language);
- require_once(SM_PATH . 'functions/display_messages.php');
+//FIXME: NO HTML IN CORE!
$string = "\n" .
_("ERROR: No available IMAP stream.") .
+//FIXME: NO HTML IN CORE!
"\n";
- error_box($string,$color);
+ error_box($string);
return false;
}
}
@@ -317,11 +335,12 @@ function sqimap_fread($imap_stream,$iSize,$filter=false,
*/
function sqimap_read_data_list($imap_stream, $tag, $handle_errors,
&$response, &$message, $query = '') {
- global $color, $squirrelmail_language;
+ global $color, $oTemplate, $squirrelmail_language;
set_up_language($squirrelmail_language);
- require_once(SM_PATH . 'functions/display_messages.php');
+//FIXME: NO HTML IN CORE!
$string = "\n" .
_("ERROR: Bad function call.") .
+//FIXME: NO HTML IN CORE!
"
\n" .
_("Reason:") . ' '.
'There is a plugin installed which make use of the
' .
@@ -329,9 +348,10 @@ function sqimap_read_data_list($imap_stream, $tag, $handle_errors,
'Please adapt the installed plugin and let it use
'.
'sqimap_run_command or sqimap_run_command_list instead
'.
'The following query was issued:
'.
- htmlspecialchars($query) . '
' . "
\n";
- error_box($string,$color);
- echo '