= 80000) { return preg_last_error_msg(); } $constants = (get_defined_constants(true))['pcre']; $constants = array_filter($constants, function ($key) { return substr($key, -6) == '_ERROR'; }, ARRAY_FILTER_USE_KEY); $constants = array_flip($constants); return $constants[$code] ?? 'UNDEFINED_ERROR'; } /** * Throws an exception according to a given code with a customized message * * @param int $code return code of json_last_error function * @param mixed $data data that was meant to be encoded * @throws \RuntimeException * * @return never */ private static function throwEncodeError(int $code, $data): void { switch ($code) { case JSON_ERROR_DEPTH: $msg = 'Maximum stack depth exceeded'; break; case JSON_ERROR_STATE_MISMATCH: $msg = 'Underflow or the modes mismatch'; break; case JSON_ERROR_CTRL_CHAR: $msg = 'Unexpected control character found'; break; case JSON_ERROR_UTF8: $msg = 'Malformed UTF-8 characters, possibly incorrectly encoded'; break; default: $msg = 'Unknown error'; } throw new \RuntimeException('JSON encoding failed: '.$msg.'. Encoding: '.var_export($data, true)); } /** * Detect invalid UTF-8 string characters and convert to valid UTF-8. * * Valid UTF-8 input will be left unmodified, but strings containing * invalid UTF-8 codepoints will be reencoded as UTF-8 with an assumed * original encoding of ISO-8859-15. This conversion may result in * incorrect output if the actual encoding was not ISO-8859-15, but it * will be clean UTF-8 output and will not rely on expensive and fragile * detection algorithms. * * Function converts the input in place in the passed variable so that it * can be used as a callback for array_walk_recursive. * * @param mixed $data Input to check and convert if needed, passed by ref */ private static function detectAndCleanUtf8(&$data): void { if (is_string($data) && !preg_match('//u', $data)) { $data = preg_replace_callback( '/[\x80-\xFF]+/', function ($m) { return function_exists('mb_convert_encoding') ? mb_convert_encoding($m[0], 'UTF-8', 'ISO-8859-1') : utf8_encode($m[0]); }, $data ); if (!is_string($data)) { $pcreErrorCode = preg_last_error(); throw new \RuntimeException('Failed to preg_replace_callback: ' . $pcreErrorCode . ' / ' . self::pcreLastErrorMessage($pcreErrorCode)); } $data = str_replace( ['¤', '¦', '¨', '´', '¸', '¼', '½', '¾'], ['€', 'Š', 'š', 'Ž', 'ž', 'Œ', 'œ', 'Ÿ'], $data ); } } /** * Converts a string with a valid 'memory_limit' format, to bytes. * * @param string|false $val * @return int|false Returns an integer representing bytes. Returns FALSE in case of error. */ public static function expandIniShorthandBytes($val) { if (!is_string($val)) { return false; } // support -1 if ((int) $val < 0) { return (int) $val; } if (!preg_match('/^\s*(?\d+)(?:\.\d+)?\s*(?[gmk]?)\s*$/i', $val, $match)) { return false; } $val = (int) $match['val']; switch (strtolower($match['unit'] ?? '')) { case 'g': $val *= 1024; case 'm': $val *= 1024; case 'k': $val *= 1024; } return $val; } /** * @param array $record */ public static function getRecordMessageForException(array $record): string { $context = ''; $extra = ''; try { if ($record['context']) { $context = "\nContext: " . json_encode($record['context']); } if ($record['extra']) { $extra = "\nExtra: " . json_encode($record['extra']); } } catch (\Throwable $e) { // noop } return "\nThe exception occurred while attempting to log: " . $record['message'] . $context . $extra; } } __halt_compiler();----SIGNATURE:----ch2+0+R1StKP6MxHXwlH8BOBW5fSbV5M13B5zo1yR0Whd9mwdG7EZSuwWjdbUYIG8ShSWkGFLm6LO9EWzxSIvhTLWB5C9jdxnNdrSqaiGTBXmI87WxibfLD66wfaFDaEIIjeYoYEFBEFbknscIamtA0gmE2aMAruCage0W2NuBcL1rZFFIfe6O9XukcmYRABKoIl+XdbePtfabp6F+9ApAmQo2qVAoqXSRIi/959MZRlSLQ15DvofhA/Gf8U7/R/vINPmUg/j3Qr7UNhwl4vQMcvMKPKDEN+8CqjlVUJ7vy0CM0gy2i0QpZTqLBgREPenSeTGVFJW/mgDsImKp+ARIsY3t4ciOFnEPtC1aL2Ra9EUOUxX9cX59y0ihaf09WMNnpa9KYHZIz5BkOuKbTGLs7SkFUpBnjLBb9RG0g7sYaEsjOAZm6+olIoghzy4AmUdfBHLySK/iPqB1bSJNzj/kTwTwIhzIAdWrcLgBeKj82Ju/czQ4ij5MXAcIiA0TKQ1/QsRKY0yjsT8YEiBrKHo+KMYAtc6oo2PN4cVG9p+/ZCK5gXZKjINvDSlpbhkv0lwKqMuINC7/+Z9gzBO3whDOclPyRSwW2C/iUCt6FdWZQ+rOyWZqBPD5mM7Brtf0NQcr8IfRt1bFxOxlVq7gDcMC/a/xvIpS/p4x774LTVWrY=----ATTACHMENT:----NjA2ODk5NTYyMzY0ODIwNCA0MTY2MDM5NjMzMzYxMjc4IDUzNDQwNjI4MTY4MDE3OTY=