Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

Commit 8d85ee3

Browse files
authored
Merge pull request #239 from skyhit/max_length_checking_for_project_name_and_description
max length checking for project name and description
2 parents 721723e + 3f13084 commit 8d85ee3

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

services/project_service/src/java/main/com/topcoder/service/project/impl/ProjectServiceBean.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -1996,13 +1996,13 @@ private void checkProjectData(ProjectData projectData, boolean isCreate) throws
19961996
throw logException(new IllegalArgumentFault("The name attribute of the project data can not be null."));
19971997
} else if (name.trim().length() == 0) {
19981998
throw logException(new IllegalArgumentFault("The name attribute of the project data can not be empty."));
1999+
} else if (name.trim().length() > 200) {
2000+
throw logException(new IllegalArgumentFault("The name attribute of the project data cannot be more than 200 characters."));
19992001
}
20002002

20012003
String description = projectData.getDescription();
2002-
if (null == description) {
2003-
throw logException(new IllegalArgumentFault("The description attribute of the project data can not be null."));
2004-
} else if (description.trim().length() == 0) {
2005-
throw logException(new IllegalArgumentFault("The description attribute of the project data can not be empty."));
2004+
if (null != description && description.trim().length() > 10000) {
2005+
throw logException(new IllegalArgumentFault("The description attribute of the project data cann't be more than 10000 characters."));
20062006
}
20072007

20082008
//added in version 2.2

src/web/scripts/common.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,9 @@ $(document).ready(function() {
112112

113113
$("#swFileDescription, #fileDescription, #fileDescription2").bind('keydown keyup paste', limitFileDescriptionChars(200));
114114

115-
$("#newProjectDescription").bind('keydown keyup paste', limitFileDescriptionChars(2000));
115+
$("#newProjectDescription").bind('keydown keyup paste', limitFileDescriptionChars(10000));
116116
});
117117

118-
var invalidCharsRegExp = /[^a-zA-Z0-9\$!\(\)\[\]\'\"\-\.\,\/\+ ]+/mg;
119-
120118
var DEFAULT_TIMEZONE = "America/New_York";
121119

122120
/**

0 commit comments

Comments
 (0)