Written by danielgoldak. Last updated on December 11, 2023. Make sure $files is an array to prevent a notice from being displayed.