Skip to content
Snippets Groups Projects
Commit a0dfa5e4 authored by deuce's avatar deuce
Browse files

Replace all illegal newsgroup name characters (per RFC3977) with '_' in

newsgroup property.

Note that any exascii is also illegal, but I don't feel like doing the
UTF-8 conversion thing today.  Also, you can manually stick in illegal
characters if you like... but then it's a feature, not a bug.
parent 0fab8e19
No related branches found
No related tags found
No related merge requests found
......@@ -155,9 +155,24 @@ BOOL DLLCALL js_CreateMsgAreaProperties(JSContext* cx, scfg_t* cfg, JSObject* su
SAFECOPY(str,sub->newsgroup);
else {
sprintf(str,"%s.%s",cfg->grp[sub->grp]->sname,sub->sname);
for(c=0;str[c];c++)
if(str[c]==' ')
str[c]='_';
for(c=0;str[c];c++) {
if (str[c] >= 0 && str[c] < 0x22)
str[c] = '_';
switch(str[c]) {
// Illegal chars:
case '*':
case ',':
case '?':
case '[':
case '\\':
case ']':
case 0x7f:
str[c]='_';
break;
default:
break;
}
}
}
if((js_str=JS_NewStringCopyZ(cx, str))==NULL)
return(FALSE);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment