File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
WordPressLoginFlow/src/main
java/org/wordpress/android/login Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 1010import android .text .Editable ;
1111import android .text .TextUtils ;
1212import android .text .TextWatcher ;
13+ import android .util .Patterns ;
1314import android .view .View ;
1415import android .view .View .OnClickListener ;
1516import android .view .ViewGroup ;
@@ -146,12 +147,19 @@ protected void discover() {
146147 return ;
147148 }
148149
149- if (TextUtils .isEmpty (mSiteAddressInput .getEditText ().getText ())) {
150+ String cleanedSiteAddress = getCleanedSiteAddress ();
151+
152+ if (TextUtils .isEmpty (cleanedSiteAddress )) {
150153 showError (R .string .login_empty_site_url );
151154 return ;
152155 }
153156
154- mRequestedSiteAddress = getCleanedSiteAddress ();
157+ if (!Patterns .WEB_URL .matcher (cleanedSiteAddress ).matches ()) {
158+ showError (R .string .login_invalid_site_url );
159+ return ;
160+ }
161+
162+ mRequestedSiteAddress = cleanedSiteAddress ;
155163
156164 String cleanedXmlrpcSuffix = UrlUtils .removeXmlrpcSuffix (mRequestedSiteAddress );
157165 mDispatcher .dispatch (SiteActionBuilder .newFetchWpcomSiteByUrlAction (cleanedXmlrpcSuffix ));
Original file line number Diff line number Diff line change 5050 <string name =" login_log_in_for_deeplink" >Log in to WordPress.com to access the post.</string >
5151 <string name =" login_log_in_for_share_intent" >Log in to WordPress.com to share the content.</string >
5252 <string name =" login_empty_site_url" >Please enter a site address</string >
53+ <string name =" login_invalid_site_url" >The site address you entered is invalid. Please re-enter it.</string >
5354 <string name =" login_empty_username" >Please enter a username</string >
5455 <string name =" login_empty_password" >Please enter a password</string >
5556 <string name =" login_empty_2fa" >Please enter a verification code</string >
8990 <string name =" logging_in" >Logging in</string >
9091 <string name =" forgot_password" >Lost your password?</string >
9192 <string name =" error_generic" >An error occurred</string >
92- <string name =" no_site_error" >Couldn\'t connect to the WordPress site. There is no valid WordPress site at this
93- address. Check the site address (URL) you entered.</string >
93+ <string name =" no_site_error" >The site at this address is not a WordPress site. For us to connect to it, the site must use WordPress.</string >
9494 <string name =" invalid_site_url_message" >Check that the site URL entered is valid</string >
9595 <string name =" xmlrpc_missing_method_error" >Couldn\'t connect. Required XML-RPC methods are missing on the server.</string >
9696 <string name =" xmlrpc_post_blocked_error" >Couldn\'t connect. Your host is blocking POST requests, and the app needs
You can’t perform that action at this time.
0 commit comments