Skip to main content

GF_Download

Handles download requests for files stored by File Upload fields.

Class GF_Download

Source: includes/class-gf-download.php:8

Details

  • Kind: class
  • Namespace: (global)

Methods

MethodDescription
maybe_process()If the request is for a Gravity Forms file download then validate and deliver.
validate_file_path()Validates a file path from a download request for security concerns.

Method Reference

maybe_process()

public static function maybe_process()

If the request is for a Gravity Forms file download then validate and deliver.

Since: 2.0

Source: includes/class-gf-download.php:15

validate_file_path()

public static function validate_file_path( $file )

Validates a file path from a download request for security concerns.

Checks for null bytes and directory traversal characters (including encoded variants).

Parameters

NameTypeDefaultDescription
$filestringThe file path to validate.

Returns

  • true | WP_Error — True if the file path is safe, WP_Error otherwise.

Since: 2.10.2

Source: includes/class-gf-download.php:254