Bugfixes
* do not iterate over the end of an array in check_next_element * include openSUSE 15.2 as valid product * fix packages list files path
This commit is contained in:
parent
4fe6d771cc
commit
d4d03287d6
@ -26,7 +26,7 @@ function exception_error_handler($severity, $message, $file, $line) {
|
|||||||
set_error_handler("exception_error_handler");
|
set_error_handler("exception_error_handler");
|
||||||
|
|
||||||
function get_packages_list($product) {
|
function get_packages_list($product) {
|
||||||
$packages_file = __DIR__ . "packages/" . $product;
|
$packages_file = __DIR__ . "/packages/" . $product;
|
||||||
try {
|
try {
|
||||||
$packages = file($packages_file, FILE_IGNORE_NEW_LINES);
|
$packages = file($packages_file, FILE_IGNORE_NEW_LINES);
|
||||||
} catch (ErrorException $e) {
|
} catch (ErrorException $e) {
|
||||||
@ -51,7 +51,10 @@ function find_substring($substrings, $string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function check_next_element($substrings, $string, $index, $match) {
|
function check_next_element($substrings, $string, $index, $match) {
|
||||||
if (stripos($string, $substrings[$index + 1]) === 0)
|
if ($index >= count($substrings) - 1)
|
||||||
|
return $match;
|
||||||
|
|
||||||
|
elseif (stripos($string, $substrings[$index + 1]) === 0)
|
||||||
return check_next_element($substrings, $string, $index + 1, $substrings[$index + 1]);
|
return check_next_element($substrings, $string, $index + 1, $substrings[$index + 1]);
|
||||||
|
|
||||||
elseif (stripos($substrings[$index + 1], $match) === 0 &&
|
elseif (stripos($substrings[$index + 1], $match) === 0 &&
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
const PRODUCT_PATTERN = '/^(10\.[2-3]|11\.[0-4]|12\.[1-3]|13\.[1-2]|42\.[1-3]|15\.[0-1]|tumbleweed)$/';
|
const PRODUCT_PATTERN = '/^(10\.[2-3]|11\.[0-4]|12\.[1-3]|13\.[1-2]|42\.[1-3]|15\.[0-2]|tumbleweed)$/';
|
||||||
|
|
||||||
function product_filter($product)
|
function product_filter($product)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user