mirror of
https://github.com/MasterAcnolo/Freedom-Loader.git
synced 2026-07-29 18:25:47 +02:00
22 lines
426 B
JavaScript
22 lines
426 B
JavaScript
const path = require("path");
|
|
|
|
function isValidUrl(url) {
|
|
try {
|
|
new URL(url);
|
|
return true;
|
|
|
|
} catch {
|
|
return false;
|
|
}
|
|
|
|
}
|
|
|
|
function isSafePath(folder) {
|
|
if (!folder || folder.length < 3) return false;
|
|
const unsafe = ["System32", "\\Windows"];
|
|
const resolved = path.resolve(folder);
|
|
return !unsafe.some(u => resolved.includes(u));
|
|
}
|
|
|
|
module.exports = { isValidUrl, isSafePath };
|