Skip to content

Commit

Permalink
fix(admin-cache): verify empty cache key
Browse files Browse the repository at this point in the history
  • Loading branch information
ravinderk committed May 14, 2018
1 parent fe14bd3 commit 5c33680
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion includes/class-give-cache.php
Expand Up @@ -201,7 +201,9 @@ public static function get_key( $action, $query_args = null, $is_prefix = true )
*/
public static function get( $cache_key, $custom_key = false, $query_args = array() ) {
if ( ! self::is_valid_cache_key( $cache_key ) ) {
if ( ! $custom_key ) {
if( empty( $cache_key ) ) {
return new WP_Error( 'give_empty_cache_key', __( 'Do not pass invalid empty cache key', 'give' ) );
}elseif ( ! $custom_key ) {
return new WP_Error( 'give_invalid_cache_key', __( 'Cache key format should be give_cache_*', 'give' ) );
}

Expand Down

0 comments on commit 5c33680

Please sign in to comment.