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

php 7.4 Uninitialized string offset 2: qtranslate_utils.php on line 460 #1047

Closed
andreysneg opened this issue Jul 14, 2021 · 3 comments
Closed
Labels
bug Something isn't working, reproducible core Core functionalities, including the admin section severity: minor Minor functionality

Comments

@andreysneg
Copy link

Version 3.10.1

If set php 7.4 or php 8.0 when error:
Warning: Uninitialized string offset 2 in /wp-content/plugins/qtranslate-xt-master/qtranslate_utils.php on line 460

Php 7.3 - no error.

@herrvigg
Copy link
Collaborator

herrvigg commented Aug 5, 2021

@andreysneg That's strange. In fact there's a check on the string size missing, but I don't see why it would be different with PHP 7.3: https://www.php.net/manual/en/migration74.php

The case you encounter is a very special case when the language name has no translation.

@herrvigg
Copy link
Collaborator

herrvigg commented Aug 6, 2021

I pushed a fix to master just for that bug.

Beyond this minor issue, that function looks quite weird and should be reworked to fix #668 and maybe #1030.

@herrvigg herrvigg added bug Something isn't working, reproducible severity: minor Minor functionality core Core functionalities, including the admin section labels Aug 6, 2021
@herrvigg
Copy link
Collaborator

Released in 3.11.0.

herrvigg added a commit that referenced this issue May 26, 2022
The strlen check from #1047 was wrong.
Also rewrite the second check without "fake" while loop.
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 core Core functionalities, including the admin section severity: minor Minor functionality
Projects
None yet
Development

No branches or pull requests

2 participants