1
0
Fork 0

Merge branch '1.10'

pull/9050/head
Jordi Boggiano 2020-07-07 21:12:27 +02:00
commit 92ef439666
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 6 additions and 7 deletions

View File

@ -214,20 +214,19 @@ class GitHubDriver extends VcsDriver
$result = array(); $result = array();
$key = null; $key = null;
foreach (preg_split('{\r?\n}', $funding) as $line) { foreach (preg_split('{\r?\n}', $funding) as $line) {
$line = preg_replace('{#.*}', '', $line);
$line = trim($line); $line = trim($line);
if (preg_match('{^(\w+)\s*:\s*(.+)$}', $line, $match)) { if (preg_match('{^(\w+)\s*:\s*(.+)$}', $line, $match)) {
if (preg_match('{^\[.*\]$}', $match[2])) { if (preg_match('{^\[(.*)\](?:\s*#.*)?$}', $match[2], $match2)) {
foreach (array_map('trim', preg_split('{[\'"]?\s*,\s*[\'"]?}', substr($match[2], 1, -1))) as $item) { foreach (array_map('trim', preg_split('{[\'"]?\s*,\s*[\'"]?}', $match2[1])) as $item) {
$result[] = array('type' => $match[1], 'url' => trim($item, '"\' ')); $result[] = array('type' => $match[1], 'url' => trim($item, '"\' '));
} }
} else { } elseif (preg_match('{^([^#].*?)(\s+#.*)?$}', $match[2], $match2)) {
$result[] = array('type' => $match[1], 'url' => trim($match[2], '"\' ')); $result[] = array('type' => $match[1], 'url' => trim($match2[1], '"\' '));
} }
$key = null; $key = null;
} elseif (preg_match('{^(\w+)\s*:$}', $line, $match)) { } elseif (preg_match('{^(\w+)\s*:\s*#\s*$}', $line, $match)) {
$key = $match[1]; $key = $match[1];
} elseif ($key && preg_match('{^-\s*(.+)$}', $line, $match)) { } elseif ($key && preg_match('{^-\s*(.+)(\s+#.*)?$}', $line, $match)) {
$result[] = array('type' => $key, 'url' => trim($match[1], '"\' ')); $result[] = array('type' => $key, 'url' => trim($match[1], '"\' '));
} }
} }