fs_request_is_action_secure

The NextGEN Gallery fs request is action secure function.

Description

fs_request_is_action_secure( (string) $action, (string) $action_key = 'action', (string) $nonce_key = 'nonce' ); 

Parameters (3)

0. $action (string)
The action.
1. $action_key — Optional. (string) => 'action'
The action key.
2. $nonce_key — Optional. (string) => 'nonce'
The nonce key.

Usage

  1. if ( !function_exists( 'fs_request_is_action_secure' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'nextgen-gallery/freemius/includes/fs-core-functions.php'; 
  3.  
  4. // The action. 
  5. $action = ''; 
  6.  
  7. // The action key. 
  8. $action_key = 'action'; 
  9.  
  10. // The nonce key. 
  11. $nonce_key = 'nonce'; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = fs_request_is_action_secure($action, $action_key, $nonce_key); 
  15.  

Defined (1)

The function is defined in the following location(s).

/freemius/includes/fs-core-functions.php  
  1. function fs_request_is_action_secure( 
  2. $action,  
  3. $action_key = 'action',  
  4. $nonce_key = 'nonce' 
  5. ) { 
  6. if ( strtolower( $action ) !== fs_get_action( $action_key ) ) { 
  7. return false; 
  8.  
  9. $nonce = ! empty( $_REQUEST[ $nonce_key ] ) ? 
  10. $_REQUEST[ $nonce_key ] : 
  11. ''; 
  12.  
  13. if ( empty( $nonce ) || 
  14. ( false === wp_verify_nonce( $nonce, $action ) ) 
  15. ) { 
  16. return false; 
  17.  
  18. return true;