Let filemanager/vfs handle escaping characters instead of just stripping them out

This commit is contained in:
Nathan Gray 2015-03-18 16:20:11 +00:00
parent 18442ff3e5
commit 97efc7808c
2 changed files with 8 additions and 3 deletions

View File

@ -168,6 +168,11 @@ class filemanager_select
case 'select-dir': case 'select-dir':
$files = $content['path']; $files = $content['path'];
break; break;
case 'saveas':
// Don't trust the name the user gives, encode it
$content['name'] = egw_vfs::encodePathComponent($content['name']);
// Fall through
default: default:
$files = egw_vfs::concat($content['path'],$content['name']); $files = egw_vfs::concat($content['path'],$content['name']);

View File

@ -2579,7 +2579,7 @@ app.classes.mail = AppJS.extend(
url += 'menuaction=filemanager.filemanager_select.select'; // todo compose for Draft folder url += 'menuaction=filemanager.filemanager_select.select'; // todo compose for Draft folder
url += '&mode=saveas'; url += '&mode=saveas';
var subject = dataElem? dataElem.data.subject: _elems[0].subject; var subject = dataElem? dataElem.data.subject: _elems[0].subject;
var filename = subject.replace(/[\f\n\t\v/\\:*#?<>\|]/g,"_")|| 'unknown'; var filename = subject.replace(/[\f\n\t\v]/g,"_")|| 'unknown';
url += '&name='+encodeURIComponent(filename+'.eml'); url += '&name='+encodeURIComponent(filename+'.eml');
url += '&mime=message'+encodeURIComponent('/')+'rfc822'; url += '&mime=message'+encodeURIComponent('/')+'rfc822';
url += '&method=mail.mail_ui.vfsSaveMessage'; url += '&method=mail.mail_ui.vfsSaveMessage';
@ -3508,7 +3508,7 @@ app.classes.mail = AppJS.extend(
'acc_id': acc_id, 'acc_id': acc_id,
'ajax': 'true' 'ajax': 'true'
}); });
// an ugly hack for idots to show up sieve rules not in an iframe // an ugly hack for idots to show up sieve rules not in an iframe
// but as new link, better to remove it after get rid of idots template // but as new link, better to remove it after get rid of idots template
if (typeof window.framework == 'undefined') if (typeof window.framework == 'undefined')
@ -3739,7 +3739,7 @@ app.classes.mail = AppJS.extend(
// ckeditor may causes performance regression, especially on devices with // ckeditor may causes performance regression, especially on devices with
// very limited resources and slow proccessor. // very limited resources and slow proccessor.
if (egwIsMobile()) return; if (egwIsMobile()) return;
var bodyH = egw_getWindowInnerHeight(); var bodyH = egw_getWindowInnerHeight();
var textArea = this.et2.getWidgetById('mail_plaintext'); var textArea = this.et2.getWidgetById('mail_plaintext');
var $headerSec = jQuery('.mailComposeHeaderSection'); var $headerSec = jQuery('.mailComposeHeaderSection');