causefx 7 лет назад
Родитель
Сommit
efa68a5980
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      api/functions/homepage-connect-functions.php

+ 2 - 1
api/functions/homepage-connect-functions.php

@@ -2155,7 +2155,8 @@ function testAPIConnection($array)
 				try {
 					$digest = qualifyURL($GLOBALS['rTorrentURL'], true);
 					$passwordInclude = ($GLOBALS['rTorrentUsername'] != '' && $GLOBALS['rTorrentPassword'] != '') ? $GLOBALS['rTorrentUsername'] . ':' . decrypt($GLOBALS['rTorrentPassword']) . "@" : '';
-					$url = $digest['scheme'] . '://' . $passwordInclude . $digest['host'] . $digest['port'] . $digest['path'] . '/RPC2';
+					$extraPath = (strpos($GLOBALS['rTorrentURL'], '.php') !== false) ? '' : '/RPC2';
+					$url = $digest['scheme'] . '://' . $passwordInclude . $digest['host'] . $digest['port'] . $digest['path'] . $extraPath;
 					$options = (localURL($url)) ? array('verify' => false) : array();
 					$data = xmlrpc_encode_request("system.listMethods", null);
 					$response = Requests::post($url, array(), $data, $options);