grappler / polylang-slug

A unique post slug within the language in Polylang. This allows for a page to have same/identical slug in multiple languages.
275 stars 84 forks source link

Change version_compare to use a correct operator #51

Closed Emanuel-23 closed 2 years ago

Emanuel-23 commented 3 years ago

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 😄 ):

https://github.com/grappler/polylang-slug/blob/f521168ad553ea7f54bc96f7b7014b93c3845c1f/polylang-slug.php#L31

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

nomedia commented 3 years ago

thanks,remove this line it works.

rwkyyy commented 3 years ago

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.