mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-12-25 18:00:12 +01:00
workaround for weird mime name encoding by evolution
This commit is contained in:
parent
31d801da6f
commit
6930fe66a8
@ -453,7 +453,7 @@ class ModelSearchMessage extends Model {
|
||||
|
||||
$attachment = $this->get_attachment($query->row['piler_id'], $query->row['attachment_id']);
|
||||
|
||||
return array('filename' => $query->row['name'], 'piler_id' => $query->row['piler_id'], 'attachment' => $attachment);
|
||||
return array('filename' => fix_evolution_mime_name_crap($query->row['name']), 'piler_id' => $query->row['piler_id'], 'attachment' => $attachment);
|
||||
}
|
||||
}
|
||||
|
||||
@ -471,6 +471,7 @@ class ModelSearchMessage extends Model {
|
||||
if(!isset($query->rows)) { return array(); }
|
||||
|
||||
foreach($query->rows as $q) {
|
||||
$q['name'] = fix_evolution_mime_name_crap($q['name']);
|
||||
array_push($data, $q);
|
||||
}
|
||||
|
||||
|
@ -474,4 +474,14 @@ function convert_days_ymd($convert) {
|
||||
}
|
||||
|
||||
|
||||
function fix_evolution_mime_name_crap($s = '') {
|
||||
if(preg_match("/iso\-\d{1,4}\-\d{1,}\'\'/i", $s)) {
|
||||
$s = preg_replace("/iso\-\d{1,4}\-\d{1,}\'\'/i", "", $s);
|
||||
$s = utf8_encode(urldecode($s));
|
||||
}
|
||||
|
||||
return $s;
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
Loading…
Reference in New Issue
Block a user