grappler/polylang-slug

Change version_compare to use a correct operator

Closed this issue ยท 2 comments

I know this repo is not actively maintained (UNFORTUNATELY!!) but for those who might need it or maybe if the author is willing to fix this anyway (please ๐Ÿ˜„ ):

if ( ! defined( 'POLYLANG_VERSION' ) || version_compare( POLYLANG_VERSION, '1.7', '=<' ) || version_compare( $GLOBALS[ 'wp_version' ], '4.0', '=<' ) ) {

the used operator is incorrect. the operator should be one of the following: <, lt, <=, le, >, gt, >=, ge, ==, =, eq, !=, <>. Thats why version_compare will always return null;
see php.net -> version-compare

thanks,remove this line it works.

if you arrived here because of an PHP error on line 31; in PHP 8.x, the solution is simmple:
either you change the operators from =< to <=
OR
you remove line 31 (I suggest comment);

both solve the issue.