This commit is contained in:
2021-10-29 18:50:53 +08:00
parent 340c67b4ac
commit c87a9b4732
+5 -4
View File
@@ -4,7 +4,6 @@ defined('APP_PATH') or define('APP_PATH', realpath(__DIR__ . '/../../'));
use Annotation\Annotation;
use Kiri\Context;
use Http\Handler\Router;
use JetBrains\PhpStorm\Pure;
use Kiri\Abstracts\Config;
@@ -20,7 +19,6 @@ use Kiri\Kiri;
use Psr\Log\LoggerInterface;
use Server\ServerManager;
use Swoole\WebSocket\Server;
use Http\Message\Response as Par7Response;
if (!function_exists('make')) {
@@ -242,6 +240,9 @@ if (!function_exists('isUrl')) {
*/
function isUrl($url, $get_info = true): bool|array
{
if (str_starts_with($url, '/')) {
return false;
}
$queryMatch = '/((http[s]?):\/\/)?(([\w\-\_]+\.)+\w+(:\d+)?)(\/.*)?/';
if (!preg_match($queryMatch, $url, $outPut)) {
return false;
@@ -988,8 +989,8 @@ if (!function_exists('jTraceEx')) {
function jTraceEx($e, $seen = null, bool $toHtml = false): string
{
$starter = $seen ? 'Caused by: ' : '';
$result = array();
if (!$seen) $seen = array();
$result = [];
if (!$seen) $seen = [];
$trace = $e->getTrace();
$prev = $e->getPrevious();
$result[] = sprintf('%s%s: %s', $starter, $e::class, $e->getMessage());