[opencms-dev] Chinese task name create error!
acmyoulq
acmyoulq at 21cn.com
Fri May 9 05:38:02 CEST 2003
Hello,opencms-dev:
Description:
When use "Create new Task" , and input a chinese "任务一", the unicode is "任务一",when I submit the form, an error found , and it was said "invaild task name".
Error code:
file:
CmsResourceBroker.java
methord:
protected void validTaskname( String taskname )
code:
for (int i=0; i<l; i++) {
char c = taskname.charAt(i);
if (
((c < '?') || (c > '?')) &&
((c < '?') || (c > '?')) &&
((c < 'a') || (c > 'z')) &&
((c < '0') || (c > '9')) &&
((c < 'A') || (c > 'Z')) &&
(c != '-') && (c != '.') &&
(c != '_') && (c != '~') &&
(c != ' ') && (c != '?') &&
(c != '/') && (c != '(') && (c != ')') && (c != '\'')
) {
throw new CmsException("[" + this.getClass().getName() + "] " + taskname,
CmsException.C_BAD_NAME);
}
}
I have change these code and it works now. The code is below:
for (int i=0; i<l; i++) {
char c = taskname.charAt(i);
if (
((c < '?') || (c > '?')) &&
((c < '?') || (c > '?')) &&
((c < 'a') || (c > 'z')) &&
((c < '0') || (c > '9')) &&
((c < 'A') || (c > 'Z')) &&
(c != '-') && (c != '.') &&
(c != '_') && (c != '~') &&
(c != ' ') && (c != '?') &&
(c != '/') && (c != '(') && (c != ')') && (c != '\'')
&& (c != '#')&& (c != '&')&& (c != ';')
) {
throw new CmsException("[" + this.getClass().getName() + "] " + taskname,
CmsException.C_BAD_NAME);
}
}
Thank you!
acmyoulq
acmyoulq at 21cn.com
2003-05-09
More information about the opencms-dev
mailing list