/[winpt]/trunk/Src/wptCommonDlg.cpp
ViewVC logotype

Diff of /trunk/Src/wptCommonDlg.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 180 by twoaday, Wed Jan 18 11:52:45 2006 UTC revision 181 by twoaday, Tue Mar 14 11:01:22 2006 UTC
# Line 1  Line 1 
1  /* wptCommonDlg.cpp  /* wptCommonDlg.cpp
2   *      Copyright (C) 2004, 2005 Timo Schulz   *      Copyright (C) 2004, 2005, 2006 Timo Schulz
3   *   *
4   * This file is part of WinPT.   * This file is part of WinPT.
5   *   *
# Line 22  Line 22 
22  #endif  #endif
23    
24  #include <windows.h>  #include <windows.h>
25    #include <ctype.h>
26    
27  #include "resource.h"  #include "resource.h"
28    
# Line 37  Line 38 
38  static int  static int
39  check_URL (const char *buf)  check_URL (const char *buf)
40  {  {
41      /* XXX: be more strict */      size_t i;
42        const char *allowed = "-./#_:";
43    
44        if (strncmp (buf, "http://", 7))
45            return -1;
46      if (!strchr (buf, ':'))      if (!strchr (buf, ':'))
47          return -1;          return -1;
48      if (!strstr (buf, "//"))      if (!strstr (buf, "//"))
49          return -1;          return -1;
50        if (strstr (buf, " "))
51            return -1;
52        buf += 7;
53        for (i=0; i < strlen (buf); i++) {
54            if (isalpha (buf[i]) || isdigit (buf[i]))
55                continue;
56            if (!strchr (allowed, buf[i]))
57                return -1;
58        }
59    
60      return 0;      return 0;
61  }  }
62    
# Line 59  http_dlg_proc (HWND dlg, UINT msg, WPARA Line 74  http_dlg_proc (HWND dlg, UINT msg, WPARA
74              BUG (0);              BUG (0);
75          if (ctx->desc != NULL)          if (ctx->desc != NULL)
76              SetWindowText (dlg, ctx->desc);              SetWindowText (dlg, ctx->desc);
         else  
             SetWindowText (dlg, _("HTTP Key Import"));  
77          if (ctx->title != NULL)          if (ctx->title != NULL)
78              SetDlgItemText (dlg, IDC_HTTP_TITLE, ctx->title);              SetDlgItemText (dlg, IDC_HTTP_TITLE, ctx->title);
         else  
             SetDlgItemText (dlg, IDC_HTTP_TITLE, _("Enter URL to retrieve the public key"));  
79          SetDlgItemText (dlg, IDCANCEL, _("&Cancel"));          SetDlgItemText (dlg, IDCANCEL, _("&Cancel"));
80          SetForegroundWindow (dlg);          SetForegroundWindow (dlg);
81          break;          break;
# Line 103  get_http_file_dlg (HWND root) Line 114  get_http_file_dlg (HWND root)
114      if (!ctx)      if (!ctx)
115          BUG (0);          BUG (0);
116      memset (ctx, 0, sizeof *ctx);      memset (ctx, 0, sizeof *ctx);
117      ctx->check = 1;          ctx->check = 1;
118        ctx->desc = _("HTTP Key Import");
119        ctx->title = _("Enter URL to retrieve the public key");
120      DialogBoxParam (glob_hinst, (LPCTSTR)IDD_WINPT_HTTP, root,      DialogBoxParam (glob_hinst, (LPCTSTR)IDD_WINPT_HTTP, root,
121                      http_dlg_proc, (LPARAM)ctx);                      http_dlg_proc, (LPARAM)ctx);
122      return ctx;      return ctx;

Legend:
Removed from v.180  
changed lines
  Added in v.181

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26