Fix for bugscape bug 13112: Restrict user agent string to ASCII characters

only (r=smeredith)
This commit is contained in:
shrutiv%netscape.com 2002-05-28 23:41:56 +00:00
Родитель 45e6367d56
Коммит b300ef9cb1
2 изменённых файлов: 27 добавлений и 1 удалений

Просмотреть файл

@ -27,7 +27,7 @@ Help=Online;%Root%CCKHelp\info.html
[Navigation Controls]
onNext=VerifySet(%OrganizationName%,User Agent String is required to proceed with custom build creation,User Agent String should not contain spaces);
onNext=VerifySet(%OrganizationName%,User Agent String is required to proceed with custom build creation,User Agent String should not contain spaces);IsNonAscii(%OrganizationName%,User Agent String should contain only ascii characters)
Help=InfoHelp.ini

Просмотреть файл

@ -886,6 +886,32 @@ BOOL CInterpret::interpret(CString cmds, WIDGET *curWidget)
}
}
else if (strcmp(pcmd, "IsNonAscii") == 0)
{
// check if user agent string contains non-ascii characters
char *message = strchr(parms, ',');
if (message)
{
*message = '\0';
message++;
}
else
AfxMessageBox("A message belongs here", MB_OK);
CString value = replaceVars(parms, NULL);
char *userAgent = (char *)(LPCTSTR)value;
while (*userAgent != '\0')
{
if ((__isascii(*userAgent)) == 0)
{
CWnd myWnd;
myWnd.MessageBox(message, "Error", MB_OK|MB_SYSTEMMODAL);
return FALSE;
}
else
userAgent++;
}
}
else if (strcmp(pcmd, "ValidateRemoteAdmin") == 0)
{
// if checkbox is set, then there must be a URL.