<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; use Illuminate\Support\Str; use ModStart\Core\Input\Request; class PathUtil { public static function isPublicNetPath($aurrr) { goto aBn0I; aBn0I: $Z8_I1 = array('//', 'http://', 'https://'); goto AkIVE; AkIVE: foreach ($Z8_I1 as $F1pdf) { if (Str::startsWith($aurrr, $F1pdf)) { return true; } } goto ttUGx; ttUGx: return false; goto NqBLp; NqBLp: } public static function fix($aurrr, $A9JhN = null) { goto Vb0O8; n5vLY: if ($A9JhN === null) { return $aurrr; } goto UX3_p; cujSx: return $A9JhN . $aurrr; goto Sjfw6; Vb0O8: if (Str::startsWith($aurrr, 'http://') || Str::startsWith($aurrr, 'https://') || Str::startsWith($aurrr, '//')) { return $aurrr; } goto t2c5i; UX3_p: if (Str::endsWith($A9JhN, '/')) { $A9JhN = substr($A9JhN, 0, strlen($A9JhN) - 1); } goto cujSx; t2c5i: if (!Str::startsWith($aurrr, '/')) { $aurrr = '/' . $aurrr; } goto n5vLY; Sjfw6: } public static function fixOrDefault($aurrr, $TGBtt, $A9JhN = null) { if (empty($aurrr)) { return self::fix($TGBtt, $A9JhN); } return self::fix($aurrr, $A9JhN); } public static function fixFull($aurrr, $A9JhN = null, $B1D_M = null) { goto vfQoM; vfQoM: if (Str::startsWith($aurrr, 'http://') || Str::startsWith($aurrr, 'https://')) { return $aurrr; } goto NcJcr; wBoWY: return $A9JhN . $aurrr; goto jvjGv; SUuyB: if ($A9JhN === null) { $A9JhN = $B1D_M . '://' . Request::domain(); } goto qMyJK; EXjGy: if (!Str::startsWith($aurrr, '/')) { $aurrr = '/' . $aurrr; } goto SUuyB; qMyJK: if (Str::endsWith($A9JhN, '/')) { $A9JhN = substr($A9JhN, 0, strlen($A9JhN) - 1); } goto wBoWY; LuKgv: if (Str::startsWith($aurrr, '//')) { return $B1D_M . ':' . $aurrr; } goto EXjGy; NcJcr: if (null === $B1D_M) { $B1D_M = Request::schema(); } goto LuKgv; jvjGv: } public static function fixFullOrDefault($aurrr, $TGBtt, $A9JhN = null, $B1D_M = null) { if (empty($aurrr)) { return self::fixFull($TGBtt, $A9JhN, $B1D_M); } return self::fixFull($aurrr, $A9JhN, $B1D_M); } }