comparison program/lib/Roundcube/rcube_imap_generic.php @ 12:5039cc34571f

some old, mostly new 7.3->8.4 changes needed
author Charlie Root
date Thu, 28 Aug 2025 10:37:42 -0400
parents aff04b06b685
children abddb304201f
comparison
equal deleted inserted replaced
11:aff04b06b685 12:5039cc34571f
392 /** 392 /**
393 * Closes connection stream. 393 * Closes connection stream.
394 */ 394 */
395 protected function closeSocket() 395 protected function closeSocket()
396 { 396 {
397 @fclose($this->fp); 397 if ($this->fp) {
398 $this->fp = null; 398 fclose($this->fp);
399 $this->fp = null;
400 }
399 } 401 }
400 402
401 /** 403 /**
402 * Error code/message setter. 404 * Error code/message setter.
403 */ 405 */
3897 3899
3898 sort($messages); 3900 sort($messages);
3899 3901
3900 $result = array(); 3902 $result = array();
3901 $start = $prev = $messages[0]; 3903 $start = $prev = $messages[0];
3902 $needStrip = (strpos($start,'_') !== false); 3904 $needStrip = (! is_numeric($start)) || (! is_numeric($prev));
3903 3905
3904 foreach ($messages as $id) { 3906 foreach ($messages as $id) {
3905 #rcube::write_log('mail',"non-num? id: |$id|, prev: |$prev|");
3906 #Advanced search calls with pseudo-message-ids? Non-numeric, anyway, e.g. 3907 #Advanced search calls with pseudo-message-ids? Non-numeric, anyway, e.g.
3907 # 420__MB__97ce7451bd364b47894f71ba7eb8ceb1 3908 # 420__MB__97ce7451bd364b47894f71ba7eb8ceb1
3908 if ($needStrip) { 3909 if ($needStrip) {
3910 set_error_handler(function($e1, $e2) {
3911 #rcube::write_log('mail',
3912 "non-num? id: |$id|, prev: |$prev|");
3913 },
3914 E_WARNING);
3909 $incr = substr($id,0,strpos($id,'_')) - substr($prev,0,strpos($prev,'_')); 3915 $incr = substr($id,0,strpos($id,'_')) - substr($prev,0,strpos($prev,'_'));
3916 restore_error_handler();
3910 } 3917 }
3911 else { 3918 else {
3912 $incr = $id - $prev; 3919 $incr = $id - $prev;
3913 } 3920 }
3914 if ($incr > 1) { // found a gap 3921 if ($incr > 1) { // found a gap