Skip to content

Commit

Permalink
Strip control characters from file names when downloading all attachm…
Browse files Browse the repository at this point in the history
…ents as a zip file.
  • Loading branch information
yunosh committed Aug 1, 2017
1 parent 410af68 commit 78e551c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion imp/lib/Contents/View.php
Expand Up @@ -61,7 +61,9 @@ public function downloadAll()
$tosave = array();
foreach ($this->_contents->downloadAllList() as $val) {
$mime = $this->_getRawDownloadPart($val);
if (!($name = $mime->getName(true))) {
if ($name = $mime->getName(true)) {
$name = preg_replace('/[\x00-\x1f]+/', '', $name);
} else {
$name = sprintf(_("part %s"), $val);
}
$tosave[] = array(
Expand Down

0 comments on commit 78e551c

Please sign in to comment.