Page MenuHomestyx hydra

No OneTemporary

diff --git a/src/infrastructure/export/format/PhabricatorTextExportFormat.php b/src/infrastructure/export/format/PhabricatorTextExportFormat.php
index d51e199f91..eada8cac94 100644
--- a/src/infrastructure/export/format/PhabricatorTextExportFormat.php
+++ b/src/infrastructure/export/format/PhabricatorTextExportFormat.php
@@ -1,55 +1,57 @@
<?php
final class PhabricatorTextExportFormat
extends PhabricatorExportFormat {
const EXPORTKEY = 'text';
private $rows = array();
public function getExportFormatName() {
return 'Tab-Separated Text (.txt)';
}
public function isExportFormatEnabled() {
return true;
}
public function getFileExtension() {
return 'txt';
}
public function getMIMEContentType() {
return 'text/plain';
}
public function addHeaders(array $fields) {
$headers = mpull($fields, 'getLabel');
$this->addRow($headers);
}
public function addObject($object, array $fields, array $map) {
$values = array();
foreach ($fields as $key => $field) {
$value = $map[$key];
$value = $field->getTextValue($value);
$values[] = $value;
}
$this->addRow($values);
}
private function addRow(array $values) {
$row = array();
foreach ($values as $value) {
- $row[] = addcslashes($value, "\0..\37\\\177..\377");
+ if (phutil_nonempty_string($value)) {
+ $row[] = addcslashes($value, "\0..\37\\\177..\377");
+ }
}
$this->rows[] = implode("\t", $row);
}
public function newFileData() {
return implode("\n", $this->rows)."\n";
}
}

File Metadata

Mime Type
text/x-diff
Expires
Mon, Nov 25, 3:40 AM (1 d, 17 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1165
Default Alt Text
(1 KB)

Event Timeline