Set $_SERVER['SERVER_SOFTWARE'] to an empty string rather than NULL #231
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When using cv in WordPress, we receive deprecation warnings along the lines of
This is because we have set
$_SERVER['SERVER_SOFTWARE']
toNULL
and WordPress expects it to be a string.Given what the PHP manual say about the $_SERVER value here: https://www.php.net/manual/en/reserved.variables.server.php, I think this is a reasonable assumption.
I'm not sure why we are setting it to NULL specifically but I am guessing it is because some code expects it to be set and that NULL seemed like a reasonable value to set it to. And Drupal does something similar here https://github.com/drupal/drupal/blob/7.x/includes/bootstrap.inc#L643-L651 so maybe that was the inspiration?
This PR is based on the assumption that setting it to an empty string is more 'correct' and that any downstream code is not relying on it being NULL (which I think is a reasonable assumption.
It supercedes #210