Skip to content

Commit 7ad6867

Browse files
Merge pull request #942 from Codeinwp/bugfix/940
Fix temp file creation issue on instawp
2 parents 20a5898 + 0fb27dc commit 7ad6867

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

classes/Visualizer/Module.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,9 @@ private function _getCSV( $rows, $filename, $enclose ) {
270270

271271
$bom = chr( 0xEF ) . chr( 0xBB ) . chr( 0xBF );
272272
$fp = tmpfile();
273+
if ( null === $fp ) {
274+
$fp = fopen( wp_tempnam(), 'w+' );
275+
}
273276
if ( ! apply_filters( 'vizualizer_export_include_series_type', true ) ) {
274277
unset( $rows[1] );
275278
$rows = array_values( $rows );

0 commit comments

Comments
 (0)