A Bash function function foo { ... } inherits its caller\'s shell options like (for instance) -f or extglob. What if
function foo { ... }
-f
extglob