Projekt

Allgemein

Profil

GX-Bug #49399 » fix.patch

Fix - Alexandros Tselegidis, 28.11.2016 16:05

Unterschiede anzeigen:

src/admin/javascript/engine/controllers/emails/emails_toolbar.js (revision )
84 84
		// EVENT HANDLERS
85 85
		// ------------------------------------------------------------------------
86 86
		
87
		/**
88
		 * Convert the line breaks to <br> elements. 
89
		 * 
90
		 * @param {string} text Text to be converted.
91
		 * 
92
		 * @return {string} Returns the converted string.
93
		 */
94
		var _nl2br = function(text) {
95
			return (text + '').replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1' + '<br>' + '$2');
96
		};
97
		
87 98
		/**
88 99
		 * Display create new email modal.
89 100
		 *
......
99 110
				// if the signature contains HTML markup it cannot be sanitized properly for the plain content.
100 111
				if (module.model.settings.signature !== null && module.model.settings.signature !== '') {
101 112
					var signatureHtml = '<br><p>-----<br>' 
102
						+ module.model.settings.signature.replace('\n/g', '<br>') + '</p>';
113
						+ _nl2br(module.model.settings.signature) + '</p>';
103 114
					CKEDITOR.instances['content-html'].setData(signatureHtml);
104 115
					var signaturePlain = '\n\n-----\n' + module.model.settings.signature.replace(/(<([^>]+)>)/gi,
105 116
							'');
    (1-1/1)