diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-04-19 12:19:39 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-04-22 08:38:41 +0200 |
commit | d0030aad6cb108bbf4ca729d0e11f3438145aba9 (patch) | |
tree | b67c516648a5aaced4598e889c93f85db3adb957 /lib | |
parent | ded84bf571dd51798904823405f673e16ca5eff4 (diff) | |
download | nextcloud-server-d0030aad6cb108bbf4ca729d0e11f3438145aba9.tar.gz nextcloud-server-d0030aad6cb108bbf4ca729d0e11f3438145aba9.zip |
Remove deprecated HTTPHelper from InfoParser
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/App/InfoParser.php | 34 | ||||
-rw-r--r-- | lib/private/app.php | 2 |
2 files changed, 23 insertions, 13 deletions
diff --git a/lib/private/App/InfoParser.php b/lib/private/App/InfoParser.php index c33e5349f3b..1616bf6a02b 100644 --- a/lib/private/App/InfoParser.php +++ b/lib/private/App/InfoParser.php @@ -27,22 +27,14 @@ namespace OC\App; use OCP\IURLGenerator; class InfoParser { - /** - * @var \OC\HTTPHelper - */ - private $httpHelper; - /** - * @var IURLGenerator - */ + /** @var IURLGenerator */ private $urlGenerator; /** - * @param \OC\HTTPHelper $httpHelper * @param IURLGenerator $urlGenerator */ - public function __construct(\OC\HTTPHelper $httpHelper, IURLGenerator $urlGenerator) { - $this->httpHelper = $httpHelper; + public function __construct(IURLGenerator $urlGenerator) { $this->urlGenerator = $urlGenerator; } @@ -79,12 +71,21 @@ class InfoParser { if (!array_key_exists('types', $array)) { $array['types'] = array(); } + if (!array_key_exists('repair-steps', $array)) { + $array['repair-steps'] = array(); + } + if (!array_key_exists('pre-migration', $array['repair-steps'])) { + $array['repair-steps']['pre-migration'] = array(); + } + if (!array_key_exists('post-migration', $array['repair-steps'])) { + $array['repair-steps']['post-migration'] = array(); + } if (array_key_exists('documentation', $array) && is_array($array['documentation'])) { foreach ($array['documentation'] as $key => $url) { // If it is not an absolute URL we assume it is a key // i.e. admin-ldap will get converted to go.php?to=admin-ldap - if (!$this->httpHelper->isHTTPURL($url)) { + if (!$this->isHTTPURL($url)) { $url = $this->urlGenerator->linkToDocs($url); } @@ -103,7 +104,12 @@ class InfoParser { $array['types'] = array(); } } - + if (isset($array['repair-steps']['pre-migration']['step']) && is_array($array['repair-steps']['pre-migration']['step'])) { + $array['repair-steps']['pre-migration'] = $array['repair-steps']['pre-migration']['step']; + } + if (isset($array['repair-steps']['post-migration']['step']) && is_array($array['repair-steps']['post-migration']['step'])) { + $array['repair-steps']['post-migration'] = $array['repair-steps']['post-migration']['step']; + } return $array; } @@ -161,4 +167,8 @@ class InfoParser { return $array; } + + private function isHTTPURL($url) { + return stripos($url, 'https://') === 0 || stripos($url, 'http://') === 0; + } } diff --git a/lib/private/app.php b/lib/private/app.php index 8a8b97d2cd4..cf0ccbb2272 100644 --- a/lib/private/app.php +++ b/lib/private/app.php @@ -626,7 +626,7 @@ class OC_App { $file = $appPath . '/appinfo/info.xml'; } - $parser = new \OC\App\InfoParser(\OC::$server->getHTTPHelper(), \OC::$server->getURLGenerator()); + $parser = new \OC\App\InfoParser(\OC::$server->getURLGenerator()); $data = $parser->parse($file); if (is_array($data)) { |