diff --git a/__tests__/utils.test.ts b/__tests__/utils.test.ts index 47374be0..21178c9d 100644 --- a/__tests__/utils.test.ts +++ b/__tests__/utils.test.ts @@ -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([]); diff --git a/dist/index.js b/dist/index.js index 777c92f3..ee3457b1 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1050,7 +1050,7 @@ async function extensionArray(extension_csv) { return extension .trim() .toLowerCase() - .replace(/^php[-_]/, ''); + .replace(/^(:)?(php[-_]|zend )/, '$1'); }) .filter(Boolean); } diff --git a/src/utils.ts b/src/utils.ts index 2f47cb81..9ca471a5 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -289,7 +289,7 @@ export async function extensionArray( return extension .trim() .toLowerCase() - .replace(/^php[-_]/, ''); + .replace(/^(:)?(php[-_]|zend )/, '$1'); }) .filter(Boolean); }