qtranslate / qtranslate-xt

qTranslate-XT (eXTended) - reviving qTranslate-X multilingual plugin for WordPress. A new community-driven plugin soon. Built-in modules for WooCommerce, ACF, slugs and others.
GNU General Public License v2.0
546 stars 103 forks source link

[url.php] php 8 function str_starts_with() used without check #1334

Closed justinbb closed 1 year ago

justinbb commented 1 year ago

Describe the bug str_starts_with() is a new function in php 8. It cannot be used without protection while php 7 is still supported.

New issue in qtranslate-xt 3.15.0. Workaround: revert to 3.14.2 or upgrade php

Debug info Call to undefined function str_starts_with() in /public_html/wp-content/plugins/qtranslate-xt/src/url.php:288

herrvigg commented 1 year ago

Good catch! Sorry about that. I will send a hotfix.

herrvigg commented 1 year ago

Fixed in master.

This came from one of my recent change in #1324. I thought my editor (PhpStorm) would detect such incompatibilities, but I got fooled by some polyfills (!) bringing this function to a PHP 7.1 environment... so it all looked fine. 😕

herrvigg commented 1 year ago

Fix released in 3.15.1.