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 8.2 issue with ${var} declarations #110

Open
scottchiefbaker opened this issue Nov 2, 2023 · 1 comment
Open

PHP 8.2 issue with ${var} declarations #110

scottchiefbaker opened this issue Nov 2, 2023 · 1 comment

Comments

@scottchiefbaker
Copy link

FYI:

PHP Deprecated:  Using ${var} in strings is deprecated, use {$var} instead in /var/www/html/scott/rats/GoogleAuthenticator/PHPGangsta/GoogleAuthenticator.php on line 112

Super easy fix.

@dbkuaizi
Copy link

English (machine translation):
I'm also experiencing this issue, but judging by the activity, it shouldn't be maintained anymore, so I'll have to deal with it on my own.
The way I handled it is as follows, hopefully it can be a reference for people encountering the same problem:

Comment out line 112 and replace it with the following:

        return sprintf('https://api.qrserver.com/v1/create-qr-code/?data=%s&size=%dx%d&ecc=%s',
            $urlencoded, $width, $height, $level);

image

If you don't use this method getQRCodeGoogleUrl(), you can also just delete the part I selected.

image

中文回复:
我也遇到了这个问题,不过从活跃度上看,应该不在维护了,只能自行处理了。
我的处理方法如下,希望可以给遇到相同问题的人们一个参考:

将 112 行注释,并替为如下写法:

        return sprintf('https://api.qrserver.com/v1/create-qr-code/?data=%s&size=%dx%d&ecc=%s',
            $urlencoded, $width, $height, $level);

image

如果并没有使用此方法 getQRCodeGoogleUrl() ,也可以直接删除我选中的部分

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants