Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@swissspidy
Copy link
Member

Ensure Runner::find_wp_root() always returns a directory

According to the docblock, the method is supposed to default to the current working dir, but in reality it could return null if nothing was found.

This breaks other methods like ::set_wp_root() which expect a string.

Prevents PHP deprecation notices because null was passed to realpath().

Handle null values in trailingslashit util

Prevents PHP deprecation notices when inadvertently passing null to the function and thus rtrim.

According to the docblock, the method is supposed to default to the current working dir, but in reality it could return `null` if nothing was found.

This breaks other methods like `::set_wp_root()` which expect a string.

Prevents PHP deprecation notices because `null` was passed to `realpath()`.
Prevents PHP deprecation notices when inadvertently passing `null` to the function and thus `rtrim`.
@swissspidy swissspidy requested a review from a team as a code owner July 18, 2022 13:01
@danielbachhuber danielbachhuber added this to the 2.7.0 milestone Jul 28, 2022
@danielbachhuber danielbachhuber merged commit f3e4b07 into master Jul 28, 2022
@danielbachhuber danielbachhuber deleted the fix/5623-deprecation-notices branch July 28, 2022 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants