alexandregz / twofactor_gauthenticator

This RoundCube plugin adds the 2-step verification(OTP) to the login proccess
MIT License
214 stars 74 forks source link

Multiple PHP warnings under PHP 8.1.27 #189

Open ozgurkazancci opened 5 months ago

ozgurkazancci commented 5 months ago

PHP version: 8.1.27 Roundcube version: 1.6.6

Hi, and first of all, thanks for such a good idea/plugin. I have activated and enabled the plugin. Logged out to try it, however I got the following varying PHP warnings;

PHP Warning:  preg_match(): Compilation failed: quantifier does not follow a repeatable item at offset 0 in /plugins/twofactor_gauthenticator/twofactor_gauthenticator.php on line 7

PHP Warning:  preg_match(): Compilation failed: quantifier does not follow a repeatable item at offset 0 in /plugins/twofactor_gauthenticator/twofactor_gauthenticator.php on line 75

PHP Warning:  Trying to access array offset on value of type null in /plugins/twofactor_gauthenticator/twofactor_gauthenticator.php on line 288
PHP Warning:  Trying to access array offset on value of type null in /plugins/twofactor_gauthenticator/twofactor_gauthenticator.php on line 294
PHP Warning:  Trying to access array offset on value of type null in /plugins/twofactor_gauthenticator/twofactor_gauthenticator.php on line 297
PHP Warning:  Trying to access array offset on value of type null in /plugins/twofactor_gauthenticator/twofactor_gauthenticator.php on line 318
PHP Warning:  Trying to access array offset on value of type null in /plugins/twofactor_gauthenticator/twofactor_gauthenticator.php on line 328
PHP Warning:  Trying to access array offset on value of type null in /plugins/twofactor_gauthenticator/twofactor_gauthenticator.php on line 342

PHP Warning:  Undefined array key "twofactor_gauthenticator_2FA_login" in /plugins/twofactor_gauthenticator/twofactor_gauthenticator.php on line 239

PHP Warning:  Trying to access array offset on value of type null in /plugins/twofactor_gauthenticator/twofactor_gauthenticator.php on line 239

Just wanted to report these all here.

Regards.

lukaszmarcola commented 5 months ago

Hi, I've also checked all versions of php 8.* and a similar warning is returned on each of them:

[16-Feb-2024 09:28:30 Europe/Warsaw] PHP Warning: Undefined array key "twofactor_gauthenticator" in /var/www/html/roundcube/plugins/twofactor_gauthenticator/twofactor_gauthenticator.php on line 413
[16-Feb-2024 09:28:30 Europe/Warsaw] PHP Warning: Trying to access array offset on value of type null in /var/www/html/roundcube/plugins/twofactor_gauthenticator/twofactor_gauthenticator.php on line 131

Roundcube version: 1.6.6

f1-outsourcing commented 2 months ago

I think this project is abandoned, this guy is only merging pull requests and everything looks crappy.

alexandregz commented 2 months ago

not abandoned, just fake news 😸

alexandregz commented 2 months ago

for example, looks her "opinion": he don't understand code -qr codes are generated locally using JS, easy to see- and try to call that others code, not only mine, is "crappy"

https://github.com/alexandregz/twofactor_gauthenticator/issues/194

Another one: https://github.com/alexandregz/twofactor_gauthenticator/issues/190#issuecomment-2106172903

alexandregz commented 2 months ago

About first comment: All this are just warnings because try to access to preferences first time, without prefs. You can skip these.

About second: I can't reproduce warnings (with php 8.0.8)

CodeShakingSheep commented 4 weeks ago

About first comment: All this are just warnings because try to access to preferences first time, without prefs. You can skip these.

About second: I can't reproduce warnings (with php 8.0.8)

These warnings appear from PHP 8.1 version onwards and should be fixed as in future PHP versions the affected code won't work anymore. I encounter these two warnings when running RoundCube and this plugin with PHP version 8.1.

[25-Jun-2024 01:54:54 UTC] PHP Warning:  Undefined array key "twofactor_gauthenticator_2FA_login" in /var/www/roundcube/plugins/twofactor_gauthenticator/twofactor_gauthenticator.php on line 184
[25-Jun-2024 01:54:54 UTC] PHP Warning:  Undefined array key "twofactor_gauthenticator_login" in /var/www/roundcube/plugins/twofactor_gauthenticator/twofactor_gauthenticator.php on line 184