Bug: Undefined variable: csv_output/file in exported CSV
-
With
define('WP_DEBUG', true);
inwp-config.php
some errors can be observed in exported CSV file. Also the file has an incomplete name e.g._2013-06-26_12-50.csv
:Notice: Undefined variable: csv_output in /../wp-content/plugins/wp-email-capture/inc/exportcsv.php on line 15
Notice: Undefined variable: file in /../wp-content/plugins/wp-email-capture/inc/exportcsv.php on line 37
Name,E-Mail
[…]Reason, variables are not yet defined before use.
Wrong:
$csv_output .= __('Name','WPEC').",".__('Email','WPEC'); [...] $filename = $file."_".date("Y-m-d_H-i",time());
Suggested fixes:
$csv_output = __('Name','WPEC').",".__('Email','WPEC'); [...] $file = 'WP_Email_Capture'; $filename = $file."_".date("Y-m-d_H-i",time());
Edit: Won’t start an own thread for this, a similar error is e.g. in file
inc/display.php
in line 52 where$display .= "<div..
should be$display = "<div..
, it is shown if the shortcode is used.
- The topic ‘Bug: Undefined variable: csv_output/file in exported CSV’ is closed to new replies.