Browse code

Fixed filtering with newtorrents.php dltorrent.php authentication behavior slightly changed batch_upload.php reverted

Clarissa Walker authored on 2015/09/14 08:55:30
Showing 3 changed files
... ...
@@ -118,7 +118,7 @@ if (isset($_FILES["zipfile"]) && $_FILES["zipfile"]["error"] != 4 && isset($_FIL
118 118
 					$filename = stripslashes($filename);
119 119
 					$filename = clean($filename);
120 120
 				
121
-					if ((strlen(htmlentities($_GET['hash'], ENT_QUOTES, UTF-8)) != 40) || !verifyHash($hash))
121
+					if (strlen($hash) != 40) || !verifyHash($hash))
122 122
 					{
123 123
 						echo errorMessage() . "Error: Info hash must be exactly 40 hex bytes.</p>\n";
124 124
 						$error_status = false;
... ...
@@ -7,7 +7,7 @@ session_start();
7 7
 if (!$_SESSION['admin_logged_in'] && !$_SESSION['upload_logged_in'])
8 8
 {
9 9
 	//check fails
10
-	header("Location: authenticate.php?status=session");
10
+	header("Location: authenticate.php?status=error");
11 11
 	exit();
12 12
 }
13 13
 
... ...
@@ -36,7 +36,7 @@ function addTorrent()
36 36
 	require ("config.php");
37 37
 	$tracker_url = $announce_url0 OR $announce_url1 OR $announce_url2 OR $announce_url3 OR $announce_url4;
38 38
 	
39
-	$hash = strtolower($_POST["hash"]);
39
+	$hash = strtolower(htmlentities($_POST["hash"], ENT_QUOTES, "UTF-8"));
40 40
 
41 41
 	$db = mysql_connect($dbhost, $dbuser, $dbpass) or die(errorMessage() . "Couldn't connect to the database, contact the administrator</p>");
42 42
 	mysql_select_db($database) or die(errorMessage() . "Can't open the database.</p>");
... ...
@@ -184,7 +184,7 @@ function addTorrent()
184 184
 	$filename = htmlspecialchars(clean($filename));
185 185
 	$url = htmlspecialchars(mysql_real_escape_string($url));
186 186
 
187
-	if ((strlen(htmlentities($_GET['hash'], ENT_QUOTES, UTF-8)) != 40) || !verifyHash($hash))
187
+	if ((strlen($hash) != 40) || !verifyHash($hash))
188 188
 	{
189 189
 		echo errorMessage() . "Error: Info hash must be exactly 40 hex bytes.</p>\n";
190 190
 		endOutput();