Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
justinbb opened this issue May 1, 2023 · 3 comments
Closed

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

justinbb opened this issue May 1, 2023 · 3 comments
Labels
bug Something isn't working, reproducible severity: critical Critical functionality

Comments

@justinbb
Copy link

justinbb commented May 1, 2023

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

@justinbb justinbb added the maybe bug Potential bug, to be investigated label May 1, 2023
@herrvigg
Copy link
Collaborator

herrvigg commented May 1, 2023

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

@herrvigg herrvigg added bug Something isn't working, reproducible severity: critical Critical functionality and removed maybe bug Potential bug, to be investigated labels May 1, 2023
herrvigg added a commit that referenced this issue May 1, 2023
@herrvigg
Copy link
Collaborator

herrvigg commented May 1, 2023

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
Copy link
Collaborator

herrvigg commented May 1, 2023

Fix released in 3.15.1.

@herrvigg herrvigg closed this as completed May 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working, reproducible severity: critical Critical functionality
Projects
None yet
Development

No branches or pull requests

2 participants