<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; use Illuminate\Support\Str; use ModStart\Core\Input\Request; class PathUtil { public static function isPublicNetPath($adFNb) { goto yeYnt; BXB6Y: foreach ($U4HWG as $bD3WW) { if (Str::startsWith($adFNb, $bD3WW)) { return true; } } goto YrONm; YrONm: return false; goto kA2x8; yeYnt: $U4HWG = array('//', 'http://', 'https://'); goto BXB6Y; kA2x8: } public static function fix($adFNb, $vL9Ql = null) { goto rSGsP; A6zY2: if (!Str::startsWith($adFNb, '/')) { $adFNb = '/' . $adFNb; } goto MpLEs; CdGa4: return $vL9Ql . $adFNb; goto AQoDB; rSGsP: if (Str::startsWith($adFNb, 'http://') || Str::startsWith($adFNb, 'https://') || Str::startsWith($adFNb, '//')) { return $adFNb; } goto A6zY2; naDiR: if (Str::endsWith($vL9Ql, '/')) { $vL9Ql = substr($vL9Ql, 0, strlen($vL9Ql) - 1); } goto CdGa4; MpLEs: if ($vL9Ql === null) { return $adFNb; } goto naDiR; AQoDB: } public static function fixOrDefault($adFNb, $rCJvC, $vL9Ql = null) { if (empty($adFNb)) { return self::fix($rCJvC, $vL9Ql); } return self::fix($adFNb, $vL9Ql); } public static function fixFull($adFNb, $vL9Ql = null, $jnEF2 = null) { goto kLykq; gJ4fB: if (Str::endsWith($vL9Ql, '/')) { $vL9Ql = substr($vL9Ql, 0, strlen($vL9Ql) - 1); } goto lnUZN; AYjoP: if (!Str::startsWith($adFNb, '/')) { $adFNb = '/' . $adFNb; } goto pSPTO; lnUZN: return $vL9Ql . $adFNb; goto BJXU9; kLykq: if (Str::startsWith($adFNb, 'http://') || Str::startsWith($adFNb, 'https://')) { return $adFNb; } goto kxoE_; pSPTO: if ($vL9Ql === null) { $vL9Ql = $jnEF2 . '://' . Request::domain(); } goto gJ4fB; kA6Uy: if (Str::startsWith($adFNb, '//')) { return $jnEF2 . ':' . $adFNb; } goto AYjoP; kxoE_: if (null === $jnEF2) { $jnEF2 = Request::schema(); } goto kA6Uy; BJXU9: } public static function fixFullOrDefault($adFNb, $rCJvC, $vL9Ql = null, $jnEF2 = null) { if (empty($adFNb)) { return self::fixFull($rCJvC, $vL9Ql, $jnEF2); } return self::fixFull($adFNb, $vL9Ql, $jnEF2); } }