diff options
author | Sean Molenaar <SMillerDev@users.noreply.github.com> | 2019-03-17 08:23:37 +0100 |
---|---|---|
committer | Benjamin Brahmer <info@b-brahmer.de> | 2019-03-17 08:23:37 +0100 |
commit | 2698214c4122d4f5f63f26f7a204035fe0d4f211 (patch) | |
tree | e1a033654736cc68f698af7110e8e17fdb0c2e55 /lib/Utility/ProxyConfigParser.php | |
parent | f5e25d2edef3360ed7fcdc1ecc663cfb37b650b7 (diff) |
fix/allow CDATA encoding (#428)
Diffstat (limited to 'lib/Utility/ProxyConfigParser.php')
-rw-r--r-- | lib/Utility/ProxyConfigParser.php | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/lib/Utility/ProxyConfigParser.php b/lib/Utility/ProxyConfigParser.php deleted file mode 100644 index dc9bd3d8b..000000000 --- a/lib/Utility/ProxyConfigParser.php +++ /dev/null @@ -1,66 +0,0 @@ -<?php -/** - * Nextcloud - News - * - * This file is licensed under the Affero General Public License version 3 or - * later. See the COPYING file. - * - * @author Alessandro Cosentino <cosenal@gmail.com> - * @author Bernhard Posselt <dev@bernhard-posselt.com> - * @copyright 2012 Alessandro Cosentino - * @copyright 2012-2014 Bernhard Posselt - */ - - -namespace OCA\News\Utility; - -use \OCP\IConfig; - -class ProxyConfigParser -{ - - private $config; - - public function __construct(IConfig $config) - { - $this->config = $config; - } - - - /** - * Parses the config and splits up the port + url - * - * @return array - */ - public function parse() - { - $proxy = $this->config->getSystemValue('proxy'); - $userpasswd = $this->config->getSystemValue('proxyuserpwd'); - - $result = [ - 'host' => null, - 'port' => null, - 'user' => null, - 'password' => null - ]; - - // we need to filter out the port -.- - $url = new \Net_URL2($proxy); - $port = $url->getPort(); - - $url->setPort(false); - $host = $url->getUrl(); - - - $result['host'] = $host; - $result['port'] = $port; - - if ($userpasswd) { - $auth = explode(':', $userpasswd, 2); - $result['user'] = $auth[0]; - $result['password'] = $auth[1]; - } - - return $result; - } -} |