comparison program/lib/Roundcube/rcube_result_thread.php @ 14:abddb304201f

continue slowly cleaning up after move to 8.3
author Charlie Root
date Sat, 06 Sep 2025 08:16:01 -0400
parents 5039cc34571f
children b6a96bdd6b29
comparison
equal deleted inserted replaced
13:cfac0673464e 14:abddb304201f
205 $start = 0; 205 $start = 0;
206 206
207 $this->meta = array(); 207 $this->meta = array();
208 $this->meta['count'] = 0; 208 $this->meta['count'] = 0;
209 209
210 while (($pos = @strpos($this->raw_data, self::SEPARATOR_ELEMENT, $start)) 210 while ($start < $datalen &&
211 || ($start < $datalen && ($pos = $datalen)) 211 (($pos = @strpos($this->raw_data, self::SEPARATOR_ELEMENT,
212 $start)) != false|| ($pos = $datalen))
212 ) { 213 ) {
213 $len = $pos - $start; 214 $len = $pos - $start;
214 $elem = substr($this->raw_data, $start, $len); 215 $elem = substr($this->raw_data, $start, $len);
215 $start = $pos + 1; 216 $start = $pos + 1;
216 217
437 438
438 // Here we're parsing raw_data twice, we want only one big array 439 // Here we're parsing raw_data twice, we want only one big array
439 // in memory at a time 440 // in memory at a time
440 441
441 // Assign roots 442 // Assign roots
442 while (($pos = @strpos($this->raw_data, self::SEPARATOR_ELEMENT, $start)) 443 while ($start < $datalen &&
443 || ($start < $datalen && ($pos = $datalen)) 444 (($pos = @strpos($this->raw_data, self::SEPARATOR_ELEMENT,
445 $start)) != false || ($pos = $datalen))
444 ) { 446 ) {
445 $len = $pos - $start; 447 $len = $pos - $start;
446 $elem = substr($this->raw_data, $start, $len); 448 $elem = substr($this->raw_data, $start, $len);
447 $start = $pos + 1; 449 $start = $pos + 1;
448 450
464 466
465 // Re-sort raw data 467 // Re-sort raw data
466 $result = array_fill_keys($result, null); 468 $result = array_fill_keys($result, null);
467 $start = 0; 469 $start = 0;
468 470
469 while (($pos = @strpos($this->raw_data, self::SEPARATOR_ELEMENT, $start)) 471 while ($start < $datalen &&
470 || ($start < $datalen && ($pos = $datalen)) 472 (($pos = @strpos($this->raw_data, self::SEPARATOR_ELEMENT,
473 $start)) != false || ($pos = $datalen))
471 ) { 474 ) {
472 $len = $pos - $start; 475 $len = $pos - $start;
473 $elem = substr($this->raw_data, $start, $len); 476 $elem = substr($this->raw_data, $start, $len);
474 $start = $pos + 1; 477 $start = $pos + 1;
475 478