mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-27 07:34:20 +00:00
Fix for bugzilla 104124: User agent string allows blank spaces input
(r=tao)
This commit is contained in:
parent
d449c7f61a
commit
be9e636034
@ -785,23 +785,36 @@ BOOL CInterpret::interpret(CString cmds, WIDGET *curWidget)
|
||||
else if (strcmp(pcmd, "VerifySet") == 0)
|
||||
{
|
||||
// VerifySet checks to see if the first parameter has any value
|
||||
// If (p1) then continue else show error dialog and return FALSE
|
||||
|
||||
char *p2 = strchr(parms, ',');
|
||||
|
||||
if (p2)
|
||||
*p2++ = '\0';
|
||||
else
|
||||
p2 = "A message belongs here.";
|
||||
|
||||
int i=0;
|
||||
char *token[3];
|
||||
token[i] = strtok(parms, ",");
|
||||
while ((token[i] != NULL) && (i<2))
|
||||
{
|
||||
i++;
|
||||
token[i]=strtok(NULL, ",");
|
||||
}
|
||||
|
||||
CString value = replaceVars(parms, NULL);
|
||||
|
||||
if (!value || value.IsEmpty())
|
||||
{
|
||||
CWnd myWnd;
|
||||
myWnd.MessageBox(p2, "Error", MB_OK|MB_SYSTEMMODAL);
|
||||
myWnd.MessageBox(token[1], "Error", MB_OK|MB_SYSTEMMODAL);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Check if the user agent string contains spaces
|
||||
if (token[2])
|
||||
{
|
||||
if (value.Find(' ') != -1)
|
||||
{
|
||||
CWnd myWnd;
|
||||
myWnd.MessageBox(token[2], "Error", MB_OK|MB_SYSTEMMODAL);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else if (strcmp(pcmd, "CopyFile") == 0)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user