From a9a0cc1c04c2e6f2b3adad2f111d55847f77cc92 Mon Sep 17 00:00:00 2001
From: s-ko <aleks@s-ko.net>
Date: Wed, 15 Oct 2014 21:37:27 +0100
Subject: [PATCH] Manual URL and debug setting

---
 index.php | 19 +++++--------------
 1 file changed, 5 insertions(+), 14 deletions(-)

diff --git a/index.php b/index.php
index b94b8fb..9e0208b 100644
--- a/index.php
+++ b/index.php
@@ -46,7 +46,10 @@
 		random_name_alphabet => 'qazwsxedcrfvtgbyhnujmikolp1234567890',
 
 		// Display debugging information
-		debug => ($_SERVER['SERVER_NAME'] === 'localhost')
+		debug => false,
+
+		// Complete URL to your directory (including tracing slash)
+		url => 'http://strace.club/',
 
 	);
 
@@ -57,9 +60,6 @@
 	// Name of this file
 	$data['scriptname'] = pathinfo(__FILE__, PATHINFO_BASENAME);
 
-	// URL to upload page
-	$data['pageurl'] = "http" . (($_SERVER['SERVER_PORT']==443) ? "s://" : "://") . $_SERVER['SERVER_NAME'] . dirname($_SERVER['REQUEST_URI']) . '/';
-
 	// Use canonized path
 	$data['uploaddir'] = realpath($settings['uploaddir']);
 
@@ -147,19 +147,10 @@
 			return;
 		}
 
-
-		echo '<pre>';
-		print_r($data);
-		echo '</pre>';
-
-
 		if (move_uploaded_file($data['tmp_name'], $data['upload_target_file'])) {
 			if ($settings['allow_deletion'])
 				$_SESSION['upload_user_files'][] = $data['target_file_name'];
-			echo $data['pageurl'] .  $data['upload_target_file'] . "\n";
-			// echo 'File: <b>' . $data['uploaded_file_name'] . '</b> successfully uploaded:<br />';
-			// echo 'Size: <b>'. number_format($_FILES['file']['size'] / 1024, 3, '.', '') .'KB</b><br />';
-			// echo 'File /URL: <b><a href="http://'.$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['REQUEST_URI']), '\\/').'/'.$data['upload_target_file'].'">http://'.$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['REQUEST_URI']), '\\/').'/'.$data['upload_target_file'].'</a></b>';
+			echo $settings['url'] .  $data['target_file_name'] . "\n";
 		} else {
 			echo 'Error: unable to upload the file.';
 		}
-- 
2.39.5