Index: src/input.php
===================================================================
--- src/input.php	(revision aeda99629124019deeb4433aaf24f71f3ee6a39c)
+++ src/input.php	(revision 9e9c159bd6f1fd908db220a50832aae4f8010b29)
@@ -277,10 +277,10 @@
 				header( "location: {$config["index"]}?mod=addtorrent" );
 				exit;
-			} elseif ( substr( $_REQUEST["torrenturl"], 0, 7 ) != "http://" ) {
+			} elseif ( ( substr( $_REQUEST["torrenturl"], 0, 7 ) != "http://" ) && ( substr( $_REQUEST["torrenturl"], 0, 8 ) != "https://" ) && ( substr( $_REQUEST["torrenturl"], 0, 8 ) != "magnet:?" ) ) {
 				$_SESSION["rtwi_err"] = "notanurl";
 				header( "location: {$config["index"]}?mod=addtorrent" );
 				exit;
 			}
-			$torrent = $_REQUEST["torrenturl"];
+			$torrent = str_replace("&", "&amp;", $_REQUEST["torrenturl"]);
 		} else {
 			if ( !isset( $_FILES ) || !is_array( $_FILES ) ) {
@@ -357,7 +357,7 @@
 		$dlpath = myrealpath( "{$directory}/{$dlpath}", $config["home_path"], $cwd );
 
-		$param = array( $torrent );
+		$param = array( "", $torrent );
 		if ( $dlpath != "" ) {
-			$param[] = "d.set_directory={$dlpath}";
+			$param[] = "d.directory.set={$dlpath}";
 		}
 
