diff options
| author | Sean Fridman <fridman@mail.sfsu.edu> | 2015-04-21 12:12:46 -0400 |
|---|---|---|
| committer | Sean Fridman <fridman@mail.sfsu.edu> | 2015-04-21 12:12:46 -0400 |
| commit | 8d24ad2a810f7cf32ef1ef2337a9d1db9d98e8da (patch) | |
| tree | 4354b0e5af20c6b001a7223fce76e0527fc608d5 /themes/okadmin/public/js/app.js | |
| parent | 43063c3242ccaf95e39fff240d501de38131f7c5 (diff) | |
Strip newlines before POSTing
Diffstat (limited to 'themes/okadmin/public/js/app.js')
| -rw-r--r-- | themes/okadmin/public/js/app.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/themes/okadmin/public/js/app.js b/themes/okadmin/public/js/app.js index e981223..4a0f8e3 100644 --- a/themes/okadmin/public/js/app.js +++ b/themes/okadmin/public/js/app.js @@ -94,6 +94,17 @@ var OKAdmin = function(){ $id.val( slug ) } + // Strip newlines + // TODO This is a hack. Remove when server sanitizes + // input correctly + $(this).find('input, textarea').each(function(i, el) { + var $el = $(el); + var val = $el.val(); + if (val) { + $el.val(val.replace(/[\r\t\n]/g, '')); + } + }); + $(".image-element").each(function(index){ $(this).find("input,textarea").each(function(){ var field = $(this).attr("name").replace(/\[[0-9]*\]/, "[" + index + "]") |
