$data = array();
$total_size = 0;
while (strpos($read, "\n") === false) {
- $read .= fgets($imap_stream, 9096);
+ if(!($read .= fgets($imap_stream, 9096))) {
+ break;
+ }
}
if (ereg("^\\* [0-9]+ FETCH.*\\{([0-9]+)\\}", $read, $regs)) {
}
while (1) {
while (strpos($read, "\n") === false) {
- $read .= fgets($imap_stream, 9096);
+ if(!($read .= fgets($imap_stream, 9096))) {
+ break;
+ }
}
// If we know the size, no need to look at the end parameters
if ($size > 0) {
*/
function sqimap_find_displayable_name ($string) {
$string = trim($string);
-
+
if ( ereg('^(.+)<.*>', $string, $regs) ) {
$orig_string = $string;
- $string = ereg_replace ('"', '', $regs[1] );
+ $string = str_replace ('"', '', $regs[1] );
if (trim($string) == '') {
$string = sqimap_find_email($orig_string);
}
}
}
else {
- $string = sqimap_find_email($string);
+ $string = str_replace ('"', '', sqimap_find_email($string));
}
return trim($string);