Small code improvements

pull/5178/head
Aleksander Machniak 9 years ago
parent f0e88f02d5
commit 7462095f60

@ -107,7 +107,11 @@ class rcube_imap_generic
$this->debug('C: ' . $log); $this->debug('C: ' . $log);
} }
$res = fwrite($this->fp, $string . ($endln ? "\r\n" : '')); if ($endln) {
$string .= "\r\n";
}
$res = fwrite($this->fp, $string);
if ($res === false) { if ($res === false) {
@fclose($this->fp); @fclose($this->fp);
@ -174,6 +178,7 @@ class rcube_imap_generic
} }
} }
} }
return $res; return $res;
} }
@ -3465,6 +3470,7 @@ class rcube_imap_generic
if (!is_array($entries)) { if (!is_array($entries)) {
$entries = array($entries); $entries = array($entries);
} }
// create entries string // create entries string
// ANNOTATEMORE drafts before version 08 require quoted parameters // ANNOTATEMORE drafts before version 08 require quoted parameters
foreach ($entries as $idx => $name) { foreach ($entries as $idx => $name) {
@ -3475,7 +3481,8 @@ class rcube_imap_generic
if (!is_array($attribs)) { if (!is_array($attribs)) {
$attribs = array($attribs); $attribs = array($attribs);
} }
// create entries string
// create attributes string
foreach ($attribs as $idx => $name) { foreach ($attribs as $idx => $name) {
$attribs[$idx] = $this->escape($name, true); $attribs[$idx] = $this->escape($name, true);
} }

Loading…
Cancel
Save