@@ -175,13 +175,13 @@ discard block |
||
| 175 | 175 | $is_writeable = $is_dir && is_writeable( $this->export_dir ); |
| 176 | 176 | |
| 177 | 177 | if ( $is_dir && $is_writeable ) { |
| 178 | - return true; |
|
| 178 | + return true; |
|
| 179 | 179 | } else if ( $is_dir && !$is_writeable ) { |
| 180 | - if ( !$this->wp_filesystem->chmod( $this->export_dir, FS_CHMOD_DIR ) ) { |
|
| 181 | - return wp_sprintf( __( 'Filesystem ERROR: Export location %s is not writable, check your file permissions.', 'invoicing' ), $this->export_dir ); |
|
| 182 | - } |
|
| 180 | + if ( !$this->wp_filesystem->chmod( $this->export_dir, FS_CHMOD_DIR ) ) { |
|
| 181 | + return wp_sprintf( __( 'Filesystem ERROR: Export location %s is not writable, check your file permissions.', 'invoicing' ), $this->export_dir ); |
|
| 182 | + } |
|
| 183 | 183 | |
| 184 | - return true; |
|
| 184 | + return true; |
|
| 185 | 185 | } else { |
| 186 | 186 | if ( !$this->wp_filesystem->mkdir( $this->export_dir, FS_CHMOD_DIR ) ) { |
| 187 | 187 | return wp_sprintf( __( 'Filesystem ERROR: Could not create directory %s. This is usually due to inconsistent file permissions.', 'invoicing' ), $this->export_dir ); |
@@ -276,12 +276,12 @@ discard block |
||
| 276 | 276 | $output = fopen( 'php://output', 'w' ) or die( 'Unsupported server' ); |
| 277 | 277 | |
| 278 | 278 | // Let the browser know what content we're streaming and how it should save the content. |
| 279 | - $name = time(); |
|
| 280 | - header( "Content-Type:application/csv" ); |
|
| 279 | + $name = time(); |
|
| 280 | + header( "Content-Type:application/csv" ); |
|
| 281 | 281 | header( "Content-Disposition:attachment;filename=noptin-subscribers-$name.csv" ); |
| 282 | 282 | |
| 283 | 283 | // Output the csv column headers. |
| 284 | - fputcsv( |
|
| 284 | + fputcsv( |
|
| 285 | 285 | $output, |
| 286 | 286 | array( |
| 287 | 287 | __( 'Discount Id', 'invoicing' ), |