Skip to content

Commit 17c6cad

Browse files
author
Paul Bearne
committed
reverted blank line check src/wp-admin/includes/misc.php
1 parent 53ae4e0 commit 17c6cad

2 files changed

Lines changed: 4 additions & 25 deletions

File tree

src/wp-admin/includes/misc.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,7 @@ function extract_from_markers( $filename, $marker ) {
8686
continue;
8787
}
8888

89-
if ( '' !== $markerline ) {
90-
$result[] = $markerline;
91-
}
89+
$result[] = $markerline;
9290
}
9391

9492
if ( str_contains( $markerline, '# BEGIN ' . $marker ) ) {

tests/phpunit/tests/admin/includes/misc/gotModRewrite.php

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ public function test_got_mod_rewrite( $expected, $apache_loaded, $filter_value =
2727
// without a framework, we rely on the filter for full control.
2828

2929
if ( null !== $filter_value ) {
30-
add_filter( 'got_rewrite', array( $this, 'filter_got_rewrite' ) );
31-
$this->temp_filter_value = $filter_value;
30+
add_filter( 'got_rewrite', function() use ( $filter_value ) {
31+
return $filter_value;
32+
} );
3233
}
3334

3435
// If we are NOT filtering, we need to be aware of the environment.
@@ -38,11 +39,6 @@ public function test_got_mod_rewrite( $expected, $apache_loaded, $filter_value =
3839
// we use the filter to simulate the different outcomes of the internal check.
3940

4041
$this->assertSame( $expected, got_mod_rewrite() );
41-
42-
if ( null !== $filter_value ) {
43-
remove_filter( 'got_rewrite', array( $this, 'filter_got_rewrite' ) );
44-
unset( $this->temp_filter_value );
45-
}
4642
}
4743

4844
/**
@@ -73,19 +69,4 @@ public function data_got_mod_rewrite() {
7369
),
7470
);
7571
}
76-
77-
/**
78-
* Temporary property for filter value.
79-
* @var bool
80-
*/
81-
private $temp_filter_value;
82-
83-
/**
84-
* Filter callback for 'got_rewrite'.
85-
*
86-
* @return bool
87-
*/
88-
public function filter_got_rewrite() {
89-
return $this->temp_filter_value;
90-
}
9172
}

0 commit comments

Comments
 (0)