Fix `PHP Notice: Undefined variable: filetype`