geoip-detect
geoip-detect copied to clipboard
patch on str_contains polyfill may conflict with other plugins
Hello, I'm talking about this commit: https://github.com/yellowtree/geoip-detect/commit/78cfc99a0087ad46cbc61699fd41563b2fb74763
polyfill80 is a pretty common dependency. If another plugin uses it and is active at the same time as geoip-detect, the version from the other plugin might be loaded. Then we will still have the same error that the commit is trying to prevent.
You're right ... and there is not much I can do about it, this should be fixed upstream. And this doesn't seem likely: https://github.com/symfony/symfony/issues/37035 But they are open for PR.
At some point, I will probably use PhpScoper to scope all my vendor dependencies ... this is my long-term plan ;-) Oh, wait, in this case I can't scope that function because it is polyfilling global! Hm....
WP 5.9 now includes the polyfill, I have to investigate further ...
Here is the polyfill from Wordpress - it also allows NULL values without throwing an error. So I guess I can leave my change above.
https://github.com/WordPress/WordPress/blob/b4de570d3555cce5d386f2f10d1d49d2444f3a77/wp-includes/compat.php#L420-L436