enygma / yubikey

PHP library to interface with the Yubikey REST API
MIT License
76 stars 16 forks source link

Deprecated warning utf8_encode #36

Open Leonetienne opened 5 months ago

Leonetienne commented 5 months ago

Using this code

            $otp = $_GET['otp'];

            $validator = new Validate(
                $secret,
                $id
            );

            try {
                $response = $validator->check($otp);
            }
            catch (\Exception) {
                die('Access denied!');
            }

            if ($response->success()) {
                die('Access granted!');
            }
            else {
                die('Access denied!');
            }

yields the following response

Deprecated: Function utf8_encode() is deprecated in /var/www/html/vendor/enygma/yubikey/src/Yubikey/Validate.php on line 257

Deprecated: Function utf8_encode() is deprecated in /var/www/html/vendor/enygma/yubikey/src/Yubikey/Validate.php on line 257
Access granted!

I am using PHP 8.2 and enygma/yubikey 3.6

mbolli commented 4 months ago

This was merged in https://github.com/enygma/yubikey/pull/33 but overwritten by https://github.com/enygma/yubikey/pull/34, sorry about that.

@enygma This should be re-introduced to fix the E_DEPRECATED error: https://github.com/enygma/yubikey/pull/33/files