Skip to content

Commit

Permalink
Filesystem: Trim all space characters to check for empty lines.
Browse files Browse the repository at this point in the history
  • Loading branch information
costdev committed Jan 8, 2025
1 parent 746f364 commit 7870801
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion includes/class-filesystem-direct.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function get_contents_array( $file, $number_of_lines = -1, $count_bottom_
* This is a valid and intentional use.
*/
while ( ( $line = fgets( $handle ) ) !== false ) {
$lines[] = rtrim( $line, "\r\n" );
$lines[] = trim( $line );
++$line_count;

if ( $count_bottom_to_top ) {
Expand Down

0 comments on commit 7870801

Please sign in to comment.