<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; use Illuminate\Support\Str; use ModStart\Core\Input\Request; class PathUtil { public static function isPublicNetPath($nAf_0) { goto C7tYj; C7tYj: $E92eF = array('//', 'http://', 'https://'); goto Xto10; m3vt5: return false; goto ZdKUG; Xto10: foreach ($E92eF as $BSuqj) { if (Str::startsWith($nAf_0, $BSuqj)) { return true; } } goto m3vt5; ZdKUG: } public static function fix($nAf_0, $VYiXQ = null) { goto FveHH; Oj07u: if (Str::endsWith($VYiXQ, '/')) { $VYiXQ = substr($VYiXQ, 0, strlen($VYiXQ) - 1); } goto b11xJ; HQEXz: if (!Str::startsWith($nAf_0, '/')) { $nAf_0 = '/' . $nAf_0; } goto x35qL; FveHH: if (Str::startsWith($nAf_0, 'http://') || Str::startsWith($nAf_0, 'https://') || Str::startsWith($nAf_0, '//')) { return $nAf_0; } goto HQEXz; b11xJ: return $VYiXQ . $nAf_0; goto egC3u; x35qL: if ($VYiXQ === null) { return $nAf_0; } goto Oj07u; egC3u: } public static function fixOrDefault($nAf_0, $yJQAj, $VYiXQ = null) { if (empty($nAf_0)) { return self::fix($yJQAj, $VYiXQ); } return self::fix($nAf_0, $VYiXQ); } public static function fixFull($nAf_0, $VYiXQ = null, $M5TqJ = null) { goto A23To; Cw63N: if ($VYiXQ === null) { $VYiXQ = $M5TqJ . '://' . Request::domain(); } goto Nb9sd; qWnhA: if (Str::startsWith($nAf_0, '//')) { return $M5TqJ . ':' . $nAf_0; } goto RvtrQ; wv6DM: if (null === $M5TqJ) { $M5TqJ = Request::schema(); } goto qWnhA; MG5fc: return $VYiXQ . $nAf_0; goto RTsLp; Nb9sd: if (Str::endsWith($VYiXQ, '/')) { $VYiXQ = substr($VYiXQ, 0, strlen($VYiXQ) - 1); } goto MG5fc; RvtrQ: if (!Str::startsWith($nAf_0, '/')) { $nAf_0 = '/' . $nAf_0; } goto Cw63N; A23To: if (Str::startsWith($nAf_0, 'http://') || Str::startsWith($nAf_0, 'https://')) { return $nAf_0; } goto wv6DM; RTsLp: } public static function fixFullOrDefault($nAf_0, $yJQAj, $VYiXQ = null, $M5TqJ = null) { if (empty($nAf_0)) { return self::fixFull($yJQAj, $VYiXQ, $M5TqJ); } return self::fixFull($nAf_0, $VYiXQ, $M5TqJ); } public static function convertPublicToInternal($nAf_0) { goto nE4Vm; KUXs1: return $nAf_0; goto ofGAu; vXBcE: foreach ($I_qer as $KArF6) { if (!isset($KArF6['public']) || !isset($KArF6['internal'])) { continue; } $nAf_0 = str_replace($KArF6['public'], $KArF6['internal'], $nAf_0); } goto KUXs1; qfLNr: $I_qer = modstart_config('Site_PublicInternalUrlMap', array()); goto wcwhU; wcwhU: if (empty($I_qer) || !is_array($I_qer)) { return $nAf_0; } goto vXBcE; nE4Vm: if (empty($nAf_0)) { return $nAf_0; } goto qfLNr; ofGAu: } }