Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fix login form regex and a crash

  • Loading branch information...
commit 9033dbcf641c9d86fbbdbc6531b1cf0fe0e0f3af 1 parent 89da6c1
Wayne Rowcliffe authored September 01, 2012

Showing 1 changed file with 11 additions and 1 deletion. Show diff stats Hide diff stats

  1. 12  feed.vala
12  feed.vala
@@ -58,7 +58,7 @@ namespace GmailFeed {
58 58
 		/**
59 59
 		 * Regexes used to parse login
60 60
 		 **/
61  
-		private static Regex form = /(?m)<form\s+id="gaia_loginform" action="([^"]+)"(?s).*<\/form>/;
  61
+		private static Regex form = /(?m)<form novalidate\s+id="gaia_loginform" action="([^"]+)"(?s).*<\/form>/;
62 62
 		private static Regex inputx = /(?m)<input[^<>]+>/;
63 63
 		private static Regex namex = /(?m)name="([^"]+)"/;
64 64
 		private static Regex valx = /(?m)value=['"]([^'"]*)['"]/;
@@ -154,6 +154,16 @@ namespace GmailFeed {
154 154
 			var gaiaform = info.fetch(0);
155 155
 			var action = info.fetch(1);
156 156
 
  157
+			if(gaiaform == null) {
  158
+				if(numRetries == 0) {
  159
+					handle_error(message.status_code);
  160
+					return false;
  161
+				} else {
  162
+					login(ad, numRetries -1);
  163
+					return gmail_at != "";
  164
+				}
  165
+			}
  166
+
157 167
 			inputx.match(gaiaform, 0, out info);
158 168
 
159 169
 			try {

0 notes on commit 9033dbc

Please sign in to comment.
Something went wrong with that request. Please try again.