Browse Source

Rename paste repo/ to raw/

pull/4/head
falkTX 9 years ago
parent
commit
c80534113f
3 changed files with 10 additions and 8 deletions
  1. +4
    -2
      paste/download.php
  2. +6
    -6
      paste/index.php
  3. +0
    -0
      paste/raw/_error

+ 4
- 2
paste/download.php View File

@@ -1,6 +1,8 @@
<?php

if (file_exists("/var/www/kxstudio/paste/")) {
if (file_exists("/home/sites/kxstudio.linuxaudio.org/docroot/paste/")) {
$base_dir = "/home/sites/kxstudio.linuxaudio.org/docroot/paste/";
} else if (file_exists("/var/www/kxstudio/paste/")) {
$base_dir = "/var/www/kxstudio/paste/";
} else {
$base_dir = "/home/groups/k/kx/kxstudio/htdocs/paste/";
@@ -34,7 +36,7 @@ function downloadFile($fullPath) {

if (! empty($_GET["id"])) {
$paste_id = htmlspecialchars($_GET["id"]);
$paste_file = $base_dir . "repo/" . $paste_id;
$paste_file = $base_dir . "raw/" . $paste_id;

if (! file_exists($paste_file)) {
die("File does not exist");


+ 6
- 6
paste/index.php View File

@@ -21,13 +21,13 @@ if (! empty($_GET["id"]))
$paste_id = htmlspecialchars($_GET["id"]);
$show_paste = TRUE;

$paste_file = $base_dir . "repo/" . $paste_id;
$paste_file = $base_dir . "raw/" . $paste_id;

if (! file_exists($paste_file)) {
$is_error = TRUE;
}

$paste_info = $base_dir . "repo/" . $paste_id . ".inc";
$paste_info = $base_dir . "raw/" . $paste_id . ".inc";

// default values
$paste_name = "";
@@ -57,11 +57,11 @@ else if (! empty($_POST["paste_text"]))
}

$paste_id = substr(str_shuffle(str_repeat('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789',5)),0,5);
$paste_file = $base_dir . "repo/" . $paste_id;
$paste_file = $base_dir . "raw/" . $paste_id;

while (file_exists($paste_file)) {
$paste_id = substr(str_shuffle(str_repeat('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789',5)),0,5);
$paste_file = $base_dir . "repo/" . $paste_id;
$paste_file = $base_dir . "raw/" . $paste_id;
}

$fp = fopen($paste_file, 'w');
@@ -74,7 +74,7 @@ else if (! empty($_POST["paste_text"]))
$is_error = TRUE;
}

$paste_info = $base_dir . "repo/" . $paste_id . ".inc";
$paste_info = $base_dir . "raw/" . $paste_id . ".inc";

$paste_info_content = "<?php\n";
$paste_info_content .= "\$paste_name = \"$paste_name\";\n";
@@ -109,7 +109,7 @@ include_once("../includes/header.php");
<?php
if ($show_paste)
{
$file_path = $base_dir . "repo/" . $paste_id;
$file_path = $base_dir . "raw/" . $paste_id;

if (file_exists($file_path))
{


paste/repo/_error → paste/raw/_error View File


Loading…
Cancel
Save