Permalink
Browse files

Fix login form regex and a crash

  • Loading branch information...
1 parent 89da6c1 commit 9033dbcf641c9d86fbbdbc6531b1cf0fe0e0f3af @war1025 committed Sep 1, 2012
Showing with 11 additions and 1 deletion.
  1. +11 −1 feed.vala
View
12 feed.vala
@@ -58,7 +58,7 @@ namespace GmailFeed {
/**
* Regexes used to parse login
**/
- private static Regex form = /(?m)<form\s+id="gaia_loginform" action="([^"]+)"(?s).*<\/form>/;
+ private static Regex form = /(?m)<form novalidate\s+id="gaia_loginform" action="([^"]+)"(?s).*<\/form>/;
private static Regex inputx = /(?m)<input[^<>]+>/;
private static Regex namex = /(?m)name="([^"]+)"/;
private static Regex valx = /(?m)value=['"]([^'"]*)['"]/;
@@ -154,6 +154,16 @@ namespace GmailFeed {
var gaiaform = info.fetch(0);
var action = info.fetch(1);
+ if(gaiaform == null) {
+ if(numRetries == 0) {
+ handle_error(message.status_code);
+ return false;
+ } else {
+ login(ad, numRetries -1);
+ return gmail_at != "";
+ }
+ }
+
inputx.match(gaiaform, 0, out info);
try {

0 comments on commit 9033dbc

Please sign in to comment.