1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/11150] Add comments + ignore invaid repositories URLs

PHPBB3-11150
This commit is contained in:
Tristan Darricau
2017-04-06 20:14:46 +02:00
parent fbf11d61aa
commit d59b26dcec
4 changed files with 26 additions and 5 deletions

View File

@@ -599,10 +599,13 @@ class installer
foreach ($this->repositories as $repository)
{
$repositories[] = [
'type' => 'composer',
'url' => $repository,
];
if (preg_match('#^' . get_preg_expression('url') . '$#iu', $repository))
{
$repositories[] = [
'type' => 'composer',
'url' => $repository,
];
}
}
return $repositories;

View File

@@ -291,6 +291,18 @@ class manager implements manager_interface
return $this->installer->check_requirements();
}
/**
* Normalize a packages/version array. Every entry can have 3 different forms:
* - $package => $version
* - $indice => $package:$version
* - $indice => $package
* They are converted to he form:
* - $package => $version ($version is set to '*' for the third form)
*
* @param array $packages
*
* @return array
*/
protected function normalize_version(array $packages)
{
$normalized_packages = [];