Menu

#195 Instant preview plus sign fix

Patches
open
nobody
None
5
2014-08-15
2011-06-11
Jason Hood
No

Due to the manner in which the instant preview is generated, plus signs are turned into spaces. Here is a simple patch to correct that.

diff -ur xoops-2.5.1a.orig/htdocs/include/formdhtmltextarea.js xoops-2.5.1a/htdocs/include/formdhtmltextarea.js
--- xoops-2.5.1a.orig/htdocs/include/formdhtmltextarea.js Fri Sep 10 22:07:36 2010
+++ xoops-2.5.1a/htdocs/include/formdhtmltextarea.js Sat Jun 11 16:25:56 2011
@@ -473,7 +473,7 @@
function form_instantPreview(xoopsUrl, area_id, imgurl, doHtml)
{
var imgUrl = xoopsUrl + '/images/form';
- var data = escape(xoopsGetElementById(area_id).value);
+ var data = escape(xoopsGetElementById(area_id).value).replace(/+/g, '%2B');

 var url_request = xoopsUrl + "/include/formdhtmltextarea_preview.php";//?text=" + data;
 var args =  "text=" + data;

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.