Fix parsing extensions input if Zend OPcache is specified instead of opcache

This commit is contained in:
Shivam Mathur 2021-08-25 20:09:50 +05:30
parent c8837583fc
commit 8e80635955
No known key found for this signature in database
GPG Key ID: 3E13E4C8591ACC2A
3 changed files with 5 additions and 8 deletions

View File

@ -126,12 +126,9 @@ describe('Utils tests', () => {
});
it('checking extensionArray', async () => {
expect(await utils.extensionArray('a, b, php_c, php-d')).toEqual([
'a',
'b',
'c',
'd'
]);
expect(
await utils.extensionArray('a, :b, php_c, php-d, Zend e, :Zend f')
).toEqual(['a', ':b', 'c', 'd', 'e', ':f']);
expect(await utils.extensionArray('')).toEqual([]);
expect(await utils.extensionArray(' ')).toEqual([]);

2
dist/index.js vendored
View File

@ -1050,7 +1050,7 @@ async function extensionArray(extension_csv) {
return extension
.trim()
.toLowerCase()
.replace(/^php[-_]/, '');
.replace(/^(:)?(php[-_]|zend )/, '$1');
})
.filter(Boolean);
}

View File

@ -289,7 +289,7 @@ export async function extensionArray(
return extension
.trim()
.toLowerCase()
.replace(/^php[-_]/, '');
.replace(/^(:)?(php[-_]|zend )/, '$1');
})
.filter(Boolean);
}