Replaced the Trim regex in Util.js so it passes unittesting.
authorJoseph Lewis <joehms22@gmail.com>
Tue, 24 Jul 2012 16:58:40 +0000 (10:58 -0600)
committerJoseph Lewis <joehms22@gmail.com>
Tue, 24 Jul 2012 16:58:40 +0000 (10:58 -0600)
Signed-off-by: Joseph Lewis <joehms22@gmail.com>
Open-ILS/web/js/dojo/openils/Util.js

index 5745fad..feae75e 100644 (file)
@@ -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,"");
     }
 
     /**