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 () => { it('checking extensionArray', async () => {
expect(await utils.extensionArray('a, b, php_c, php-d')).toEqual([ expect(
'a', await utils.extensionArray('a, :b, php_c, php-d, Zend e, :Zend f')
'b', ).toEqual(['a', ':b', 'c', 'd', 'e', ':f']);
'c',
'd'
]);
expect(await utils.extensionArray('')).toEqual([]); expect(await utils.extensionArray('')).toEqual([]);
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 return extension
.trim() .trim()
.toLowerCase() .toLowerCase()
.replace(/^php[-_]/, ''); .replace(/^(:)?(php[-_]|zend )/, '$1');
}) })
.filter(Boolean); .filter(Boolean);
} }

View File

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