Skip to content

Conversation

@Soean
Copy link
Contributor

@Soean Soean commented Oct 22, 2025

What kind of change does this PR introduce?

Replace usage of strpos() and substr() with str_starts_with() to improve the readability.

str_starts_with() was introduced in PHP 8.0 to perform a case-sensitive check indicating if the string to search in (haystack) begins with the given substring (needle).

WordPress core includes a polyfill for str_starts_with() on PHP < 8.0 as of WordPress 5.9. It is already used in this plugin.

@Soean Soean requested a review from lloc as a code owner October 22, 2025 08:52
Copy link
Contributor

@lloc lloc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your PR @Soean! LGTM :-)

@lloc lloc merged commit a304b12 into inpsyde:main Oct 22, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants