<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; use Illuminate\Support\Str; use ModStart\Core\Input\Request; class PathUtil { public static function isPublicNetPath($S3tfG) { goto r4CRT; U1sFR: return false; goto yaff2; zgtQ5: foreach ($vXAs4 as $cxyYM) { if (Str::startsWith($S3tfG, $cxyYM)) { return true; } } goto U1sFR; r4CRT: $vXAs4 = array('//', 'http://', 'https://'); goto zgtQ5; yaff2: } public static function fix($S3tfG, $pvQ34 = null) { goto mPaS_; mPaS_: if (Str::startsWith($S3tfG, 'http://') || Str::startsWith($S3tfG, 'https://') || Str::startsWith($S3tfG, '//')) { return $S3tfG; } goto iWKmi; iWKmi: if (!Str::startsWith($S3tfG, '/')) { $S3tfG = '/' . $S3tfG; } goto SKRMY; eDGJd: if (Str::endsWith($pvQ34, '/')) { $pvQ34 = substr($pvQ34, 0, strlen($pvQ34) - 1); } goto Xv1f6; SKRMY: if ($pvQ34 === null) { return $S3tfG; } goto eDGJd; Xv1f6: return $pvQ34 . $S3tfG; goto dNHUQ; dNHUQ: } public static function fixOrDefault($S3tfG, $A0QpK, $pvQ34 = null) { if (empty($S3tfG)) { return self::fix($A0QpK, $pvQ34); } return self::fix($S3tfG, $pvQ34); } public static function fixFull($S3tfG, $pvQ34 = null, $r3NMl = null) { goto LssbX; Yh5n2: if (!Str::startsWith($S3tfG, '/')) { $S3tfG = '/' . $S3tfG; } goto guPTs; Yhs80: if (Str::endsWith($pvQ34, '/')) { $pvQ34 = substr($pvQ34, 0, strlen($pvQ34) - 1); } goto OQkP_; OQkP_: return $pvQ34 . $S3tfG; goto G1bMz; LssbX: if (Str::startsWith($S3tfG, 'http://') || Str::startsWith($S3tfG, 'https://')) { return $S3tfG; } goto VpUlM; guPTs: if ($pvQ34 === null) { $pvQ34 = $r3NMl . '://' . Request::domain(); } goto Yhs80; VpUlM: if (null === $r3NMl) { $r3NMl = Request::schema(); } goto Oy7fs; Oy7fs: if (Str::startsWith($S3tfG, '//')) { return $r3NMl . ':' . $S3tfG; } goto Yh5n2; G1bMz: } public static function fixFullOrDefault($S3tfG, $A0QpK, $pvQ34 = null, $r3NMl = null) { if (empty($S3tfG)) { return self::fixFull($A0QpK, $pvQ34, $r3NMl); } return self::fixFull($S3tfG, $pvQ34, $r3NMl); } }