Skip to content

Commit e583f40

Browse files
authored
Merge pull request #5998 from amirhmoradi/patch-1
2 parents c62f232 + b14a0d3 commit e583f40

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

php/wp-cli.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
// Set common headers, to prevent warnings from plugins.
2121
$_SERVER['SERVER_PROTOCOL'] = 'HTTP/1.0';
22-
$_SERVER['HTTP_USER_AGENT'] = '';
22+
$_SERVER['HTTP_USER_AGENT'] = ( ! empty( getenv( 'WP_CLI_USER_AGENT' ) ) ? getenv( 'WP_CLI_USER_AGENT' ) : 'WP CLI ' . WP_CLI_VERSION );
2323
$_SERVER['REQUEST_METHOD'] = 'GET';
2424
$_SERVER['REMOTE_ADDR'] = '127.0.0.1';
2525

0 commit comments

Comments
 (0)