Kaynağa Gözat

Fix Transmission Connection Failure when using special characters in the password (#1623)

CauseFX 5 yıl önce
ebeveyn
işleme
5f96139c97
1 değiştirilmiş dosya ile 2 ekleme ve 2 silme
  1. 2 2
      api/homepage/transmission.php

+ 2 - 2
api/homepage/transmission.php

@@ -111,7 +111,7 @@ trait TransmissionHomepageItem
 			return false;
 		}
 		$digest = $this->qualifyURL($this->config['transmissionURL'], true);
-		$passwordInclude = ($this->config['transmissionUsername'] != '' && $this->config['transmissionPassword'] != '') ? $this->config['transmissionUsername'] . ':' . $this->decrypt($this->config['transmissionPassword']) . "@" : '';
+		$passwordInclude = ($this->config['transmissionUsername'] != '' && $this->config['transmissionPassword'] != '') ? $this->config['transmissionUsername'] . ':' . rawurlencode($this->decrypt($this->config['transmissionPassword'])) . "@" : '';
 		$url = $digest['scheme'] . '://' . $passwordInclude . $digest['host'] . $digest['port'] . $digest['path'] . '/rpc';
 		try {
 			$options = $this->requestOptions($this->config['transmissionURL'], $this->config['transmissionDisableCertCheck'], $this->config['homepageDownloadRefresh']);
@@ -199,7 +199,7 @@ trait TransmissionHomepageItem
 			return false;
 		}
 		$digest = $this->qualifyURL($this->config['transmissionURL'], true);
-		$passwordInclude = ($this->config['transmissionUsername'] != '' && $this->config['transmissionPassword'] != '') ? $this->config['transmissionUsername'] . ':' . $this->decrypt($this->config['transmissionPassword']) . "@" : '';
+		$passwordInclude = ($this->config['transmissionUsername'] != '' && $this->config['transmissionPassword'] != '') ? $this->config['transmissionUsername'] . ':' . rawurlencode($this->decrypt($this->config['transmissionPassword'])) . "@" : '';
 		$url = $digest['scheme'] . '://' . $passwordInclude . $digest['host'] . $digest['port'] . $digest['path'] . '/rpc';
 		try {
 			$options = $this->requestOptions($this->config['transmissionURL'], $this->config['transmissionDisableCertCheck'], $this->config['homepageDownloadRefresh']);