Trimming PHPSESSID from query as temp solution.
This commit is contained in:
parent
84fcd61e9c
commit
7cc572b78d
@ -1,10 +1,17 @@
|
||||
var pathNodes = []; // Path parts Could store a cookie to keep sessions
|
||||
var pathNodes = [];
|
||||
|
||||
function getDirSSE() {
|
||||
var path = "";
|
||||
|
||||
// Create path from array of items
|
||||
for (pathNode of pathNodes) { path += pathNode; }
|
||||
|
||||
// For some reason, PHPSESSID= gets inserted when in sub dir.
|
||||
// temp work arround is to trim it.
|
||||
if (path.includes("PHPSESSID=")) {
|
||||
path = path.split("; ").pop();
|
||||
}
|
||||
|
||||
path = "dirQuery=" + path;
|
||||
process(path);
|
||||
}
|
||||
@ -35,10 +42,20 @@ function getDir(query) {
|
||||
} else { pathNodes.push(query); } // Add path
|
||||
|
||||
// Create path from array of items
|
||||
for (pathNode of pathNodes) { path += pathNode; }
|
||||
// for (pathNode of pathNodes) { path += pathNode; console.log(pathNode); }
|
||||
for (var i = 0; i < pathNodes.length; i++) {
|
||||
path += pathNodes[i];
|
||||
}
|
||||
|
||||
// For some reason, PHPSESSID= gets inserted when in sub dir.
|
||||
// temp work arround is to trim it.
|
||||
if (path.includes("PHPSESSID=")) {
|
||||
path = path.split("; ").pop();
|
||||
}
|
||||
|
||||
formULPTH.value = path; // Used when uploading a file
|
||||
path = "dirQuery=" + path;
|
||||
console.log("Path : " + path);
|
||||
process(path);
|
||||
}
|
||||
|
||||
|
@ -3,16 +3,16 @@
|
||||
session_start();
|
||||
|
||||
// Retrieve data
|
||||
function dirListing($PATH) {
|
||||
if (is_dir($PATH)) {
|
||||
function dirListing($NEWPATH) {
|
||||
if (is_dir($NEWPATH)) {
|
||||
$GeneratedXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><DIR_LIST>"
|
||||
. "<PATH_HEAD>" . $PATH . "</PATH_HEAD>";
|
||||
. "<PATH_HEAD>" . $NEWPATH . "</PATH_HEAD>";
|
||||
|
||||
$dirContents = scandir($PATH);
|
||||
$dirContents = scandir($NEWPATH);
|
||||
foreach ($dirContents as $fileName) {
|
||||
$fullPath = $PATH . $fileName;
|
||||
$fullPath = $NEWPATH . $fileName;
|
||||
|
||||
if (is_dir($PATH . $fileName)) {
|
||||
if (is_dir($NEWPATH . $fileName)) {
|
||||
$GeneratedXML .= "<DIR>" . $fileName . "/</DIR>";
|
||||
} elseif (preg_match('/^.*\.(mkv|avi|flv|mov|m4v|mpg|wmv|mpeg|mp4|webm)$/i', strtolower($fileName))) {
|
||||
$NAMEHASH = hash('sha256', $fileName);
|
||||
|
Loading…
Reference in New Issue
Block a user