Skip to content

Commit 27192d9

Browse files
committed
Fix: Remove trailing \n before passing it to the filter
1 parent 89448ca commit 27192d9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

wp-http-blocklist.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,14 @@ function pre_http_request( $flag, $parsed_args, $url ) {
4545
$blocklist = file( $blocklist_file );
4646
}
4747

48-
$blocklist = apply_filters( 'wp_http_blocklist', $blocklist );
48+
/**
49+
* Here we get the file values and they have a \n at the end.
50+
* Remove all useless caracters.
51+
*/
4952
$blocklist = array_map( 'trim', $blocklist );
5053
$blocklist = array_filter( $blocklist );
54+
55+
$blocklist = apply_filters( 'wp_http_blocklist', $blocklist );
5156
$blocklist = array_unique( $blocklist );
5257

5358
if ( empty( $blocklist ) ) {

0 commit comments

Comments
 (0)