diff options
author | adam <adam@> | 2021-02-13 22:25:06 +0200 |
---|---|---|
committer | adam <adam@> | 2021-02-13 22:25:06 +0200 |
commit | 5c4f408cada9b60ab1b65335879378c43cfdca21 (patch) | |
tree | e418b3c1646e5993535b5a10d4cbcf9d2bf34ec5 /php | |
parent | b55b1021a2b0cb53b2f18622207f659dcfb8ba77 (diff) | |
download | fileup-5c4f408cada9b60ab1b65335879378c43cfdca21.tar.gz |
text files are kinda shared
Diffstat (limited to 'php')
-rw-r--r-- | php/database.php | 1 | ||||
-rw-r--r-- | php/node.php | 4 | ||||
-rw-r--r-- | php/share.php | 6 |
3 files changed, 6 insertions, 5 deletions
diff --git a/php/database.php b/php/database.php index b95b2a6..42ff7c1 100644 --- a/php/database.php +++ b/php/database.php @@ -477,6 +477,7 @@ require_once "node.php"; } $nod=$prep->fetch(PDO::FETCH_ASSOC); $ret=new Node(); + $ret->node_id=$nod["node_id"]; $ret->is_directory=$nod["is_directory"]; $ret->relative_path=$nod["relative_path"]; diff --git a/php/node.php b/php/node.php index e0f7ceb..666d540 100644 --- a/php/node.php +++ b/php/node.php @@ -98,10 +98,10 @@ require_once "user.php"; } if($use_https) { - return "https://".$domain_name."/share?file=".$code; + return "https://".$domain_name."/php/share.php?file=".$code; }else { - return "http://".$domain_name."/share?file=".$code; + return "http://".$domain_name."/php/share.php?file=".$code; } } diff --git a/php/share.php b/php/share.php index 28d00f8..c56f19e 100644 --- a/php/share.php +++ b/php/share.php @@ -45,7 +45,7 @@ if($_SERVER["REQUEST_METHOD"] == "POST") exit(0); }else if($_SERVER["REQUEST_METHOD"]== "GET") { - $code=$_GET["code"]; + $code=$_GET["file"]; $file_id=$database->get_node_with_code($code); if($file_id==NULL) { @@ -63,8 +63,8 @@ if($_SERVER["REQUEST_METHOD"] == "POST") exit(1); }else { - header("Content-type: $node[type]"); - readfile("$storage_root/$node[code]"); + header("Content-type: $node->type"); + readfile("$storage_root/$node->code"); } } |