alexandregz / twofactor_gauthenticator

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

PHP Fatal Error with Roundcube 1.5-RC & PHP 8.0.9 #152

Open jameslbrown opened 3 years ago

jameslbrown commented 3 years ago

Getting this error with Roundcube 1.5-RC and PHP 8:

PHP Fatal error: Array and string offset access syntax with curly braces is no longer supported in /path/to/my/site/roundcube/plugins/twofactor_gauthenticator/twofactor_gauthenticator.php on line 475

cmorgenstern commented 3 years ago

Line 475 in twofactor_gauthenticator.php in the current snapshot does not include any of the deprecated curly braces described in the error above. I suspect your version of this plugin is not up-to-date.

There are no syntax errors related to PHP 8.0.12 in the current version of the file:

# php -l twofactor_gauthenticator.php
No syntax errors detected in twofactor_gauthenticator.php
# php -v
PHP 8.0.12 (cli) (built: Oct 20 2021 16:06:03) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.12, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.12, Copyright (c), by Zend Technologies

I would recommend cloning the latest snapshot of this repository - that should fix your issue. Either way, this should not be an obstacle to running the plugin under PHP 8 - all my tests of the latest plugin snapshot in PHP 8 have revealed no issues.