private function hasValidExtension($filename)
    {
        // Current extension
        $extension = mb_strtolower(pathinfo($filename, \PATHINFO_EXTENSION), 'UTF-8');

        // Make sure all extensions are in lowercase
        foreach ($this->extensions as &$expected) {
            $expected = mb_strtolower($expected, 'UTF-8');
        }

        return in_array($extension, $this->extensions);
	}