A PHP Error was encountered

Severity: Warning

Message: mysqli::real_connect(): (HY000/2002): Cannot assign requested address

Filename: mysqli/mysqli_driver.php

Line Number: 201

Backtrace:

File: /www/wwwroot/dash.konsole.xyz/application/core/MY_Controller.php
Line: 343
Function: __construct

File: /www/wwwroot/dash.konsole.xyz/application/controllers/Api.php
Line: 12
Function: __construct

File: /www/wwwroot/dash.konsole.xyz/index.php
Line: 316
Function: require_once

Database Error

数据库发生错误。

无法使用提供的设置连接到数据库服务器。

Filename: core/MY_Controller.php

Line Number: 343


Fatal error: Uncaught Error: Call to a member function close() on string in /www/wwwroot/dash.konsole.xyz/application/core/MY_Controller.php:349 Stack trace: #0 [internal function]: Index_Controller->__destruct() #1 {main} thrown in /www/wwwroot/dash.konsole.xyz/application/core/MY_Controller.php on line 349
HEX
HEX
Server: Apache/2
System: Linux ns1.websitegang.club 5.4.0-149-generic #166-Ubuntu SMP Tue Apr 18 16:51:45 UTC 2023 x86_64
User: kunchorn (1109)
PHP: 8.2.29
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: /home/kunchorn/public_html/wp-content/plugins/nextend-facebook-connect/NSL/PCKE/PKCE.php
<?php

namespace NSL\PKCE;

use Exception;


/**
 * This class provides a simple interface for PKCE code_verifier and code_challenge generation.
 *
 *
 * @version     v8.5.0 (2023-03-28)
 * @link        https://auth0.com/docs/libraries/auth0-php          Project URL
 * @link        https://github.com/auth0/auth0-PHP         GitHub Repo
 * @author      auth0 <https://auth0.com>
 * @license     http://opensource.org/licenses/mit-license.php  MIT License
 *
 *
 * Code adjusted by Nextendweb for Nextend Social Login:
 *              - fix: throw simple exception
 *              - fix: code structure
 *
 */
final class PKCE {

    /**
     * Returns the generated code challenge from the given code_verifier. The
     * code_challenge should be a Base64 encoded string with URL and
     * filename-safe characters. The trailing '=' characters should be removed
     * and no line breaks, whitespace, or other additional characters should be
     * present.
     *
     * @param string $codeVerifier string to generate code challenge from
     *
     * @return string
     * @see https://auth0.com/docs/flows/concepts/auth-code-pkce
     *
     */
    public static function generateCodeChallenge($codeVerifier): string {
        $encoded = base64_encode(hash('sha256', $codeVerifier, true));

        return strtr(rtrim($encoded, '='), '+/', '-_');
    }

    /**
     * Generate a random string of between 43 and 128 characters containing
     * letters, numbers and "-", ".", "_", "~", as defined in the RFC 7636
     * specification.
     *
     * @param int $length Code verifier length
     *
     * @return string
     * @throws Exception
     *
     * @see https://tools.ietf.org/html/rfc7636
     */
    public static function generateCodeVerifier($length = 43): string {
        if ($length < 43 || $length > 128) {
            throw  new Exception('Code verifier must be created with a minimum length of 43 characters and a maximum length of 128 characters!');
        }

        $string = '';

        while (($len = mb_strlen($string)) < $length) {
            $size = $length - $len;
            $size = $size >= 1 ? $size : 1;

            // @codeCoverageIgnoreStart
            try {
                $bytes = random_bytes($size);
            } catch (Exception $e) {
                $bytes = openssl_random_pseudo_bytes($size);
            }
            // @codeCoverageIgnoreEnd

            $string .= mb_substr(str_replace([
                '/',
                '+',
                '='
            ], '', base64_encode($bytes)), 0, $size);
        }

        return $string;
    }
}