public static function valid_ext($fn) { $_ext = strtolower(self::get_ext($fn)); $ext = self::check_ext($_ext, 0) ? $_ext : 'file'; if (self::$forceExt !== false) { (empty($_ext) || strlen($_ext) > 4 || $ext == 'file') && ($ext = self::$forceExt); return $ext; } if (!self::$validext) { return $ext; } $ext_array = explode(',', strtolower(self::$config['allow_ext'])); if (in_array($_ext, $ext_array)) { return $ext; } else { self::$ERROR = self::_error(array('code' => 0, 'state' => 'TYPE')); return false; } }