mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-23 12:42:56 -04:00
Add check for urls without an extension
Eg: Instead of a url like .../Main_Page.html, just .../Main_Page
This commit is contained in:
parent
0701c1aa7b
commit
1076a15097
@ -202,10 +202,10 @@ public class AddNoteDialog extends DialogFragment
|
|||||||
int rightmostDot = path.lastIndexOf('.');
|
int rightmostDot = path.lastIndexOf('.');
|
||||||
|
|
||||||
if (rightmostSlash > -1 && rightmostDot > -1) {
|
if (rightmostSlash > -1 && rightmostDot > -1) {
|
||||||
return (path.substring(rightmostSlash + 1, rightmostDot));
|
return path.substring(rightmostSlash + 1, (rightmostDot > rightmostSlash) ? rightmostDot : path.length());
|
||||||
}
|
}
|
||||||
|
|
||||||
return ""; // If couldn't find the dot and/or slash
|
return ""; // If couldn't find a dot and/or slash in the url
|
||||||
}
|
}
|
||||||
|
|
||||||
// Override onBackPressed() to respond to user pressing 'Back' button on navigation bar
|
// Override onBackPressed() to respond to user pressing 'Back' button on navigation bar
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user