From: Joseph Lewis Date: Tue, 24 Jul 2012 16:58:40 +0000 (-0600) Subject: Replaced the Trim regex in Util.js so it passes unittesting. X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=b35efaffa56ca6fc7aac702f14ce13e34562f410;p=evergreen%2Fjoelewis.git Replaced the Trim regex in Util.js so it passes unittesting. Signed-off-by: Joseph Lewis --- diff --git a/Open-ILS/web/js/dojo/openils/Util.js b/Open-ILS/web/js/dojo/openils/Util.js index 5745fad574..feae75e99a 100644 --- a/Open-ILS/web/js/dojo/openils/Util.js +++ b/Open-ILS/web/js/dojo/openils/Util.js @@ -292,7 +292,7 @@ if(!dojo._hasResource["openils.Util"]) { * Convenience function to trim leading and trailing whitespace at once. */ openils.Util.trimString = function(s) { - return s.replace(/^\s*(.+)?\s*$/,"$1"); + return s.replace(/^\s+|\s+$/g,""); } /**