Index: lams_common/src/java/org/lamsfoundation/lams/util/ValidationUtil.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/util/ValidationUtil.java,v diff -u -r1.5.2.5 -r1.5.2.6 --- lams_common/src/java/org/lamsfoundation/lams/util/ValidationUtil.java 30 Nov 2016 01:52:17 -0000 1.5.2.5 +++ lams_common/src/java/org/lamsfoundation/lams/util/ValidationUtil.java 16 Feb 2017 03:57:34 -0000 1.5.2.6 @@ -218,9 +218,14 @@ text = text.replaceAll("(?:
)", " "); } - int wordCount = (text.length() == 0) ? 0 - : text.replaceAll("[\'\";:,\\.\\?\\-!]+", "").trim().split("\\S+").length;//.match(/\S+/g) || []) ; - + int wordCount = 0; + if ( text.length() > 0) { + wordCount = text.replaceAll("[\'\";:,\\.\\?\\-!]+", "").trim().split("\\S+").length;//.match(/\S+/g) || []) ; + // special case - if only one word and no spaces then the split array is empty. + if ( wordCount == 0 ) + wordCount = 1; + } + // check min words limit is reached return (wordCount >= minWordsLimit); }