Strip backslash line continuation from extension inputs
This commit is contained in:
parent
44724c9282
commit
106fd0866c
3 changed files with 6 additions and 2 deletions
|
|
@ -85,6 +85,10 @@ describe('Utils tests', () => {
|
|||
|
||||
expect(await utils.extensionArray('')).toEqual([]);
|
||||
expect(await utils.extensionArray(' ')).toEqual([]);
|
||||
|
||||
expect(
|
||||
await utils.extensionArray('apcu, mbstring, \\ pdo_pgsql, posix, session')
|
||||
).toEqual(['apcu', 'mbstring', 'pdo_pgsql', 'posix', 'session']);
|
||||
});
|
||||
|
||||
it('checking INIArray', async () => {
|
||||
|
|
|
|||
2
dist/index.js
vendored
2
dist/index.js
vendored
File diff suppressed because one or more lines are too long
|
|
@ -224,11 +224,11 @@ export async function extensionArray(
|
|||
.split(',')
|
||||
|
||||
.map(function (extension: string) {
|
||||
extension = extension.trim().replace(/^\\\s*/, '');
|
||||
if (/.+-.+\/.+@.+/.test(extension)) {
|
||||
return extension;
|
||||
}
|
||||
return extension
|
||||
.trim()
|
||||
.toLowerCase()
|
||||
.replace(/^(:)?(php[-_]|none|zend )|(-[^-]*)-/, '$1$3');
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue