function ShowConfig() { $s_License = "ok"; $n_StyleID = 0; $s_StyleName = TrimGet("style"); $b = false; $numElements = count($GLOBALS["aStyle"]); for ($i = 1; $i <= $numElements; $i++) { $aTmpStyle = explode("|||", $GLOBALS["aStyle"][$i]); if (strtolower($s_StyleName) == strtolower($aTmpStyle[0])) { $n_StyleID = $i; $b = true; break; } } if (!$b) { return; } $ret = ""; $aTmpStyle = explode("|||", $GLOBALS["aStyle"][$n_StyleID]); $ret = $ret . "config.FixWidth = \"" . $aTmpStyle[1] . "\";\r\n"; if ($aTmpStyle[19] == "3") { $ret = $ret . "config.UploadUrl = \"" . $aTmpStyle[23] . "\";\r\n"; } else { $ret = $ret . "config.UploadUrl = \"" . $aTmpStyle[3] . "\";\r\n"; } $ret = $ret . "config.InitMode = \"" . $aTmpStyle[18] . "\";\n\r"; $ret = $ret . "config.AutoDetectPaste = \"" . $aTmpStyle[17] . "\";\n\r"; $ret = $ret . "config.BaseUrl = \"" . $aTmpStyle[19] . "\";\n\r"; $ret = $ret . "config.BaseHref = \"" . $aTmpStyle[22] . "\";\n\r"; $ret = $ret . "config.AutoRemote = \"" . $aTmpStyle[24] . "\";\n\r"; $ret = $ret . "config.ShowBorder = \"" . $aTmpStyle[25] . "\";\n\r"; $ret = $ret . "config.StateFlag = \"" . $aTmpStyle[16] . "\";\n\r"; $ret = $ret . "config.SBCode = \"" . $aTmpStyle[62] . "\";\n\r"; $ret = $ret . "config.SBEdit = \"" . $aTmpStyle[63] . "\";\n\r"; $ret = $ret . "config.SBText = \"" . $aTmpStyle[64] . "\";\n\r"; $ret = $ret . "config.SBView = \"" . $aTmpStyle[65] . "\";\n\r"; $ret = $ret . "config.SBSize = \"" . $aTmpStyle[76] . "\";\n\r"; $ret = $ret . "config.EnterMode = \"" . $aTmpStyle[66] . "\";\n\r"; $ret = $ret . "config.Skin = \"" . $aTmpStyle[2] . "\";\n\r"; $ret = $ret . "config.AutoDetectLanguage = \"" . $aTmpStyle[27] . "\";\n\r"; $ret = $ret . "config.DefaultLanguage = \"" . $aTmpStyle[28] . "\";\n\r"; $ret = $ret . "config.AllowBrowse = \"" . $aTmpStyle[43] . "\";\n\r"; $ret = $ret . "config.AllowImageSize = \"" . $aTmpStyle[13] . "\";\n\r"; $ret = $ret . "config.AllowFlashSize = \"" . $aTmpStyle[12] . "\";\n\r"; $ret = $ret . "config.AllowMediaSize = \"" . $aTmpStyle[14] . "\";\n\r"; $ret = $ret . "config.AllowFileSize = \"" . $aTmpStyle[11] . "\";\n\r"; $ret = $ret . "config.AllowRemoteSize = \"" . $aTmpStyle[15] . "\";\n\r"; $ret = $ret . "config.AllowLocalSize = \"" . $aTmpStyle[45] . "\";\n\r"; $ret = $ret . "config.AllowImageExt = \"" . $aTmpStyle[8] . "\";\n\r"; $ret = $ret . "config.AllowFlashExt = \"" . $aTmpStyle[7] . "\";\n\r"; $ret = $ret . "config.AllowMediaExt = \"" . $aTmpStyle[9] . "\";\n\r"; $ret = $ret . "config.AllowFileExt = \"" . $aTmpStyle[6] . "\";\n\r"; $ret = $ret . "config.AllowRemoteExt = \"" . $aTmpStyle[10] . "\";\n\r"; $ret = $ret . "config.AllowLocalExt = \"" . $aTmpStyle[44] . "\";\n\r"; $ret = $ret . "config.AreaCssMode = \"" . $aTmpStyle[67] . "\";\n\r"; $ret = $ret . "config.SLTFlag = \"" . $aTmpStyle[29] . "\";\n\r"; $ret = $ret . "config.SLTMinSize = \"" . $aTmpStyle[30] . "\";\n\r"; $ret = $ret . "config.SLTOkSize = \"" . $aTmpStyle[31] . "\";\n\r"; $ret = $ret . "config.SLTMode = \"" . $aTmpStyle[69] . "\";\n\r"; $ret = $ret . "config.SLTCheckFlag = \"" . $aTmpStyle[77] . "\";\n\r"; $ret = $ret . "config.SYWZFlag = \"" . $aTmpStyle[32] . "\";\n\r"; $ret = $ret . "config.SYTPFlag = \"" . $aTmpStyle[52] . "\";\n\r"; $ret = $ret . "config.FileNameMode = \"" . $aTmpStyle[68] . "\";\n\r"; $ret = $ret . "config.PaginationMode = \"" . $aTmpStyle[72] . "\";\n\r"; $ret = $ret . "config.PaginationKey = \"" . $aTmpStyle[73] . "\";\n\r"; $ret = $ret . "config.PaginationAutoFlag = \"" . $aTmpStyle[74] . "\";\n\r"; $ret = $ret . "config.PaginationAutoNum = \"" . $aTmpStyle[75] . "\";\n\r"; $ret = $ret . "config.SParams = \"\";\n\r"; $ret = $ret . "config.SpaceSize = \"" . $aTmpStyle[78] . "\";\n\r"; $ret = $ret . "config.MFUBlockSize = \"" . $aTmpStyle[80] . "\";\n\r"; $ret = $ret . "config.MFUEnable = \"" . $aTmpStyle[81] . "\";\n\r"; $ret = $ret . "config.CodeFormat = \"" . $aTmpStyle[82] . "\";\n\r"; $ret = $ret . "config.TB2Flag = \"" . $aTmpStyle[83] . "\";\n\r"; $ret = $ret . "config.TB2Mode = \"" . $aTmpStyle[84] . "\";\n\r"; $ret = $ret . "config.TB2Max = \"" . $aTmpStyle[85] . "\";\n\r"; $ret = $ret . "config.ShowBlock = \"" . $aTmpStyle[86] . "\";\n\r"; $ret = $ret . "config.WIIMode = \"" . $aTmpStyle[95] . "\";\n\r"; $ret = $ret . "config.QFIFontName = \"" . $aTmpStyle[96] . "\";\n\r"; $ret = $ret . "config.QFIFontSize = \"" . $aTmpStyle[97] . "\";\n\r"; $ret = $ret . "config.UIMinHeight = \"" . $aTmpStyle[98] . "\";\n\r"; $ret = $ret . "config.SYVNormal = \"" . $aTmpStyle[99] . "\";\n\r"; $ret = $ret . "config.SYVLocal = \"" . $aTmpStyle[100] . "\";\n\r"; $ret = $ret . "config.SYVRemote = \"" . $aTmpStyle[101] . "\";\n\r"; $ret = $ret . "config.AutoDonePasteWord = \"" . $aTmpStyle[102] . "\";\n\r"; $ret = $ret . "config.AutoDonePasteExcel = \"" . $aTmpStyle[103] . "\";\n\r"; $ret = $ret . "config.AutoDoneQuickFormat = \"" . $aTmpStyle[104] . "\";\n\r"; $ret = $ret . "config.WIAPI = \"" . $aTmpStyle[105] . "\";\n\r"; $ret = $ret . "config.AutoDonePasteOption = \"" . $aTmpStyle[106] . "\";\n\r"; $ret = $ret . "config.Cookie = \"" . $_SERVER['HTTP_COOKIE'] . "\";\n\r"; $ret = $ret . "config.L = \"" . $s_License . "\";\n\r"; $ret = $ret . "config.ServerExt = \"php\";\n\r"; $ret = $ret . "config.Charset = \"utf-8\";\n\r"; $ret = $ret . "\r\n"; $ret = $ret . "config.Toolbars = [\r\n"; $s_Order = ""; $s_ID = ""; for ($n = 1; $n <= count($GLOBALS["aToolbar"]); $n++) { if ($GLOBALS["aToolbar"][$n] != "") { $aTmpToolbar = explode("|||", $GLOBALS["aToolbar"][$n]); if ((int) $aTmpToolbar[0] == $n_StyleID) { if ($s_ID != "") { $s_ID = $s_ID . "|"; $s_Order = $s_Order . "|"; } $s_ID = $s_ID . $n; $s_Order = $s_Order . $aTmpToolbar[3]; } } } if ($s_ID != "") { $a_ID = explode("|", $s_ID); $a_Order = explode("|", $s_Order); for ($n = 0; $n < count($a_Order); $n++) { $a_Order[$n] = (int) $a_Order[$n]; $a_ID[$n] = (int) $a_ID[$n]; } for ($n = 0; $n < count($a_ID); $n++) { $aTmpToolbar = explode("|||", $GLOBALS["aToolbar"][$a_ID[$n]]); $aTmpButton = explode("|", $aTmpToolbar[1]); $n_Count = count($aTmpButton); if ($n > 0) { $ret = $ret . ",\r\n"; } $ret = $ret . "\t["; for ($i = 0; $i < $n_Count; $i++) { if ($i > 0) { $ret = $ret . ", "; } $ret = $ret . "\"" . $aTmpButton[$i] . "\""; } $ret = $ret . "]"; } } $ret = $ret . "\r\n];\r\n"; echo $ret; }
function InitParam() { global $sType, $sStyleName, $sCusDir, $sAction; global $nTreeIndex; global $sAllowExt, $sUploadDir, $sBaseUrl, $sContentPath, $nAllowBrowse; global $sPathShareImage, $sPathShareFlash, $sPathShareMedia, $sPathShareOther; $sType = strtoupper(TrimGet("type")); $sStyleName = TrimGet("style"); $sCusDir = TrimGet("cusdir"); $s_SKey = TrimGet("skey"); $bValidStyle = false; $numElements = count($GLOBALS["aStyle"]); for ($i = 1; $i <= $numElements; $i++) { $aStyleConfig = explode("|||", $GLOBALS["aStyle"][$i]); if (strtolower($sStyleName) == strtolower($aStyleConfig[0])) { $bValidStyle = true; break; } } if ($bValidStyle == false) { OutScript("alert('Invalid Style!')"); } if ($aStyleConfig[61] != "1") { $sCusDir = ""; } if ($aStyleConfig[61] == "2" && $s_SKey != "") { $ss_FileSize = GetSAPIvalue($s_SKey, "FileSize"); $ss_FileBrowse = GetSAPIvalue($s_SKey, "FileBrowse"); $ss_SpaceSize = GetSAPIvalue($s_SKey, "SpaceSize"); $ss_SpacePath = GetSAPIvalue($s_SKey, "SpacePath"); $ss_PathMode = GetSAPIvalue($s_SKey, "PathMode"); $ss_PathUpload = GetSAPIvalue($s_SKey, "PathUpload"); $ss_PathCusDir = GetSAPIvalue($s_SKey, "PathCusDir"); $ss_PathCode = GetSAPIvalue($s_SKey, "PathCode"); $ss_PathView = GetSAPIvalue($s_SKey, "PathView"); if (is_numeric($ss_FileSize)) { $aStyleConfig[11] = $ss_FileSize; $aStyleConfig[12] = $ss_FileSize; $aStyleConfig[13] = $ss_FileSize; $aStyleConfig[14] = $ss_FileSize; $aStyleConfig[15] = $ss_FileSize; $aStyleConfig[45] = $ss_FileSize; } else { $ss_FileSize = ""; } if ($ss_FileBrowse == "0" || $ss_FileBrowse == "1") { $aStyleConfig[43] = $ss_FileBrowse; } else { $ss_FileBrowse = ""; } if (is_numeric($ss_SpaceSize)) { $aStyleConfig[78] = $ss_SpaceSize; } else { $ss_SpaceSize = ""; } if ($ss_PathMode != "") { $aStyleConfig[19] = $ss_PathMode; } if ($ss_PathUpload != "") { $aStyleConfig[3] = $ss_PathUpload; } if ($ss_PathCode != "") { $aStyleConfig[23] = $ss_PathCode; } if ($ss_PathView != "") { $aStyleConfig[22] = $ss_PathView; } $sCusDir = $ss_PathCusDir; } $sBaseUrl = $aStyleConfig[19]; $nAllowBrowse = (int) $aStyleConfig[43]; if ($nAllowBrowse != 1) { OutScript("alert('Do not allow browse!')"); } if ($sCusDir != "") { $sCusDir = str_replace("\\", "/", $sCusDir); if (substr($sCusDir, 0, 1) == "/" || substr($sCusDir, 0, 1) == "." || substr($sCusDir, -1) == "." || strpos($sCusDir, "./") !== false || strpos($sCusDir, "/.") !== false || strpos($sCusDir, "//") !== false || strpos($sCusDir, "..") !== false) { $sCusDir = ""; } else { if (substr($sCusDir, -1) != "/") { $sCusDir = $sCusDir . "/"; } } } $sUploadDir = $aStyleConfig[3]; if ($sBaseUrl != "3") { if (substr($sUploadDir, 0, 1) != "/") { $sUploadDir = "../" . $sUploadDir; } $sUploadDir = realpath($sUploadDir); } $sUploadDir = GetSlashPath($sUploadDir); $sUploadDir = $sUploadDir . $sCusDir; switch ($sType) { case "FILE": $sAllowExt = $aStyleConfig[6]; break; case "MEDIA": $sAllowExt = $aStyleConfig[9]; break; case "FLASH": $sAllowExt = $aStyleConfig[7]; break; default: $sAllowExt = $aStyleConfig[8]; break; } $sAllowExt = strtoupper($sAllowExt); $sPathShareImage = GetSlashPath(realpath("../sharefile/image/")); $sPathShareFlash = GetSlashPath(realpath("../sharefile/flash/")); $sPathShareMedia = GetSlashPath(realpath("../sharefile/media/")); $sPathShareOther = GetSlashPath(realpath("../sharefile/other/")); }
function InitUpload() { global $sType, $sStyleName, $sCusDir, $sParamSYFlag, $sParamRnd; global $sAllowExt, $nAllowSize, $sUploadDir, $nUploadObject, $sAutoDir, $sBaseUrl, $sContentPath, $sSetContentPath; global $sFileExt, $sOriginalFileName, $sSaveFileName, $sPathFileName, $nFileNum; global $nSLTFlag, $nSLTMode, $nSLTCheckFlag, $nSLTMinSize, $nSLTOkSize, $nSYWZFlag, $sSYText, $sSYFontColor, $nSYFontSize, $sSYFontName, $sSYPicPath, $nSLTSYObject, $sSLTSYExt, $nSYWZMinWidth, $sSYShadowColor, $nSYShadowOffset, $nSYWZMinHeight, $nSYWZPosition, $nSYWZTextWidth, $nSYWZTextHeight, $nSYWZPaddingH, $nSYWZPaddingV, $nSYTPFlag, $nSYTPMinWidth, $nSYTPMinHeight, $nSYTPPosition, $nSYTPPaddingH, $nSYTPPaddingV, $nSYTPImageWidth, $nSYTPImageHeight, $nSYTPOpacity; global $sSpaceSize, $sSpacePath, $sMFUMode; global $sParamBlockFile, $sParamBlockFlag; global $sFileNameMode, $sFileNameSameFix, $sAutoDirOrderFlag, $sAutoTypeDir; global $sSYValidNormal, $sSYValidLocal, $sSYValidRemote; $sType = TrimGet("type"); $sStyleName = TrimGet("style"); $sCusDir = TrimGet("cusdir"); $sParamSYFlag = TrimGet("syflag"); $sParamRnd = TrimGet("rnd"); $s_SKey = TrimGet("skey"); $s_SParams = TrimGet("sparams"); $sParamBlockFile = TrimGet("blockfile"); $sParamBlockFlag = TrimGet("blockflag"); if ($sParamBlockFile != "") { if (!IsFileNameFormat($sParamBlockFile)) { OutScript("blockfile"); exit; } } $bValidStyle = false; $numElements = count($GLOBALS["aStyle"]); for ($i = 1; $i <= $numElements; $i++) { $aStyleConfig = explode("|||", $GLOBALS["aStyle"][$i]); if (strtolower($sStyleName) == strtolower($aStyleConfig[0])) { $bValidStyle = true; break; } } if ($bValidStyle == false) { OutScript("parent.UploadError('style')"); } if ($aStyleConfig[61] != "1") { $sCusDir = ""; } if ($aStyleConfig[61] == "2" && ($s_SKey != "" || IsOkSParams($s_SParams, $aStyleConfig[70]))) { $ss_FileSize = ""; $ss_FileBrowse = ""; $ss_SpaceSize = ""; $ss_SpacePath = ""; $ss_PathMode = ""; $ss_PathUpload = ""; $ss_PathCusDir = ""; $ss_PathCode = ""; $ss_PathView = ""; if ($s_SKey != "") { $ss_FileSize = GetSAPIvalue($s_SKey, "FileSize"); $ss_FileBrowse = GetSAPIvalue($s_SKey, "FileBrowse"); $ss_SpaceSize = GetSAPIvalue($s_SKey, "SpaceSize"); $ss_SpacePath = GetSAPIvalue($s_SKey, "SpacePath"); $ss_PathMode = GetSAPIvalue($s_SKey, "PathMode"); $ss_PathUpload = GetSAPIvalue($s_SKey, "PathUpload"); $ss_PathCusDir = GetSAPIvalue($s_SKey, "PathCusDir"); $ss_PathCode = GetSAPIvalue($s_SKey, "PathCode"); $ss_PathView = GetSAPIvalue($s_SKey, "PathView"); } else { $a_SParams = explode("|", $s_SParams); $ss_FileSize = $a_SParams[1]; $ss_FileBrowse = $a_SParams[2]; $ss_SpaceSize = $a_SParams[3]; $ss_SpacePath = $a_SParams[4]; $ss_PathMode = $a_SParams[5]; $ss_PathUpload = $a_SParams[6]; $ss_PathCusDir = $a_SParams[7]; $ss_PathCode = $a_SParams[8]; $ss_PathView = $a_SParams[9]; } if (is_numeric($ss_FileSize)) { $aStyleConfig[11] = $ss_FileSize; $aStyleConfig[12] = $ss_FileSize; $aStyleConfig[13] = $ss_FileSize; $aStyleConfig[14] = $ss_FileSize; $aStyleConfig[15] = $ss_FileSize; $aStyleConfig[45] = $ss_FileSize; } else { $ss_FileSize = ""; } if ($ss_FileBrowse == "0" || $ss_FileBrowse == "1") { $aStyleConfig[43] = $ss_FileBrowse; } else { $ss_FileBrowse = ""; } if (is_numeric($ss_SpaceSize)) { $aStyleConfig[78] = $ss_SpaceSize; } else { $ss_SpaceSize = ""; } if ($ss_PathMode != "") { $aStyleConfig[19] = $ss_PathMode; } if ($ss_PathUpload != "") { $aStyleConfig[3] = $ss_PathUpload; } if ($ss_PathCode != "") { $aStyleConfig[23] = $ss_PathCode; } if ($ss_PathView != "") { $aStyleConfig[22] = $ss_PathView; } $sCusDir = $ss_PathCusDir; $sSpacePath = $ss_SpacePath; } else { $sSpacePath = ""; } $sBaseUrl = $aStyleConfig[19]; $nUploadObject = (int) $aStyleConfig[20]; $sAutoDir = $aStyleConfig[71]; $sUploadDir = $aStyleConfig[3]; if ($sBaseUrl != "3") { if (substr($sUploadDir, 0, 1) != "/") { $sUploadDir = "../" . $sUploadDir; } } switch ($sBaseUrl) { case "0": case "3": $sContentPath = $aStyleConfig[23]; break; case "1": $sContentPath = RelativePath2RootPath($sUploadDir); break; case "2": $sContentPath = RootPath2DomainPath(RelativePath2RootPath($sUploadDir)); break; } $sSetContentPath = $sContentPath; if ($sBaseUrl != "3") { $sUploadDir = realpath($sUploadDir); } if (substr($sUploadDir, -1) != "\\" && substr($sUploadDir, -1) != "/") { $sUploadDir .= "/"; } switch (strtoupper($sType)) { case "REMOTE": $sAllowExt = $aStyleConfig[10]; $nAllowSize = (int) $aStyleConfig[15]; $sAutoTypeDir = $aStyleConfig[93]; break; case "FILE": $sAllowExt = $aStyleConfig[6]; $nAllowSize = (int) $aStyleConfig[11]; $sAutoTypeDir = $aStyleConfig[92]; break; case "MEDIA": $sAllowExt = $aStyleConfig[9]; $nAllowSize = (int) $aStyleConfig[14]; $sAutoTypeDir = $aStyleConfig[91]; break; case "FLASH": $sAllowExt = $aStyleConfig[7]; $nAllowSize = (int) $aStyleConfig[12]; $sAutoTypeDir = $aStyleConfig[90]; break; case "LOCAL": $sAllowExt = $aStyleConfig[44]; $nAllowSize = (int) $aStyleConfig[45]; $sAutoTypeDir = $aStyleConfig[94]; break; default: $sAllowExt = $aStyleConfig[8]; $nAllowSize = (int) $aStyleConfig[13]; $sAutoTypeDir = $aStyleConfig[89]; break; } $sAllowExt = strtoupper($sAllowExt); $nSLTFlag = (int) $aStyleConfig[29]; $nSLTMode = (int) $aStyleConfig[69]; $nSLTCheckFlag = (int) $aStyleConfig[77]; $nSLTMinSize = (int) $aStyleConfig[30]; $nSLTOkSize = (int) $aStyleConfig[31]; $nSYWZFlag = (int) $aStyleConfig[32]; $sSYText = $aStyleConfig[33]; $sSYFontColor = $aStyleConfig[34]; $nSYFontSize = (int) $aStyleConfig[35]; $sSYFontName = $aStyleConfig[36]; $sSYPicPath = $aStyleConfig[37]; $nSLTSYObject = (int) $aStyleConfig[38]; $sSLTSYExt = $aStyleConfig[39]; $nSYWZMinWidth = (int) $aStyleConfig[40]; $sSYShadowColor = $aStyleConfig[41]; $nSYShadowOffset = (int) $aStyleConfig[42]; $nSYWZMinHeight = (int) $aStyleConfig[46]; $nSYWZPosition = (int) $aStyleConfig[47]; $nSYWZTextWidth = (int) $aStyleConfig[48]; $nSYWZTextHeight = (int) $aStyleConfig[49]; $nSYWZPaddingH = (int) $aStyleConfig[50]; $nSYWZPaddingV = (int) $aStyleConfig[51]; $nSYTPFlag = (int) $aStyleConfig[52]; $nSYTPMinWidth = (int) $aStyleConfig[53]; $nSYTPMinHeight = (int) $aStyleConfig[54]; $nSYTPPosition = (int) $aStyleConfig[55]; $nSYTPPaddingH = (int) $aStyleConfig[56]; $nSYTPPaddingV = (int) $aStyleConfig[57]; $nSYTPImageWidth = (int) $aStyleConfig[58]; $nSYTPImageHeight = (int) $aStyleConfig[59]; $nSYTPOpacity = (double) $aStyleConfig[60]; $sSpaceSize = $aStyleConfig[78]; $sMFUMode = $aStyleConfig[79]; $sFileNameMode = $aStyleConfig[68]; $sFileNameSameFix = $aStyleConfig[87]; $sAutoDirOrderFlag = $aStyleConfig[88]; $sSYValidNormal = $aStyleConfig[99]; $sSYValidLocal = $aStyleConfig[100]; $sSYValidRemote = $aStyleConfig[101]; if (($GLOBALS["sAction"] == "SAVE" || $GLOBALS["sAction"] == "MFU") && $sSYValidNormal != "1" || $GLOBALS["sAction"] == "LOCAL" && $sSYValidLocal != "1" || $GLOBALS["sAction"] == "REMOTE" && $sSYValidRemote != "1") { $nSYWZFlag = 0; $nSYTPFlag = 0; } if ($nSYWZFlag == 2) { if ($sParamSYFlag == "1") { $nSYWZFlag = 1; } else { $nSYWZFlag = 0; } } if ($nSYTPFlag == 2) { if ($sParamSYFlag == "1") { $nSYTPFlag = 1; } else { $nSYTPFlag = 0; } } if (!IsInt($sParamRnd)) { $sParamRnd = ""; } if ($sCusDir != "") { $sCusDir = str_replace("\\", "/", $sCusDir); if (substr($sCusDir, 0, 1) == "/" || substr($sCusDir, 0, 1) == "." || substr($sCusDir, -1) == "." || strpos($sCusDir, "./") !== false || strpos($sCusDir, "/.") !== false || strpos($sCusDir, "//") !== false || strpos($sCusDir, "..") !== false) { $sCusDir = ""; } else { if (substr($sCusDir, -1) != "/") { $sCusDir = $sCusDir . "/"; } } } }