Merge branch '1.10'
commit
92ef439666
|
@ -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], '"\' '));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue