Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion classes/Visualizer/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,15 @@ private function _getCSV( $rows, $filename, $enclose ) {
$bom = chr( 0xEF ) . chr( 0xBB ) . chr( 0xBF );
// phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
$fp = function_exists( 'tmpfile' ) ? @tmpfile() : null;
if ( null === $fp ) {
if ( ! $fp ) {
if ( ! function_exists( 'wp_tempnam' ) ) {
require_once ABSPATH . 'wp-admin/includes/file.php';
}
$fp = fopen( wp_tempnam(), 'w+' );
}
if ( ! $fp ) {
return array( 'csv' => '', 'name' => $filename, 'string' => '' );
Comment thread
HardeepAsrani marked this conversation as resolved.
}
if ( ! apply_filters( 'vizualizer_export_include_series_type', true ) ) {
unset( $rows[1] );
$rows = array_values( $rows );
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"dealerdirect/phpcodesniffer-composer-installer": "^1.0.0",
"phpcompatibility/phpcompatibility-wp": "*",
"phpstan/phpstan": "^2.1",
"szepeviktor/phpstan-wordpress": "^2.0"
"szepeviktor/phpstan-wordpress": "^2.0",
"yoast/phpunit-polyfills": "^4.0"
}
}
Loading
Loading