From 4409ecebd164a5f63b314913eb6c025c642fce1e Mon Sep 17 00:00:00 2001 From: nikitozzzzzzz Date: Thu, 18 Oct 2018 10:09:29 +0300 Subject: [PATCH] - fixed small notice; - fixed issue with download files with opened PHP buffers; --- includes/core/class-files.php | 12 ++++++++++++ includes/core/class-gdpr.php | 5 ++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/includes/core/class-files.php b/includes/core/class-files.php index 6d01a50c..81cbe18a 100644 --- a/includes/core/class-files.php +++ b/includes/core/class-files.php @@ -183,6 +183,12 @@ if ( ! class_exists( 'um\core\Files' ) ) { header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); header('Content-Length: ' . $size); + + $levels = ob_get_level(); + for ( $i = 0; $i < $levels; $i++ ) { + @ob_end_clean(); + } + readfile( $file_path ); exit; } @@ -217,6 +223,12 @@ if ( ! class_exists( 'um\core\Files' ) ) { header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); header('Content-Length: ' . $size); + + $levels = ob_get_level(); + for ( $i = 0; $i < $levels; $i++ ) { + @ob_end_clean(); + } + readfile( $file_path ); exit; } diff --git a/includes/core/class-gdpr.php b/includes/core/class-gdpr.php index 82ec76e7..3b48c326 100644 --- a/includes/core/class-gdpr.php +++ b/includes/core/class-gdpr.php @@ -70,10 +70,9 @@ if ( ! class_exists( 'um\core\GDPR' ) ) { * @return mixed */ function email_registration_data( $submitted ) { - - $timestamp = ! empty( $submitted['timestamp'] ) ? $submitted['timestamp'] : $submitted['use_gdpr_agreement']; - if ( ! empty( $submitted['use_gdpr_agreement'] ) ) { + $timestamp = ! empty( $submitted['timestamp'] ) ? $submitted['timestamp'] : $submitted['use_gdpr_agreement']; + $submitted['GDPR Applied'] = date( "d M Y H:i", $timestamp ); unset( $submitted['use_gdpr_agreement'] ); }