Permalink
Browse files

Add a trailing slash is more secure

  • Loading branch information...
1 parent af061bf commit 79d99dde1318fff1c602a713f54a638f895d40ca @skarcha committed Feb 17, 2011
Showing with 13 additions and 13 deletions.
  1. +13 −13 src/com/skarcha/nobrowser/Main.java
@@ -67,13 +67,13 @@ public void onCreate(Bundle savedInstanceState) {
}
if (finalUrl != null) {
- if (finalUrl.startsWith("http://www.twitlonger") ||
- finalUrl.startsWith("http://tl.gd"))
+ if (finalUrl.startsWith("http://www.twitlonger.com/") ||
+ finalUrl.startsWith("http://tl.gd/"))
{
finishActivity = processTwitlonger(finalUrl);
}
- else if (finalUrl.contains("://market.android.com")) {
+ else if (finalUrl.contains("://market.android.com/")) {
finishActivity = processMarket(finalUrl);
}
@@ -196,15 +196,15 @@ private boolean processDefault (String url) {
private boolean isShortener (String url) {
- if (url.startsWith("http://bit.ly") ||
- url.startsWith("http://goo.gl") ||
- url.startsWith("http://is.gd") ||
- url.startsWith("http://j.mp") ||
- url.startsWith("http://kcy.me") ||
- url.startsWith("http://t.co") ||
- url.startsWith("http://tinyurl.com") ||
- url.startsWith("http://urlcorta.es") ||
- url.startsWith("http://youtu.be"))
+ if (url.startsWith("http://bit.ly/") ||
+ url.startsWith("http://goo.gl/") ||
+ url.startsWith("http://is.gd/") ||
+ url.startsWith("http://j.mp/") ||
+ url.startsWith("http://kcy.me/") ||
+ url.startsWith("http://t.co/") ||
+ url.startsWith("http://tinyurl.com/") ||
+ url.startsWith("http://urlcorta.es/") ||
+ url.startsWith("http://youtu.be/"))
{
return true;
}
@@ -217,7 +217,7 @@ private String getFinalURL (String url) throws IOException, IOException {
HttpRequest request;
// Youtu.be special case
- if (url.startsWith("http://youtu.be")) {
+ if (url.startsWith("http://youtu.be/")) {
String YoutubeUrl = null;
try {
URI oldUri = new URI(url);

0 comments on commit 79d99dd

Please sign in to comment.