Trim the summary before we count the words on it

This commit is contained in:
james 2011-03-07 16:47:33 +00:00
parent 2fd5ab6a47
commit d6ac7e36f5

View File

@ -325,7 +325,7 @@ function countwords()
echo "<tr><td>".i18n("Summary").": </td><td><textarea onchange='countwords()' onkeypress='countwords()' cols=\"60\" rows=\"12\" id=\"summary\" name=\"summary\">".htmlspecialchars($projectinfo->summary)."</textarea>".REQUIREDFIELD."<br />";
$summarywords=preg_split("/[\s,]+/",$projectinfo->summary);
$summarywords=preg_split("/[\s,]+/",trim($projectinfo->summary));
$summarywordcount=count($summarywords);
if($summarywordcount>$config['participant_project_summary_wordmax'])
echo "<div id=\"wordcountmessage\" class=\"incomplete\">";