fix while loop
This commit is contained in:
parent
fd2b830a9f
commit
4ffff150b5
|
@ -69,13 +69,17 @@ class WC_Product_CSV_Importer extends WC_Product_Importer {
|
|||
fseek( $handle, (int) $this->params['start_pos'] );
|
||||
}
|
||||
|
||||
$row = fgetcsv( $handle, 0, $this->params['delimiter'], $this->params['enclosure'] );
|
||||
while ( 1 ) {
|
||||
$row = fgetcsv( $handle, 0, $this->params['delimiter'], $this->params['enclosure'] );
|
||||
|
||||
while ( false !== $row ) {
|
||||
$this->raw_data[] = $row;
|
||||
$this->file_positions[ count( $this->raw_data ) ] = ftell( $handle );
|
||||
if ( false !== $row ) {
|
||||
$this->raw_data[] = $row;
|
||||
$this->file_positions[ count( $this->raw_data ) ] = ftell( $handle );
|
||||
|
||||
if ( ( $this->params['end_pos'] > 0 && ftell( $handle ) >= $this->params['end_pos'] ) || 0 === --$this->params['lines'] ) {
|
||||
if ( ( $this->params['end_pos'] > 0 && ftell( $handle ) >= $this->params['end_pos'] ) || 0 === --$this->params['lines'] ) {
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue