<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; use Illuminate\Support\Str; use ModStart\Core\Input\Request; class PathUtil { public static function isPublicNetPath($VF_G6) { goto VvJlS; VvJlS: $Jjef0 = array('//', 'http://', 'https://'); goto fys9G; DrAK1: return false; goto au99n; fys9G: foreach ($Jjef0 as $HTQyg) { if (Str::startsWith($VF_G6, $HTQyg)) { return true; } } goto DrAK1; au99n: } public static function fix($VF_G6, $QU75f = null) { goto DZ0b2; f82Le: if (Str::endsWith($QU75f, '/')) { $QU75f = substr($QU75f, 0, strlen($QU75f) - 1); } goto A11A2; DZ0b2: if (Str::startsWith($VF_G6, 'http://') || Str::startsWith($VF_G6, 'https://') || Str::startsWith($VF_G6, '//')) { return $VF_G6; } goto rfbPc; rfbPc: if (!Str::startsWith($VF_G6, '/')) { $VF_G6 = '/' . $VF_G6; } goto mLEmN; A11A2: return $QU75f . $VF_G6; goto I74Oy; mLEmN: if ($QU75f === null) { return $VF_G6; } goto f82Le; I74Oy: } public static function fixOrDefault($VF_G6, $TCqsx, $QU75f = null) { if (empty($VF_G6)) { return self::fix($TCqsx, $QU75f); } return self::fix($VF_G6, $QU75f); } public static function fixFull($VF_G6, $QU75f = null, $EcRQH = null) { goto QAGbR; QAGbR: if (Str::startsWith($VF_G6, 'http://') || Str::startsWith($VF_G6, 'https://')) { return $VF_G6; } goto IuDga; feqnA: if (Str::startsWith($VF_G6, '//')) { return $EcRQH . ':' . $VF_G6; } goto SfOo_; SfOo_: if (!Str::startsWith($VF_G6, '/')) { $VF_G6 = '/' . $VF_G6; } goto Qg82_; IuDga: if (null === $EcRQH) { $EcRQH = Request::schema(); } goto feqnA; GvieW: if (Str::endsWith($QU75f, '/')) { $QU75f = substr($QU75f, 0, strlen($QU75f) - 1); } goto swHMS; Qg82_: if ($QU75f === null) { $QU75f = $EcRQH . '://' . Request::domain(); } goto GvieW; swHMS: return $QU75f . $VF_G6; goto DWWz8; DWWz8: } public static function fixFullOrDefault($VF_G6, $TCqsx, $QU75f = null, $EcRQH = null) { if (empty($VF_G6)) { return self::fixFull($TCqsx, $QU75f, $EcRQH); } return self::fixFull($VF_G6, $QU75f, $EcRQH); } }