Add support for quoted csv in ini-values

This commit is contained in:
Shivam Mathur
2021-01-15 13:52:18 +05:30
parent d2f58713aa
commit 6972aed899
3 changed files with 24 additions and 9 deletions

View File

@ -228,8 +228,7 @@ export async function extensionArray(
return extension
.trim()
.toLowerCase()
.replace('php-', '')
.replace('php_', '');
.replace(/^php[-_]/, '');
})
.filter(Boolean);
}
@ -248,9 +247,12 @@ export async function CSVArray(values_csv: string): Promise<Array<string>> {
return [];
default:
return values_csv
.split(',')
.map(function (value: string) {
return value.trim();
.split(/,(?=(?:(?:[^"']*["']){2})*[^"']*$)/)
.map(function (value) {
return value
.trim()
.replace(/^["']|["']$|(?<==)["']/g, '')
.replace(/=(.*[?{}|&~![()^]+.*)/, "='$1'");
})
.filter(Boolean);
}