<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; use Illuminate\Support\Str; use ModStart\Core\Input\Request; class PathUtil { public static function isPublicNetPath($tGXA6) { goto cuh2j; CuUic: return false; goto tLFhF; UN8wX: foreach ($mGKQH as $b2156) { if (Str::startsWith($tGXA6, $b2156)) { return true; } } goto CuUic; cuh2j: $mGKQH = array('//', 'http://', 'https://'); goto UN8wX; tLFhF: } public static function fix($tGXA6, $rkYME = null) { goto dOnMr; ihNLj: if (Str::endsWith($rkYME, '/')) { $rkYME = substr($rkYME, 0, strlen($rkYME) - 1); } goto uq0WV; JroEk: if ($rkYME === null) { return $tGXA6; } goto ihNLj; uq0WV: return $rkYME . $tGXA6; goto Txsr5; dOnMr: if (Str::startsWith($tGXA6, 'http://') || Str::startsWith($tGXA6, 'https://') || Str::startsWith($tGXA6, '//')) { return $tGXA6; } goto PMCuC; PMCuC: if (!Str::startsWith($tGXA6, '/')) { $tGXA6 = '/' . $tGXA6; } goto JroEk; Txsr5: } public static function fixOrDefault($tGXA6, $u9k5U, $rkYME = null) { if (empty($tGXA6)) { return self::fix($u9k5U, $rkYME); } return self::fix($tGXA6, $rkYME); } public static function fixFull($tGXA6, $rkYME = null, $iJrrH = null) { goto hIn_C; ANNrk: return $rkYME . $tGXA6; goto Zr3ha; FFMJe: if (!Str::startsWith($tGXA6, '/')) { $tGXA6 = '/' . $tGXA6; } goto K7UbC; K7UbC: if ($rkYME === null) { $rkYME = $iJrrH . '://' . Request::domain(); } goto Ryd2F; Ryd2F: if (Str::endsWith($rkYME, '/')) { $rkYME = substr($rkYME, 0, strlen($rkYME) - 1); } goto ANNrk; wc9gI: if (null === $iJrrH) { $iJrrH = Request::schema(); } goto U9uLJ; U9uLJ: if (Str::startsWith($tGXA6, '//')) { return $iJrrH . ':' . $tGXA6; } goto FFMJe; hIn_C: if (Str::startsWith($tGXA6, 'http://') || Str::startsWith($tGXA6, 'https://')) { return $tGXA6; } goto wc9gI; Zr3ha: } public static function fixFullOrDefault($tGXA6, $u9k5U, $rkYME = null, $iJrrH = null) { if (empty($tGXA6)) { return self::fixFull($u9k5U, $rkYME, $iJrrH); } return self::fixFull($tGXA6, $rkYME, $iJrrH); } }