* Description : Filter the block of data that's been read from the server.
* Caller is responsible for checking permissons list
* to determine if this function should be called.
- * FIXME: Should use the replacements proposed by Guy
*
* Parameters :
* 1 : buff = Buffer to scan and modify. Null terminated.
char *popup = NULL;
char *close = NULL;
char *p = NULL;
- char *q = NULL; /* by BREITENB NEW! */
while ((popup = strstr( buff, "window.open(" )) != NULL)
{
#ifdef POPUP_VERBOSE
fprintf(logfp, "Found end of window open" );
#endif
- for ( p = popup; p != (close+1); p++ )
+ p = popup;
+ *p++ = '1';
+ for ( ; p != (close+1); p++ )
{
*p = ' ';
}
#ifdef POPUP_VERBOSE
fprintf(logfp, "Couldn't find end, turned into comment. Read boundary?\n" );
#endif
+ *popup++ = '1';
+ *popup++ = ';';
+ *popup++ = '/';
*popup = '/';
- popup++;
- *popup = '/';
- }
-
-
- q=popup; /* by BREITENB NEW! */
- while (q>=buff)
- {
- if (*q==' ' || *q=='\t')
- q--;
- else break;
- }
- if (q>=buff)
- {
- if (*q=='=') *++q='1';
- /* result of popup is assigned to a variable! ensure success. hehehe. */
+ /*
+ * result of popup is assigned to variable and the rest commented out
+ * window.open(blah
+ * will be translated to
+ * 1;//ow.open(blah
+ * and
+ * myWindow = window.open(blah
+ * will be translated to
+ * myWindow = 1;//ow.open(blah
+ */
}
}