-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix default bookmarks activelinks #873
base: next
Are you sure you want to change the base?
Changes from 1 commit
4370631
ab5074b
24032c6
96408c6
5d68076
2d9d9e9
285262d
3eb09ed
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -91,10 +91,11 @@ private void addCategoryToList(BookmarkCategory cat, HTMLNode list, boolean noAc | |
// extract the key type | ||
String keyType = initialKey.substring(1,3); | ||
String key = '/' + initialKey + (initialKey.endsWith("/") ? "" : "/"); | ||
Matcher match = null; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seeing that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, but the switch branches share the scope, so that’s how it has to be to avoid inventing new names for the different branches. |
||
switch (keyType) { | ||
case "USK": | ||
case "SSK": | ||
Matcher match = PATTERN_USK_SSK.matcher(key); | ||
match = PATTERN_USK_SSK.matcher(key); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this only matches when the key is already well-formed ⇒ ideally extract to a static method (uses no |
||
if (match.matches()) { | ||
Bombe marked this conversation as resolved.
Show resolved
Hide resolved
|
||
key = match.group(1) + "activelink.png"; | ||
} | ||
|
@@ -110,7 +111,7 @@ private void addCategoryToList(BookmarkCategory cat, HTMLNode list, boolean noAc | |
break; | ||
case "CHK": | ||
case "KSK": // This assumes the activelink is in the root of any one-shot directory upload. | ||
Matcher match = PATTERN_BARE_SSK_CHK_KSK.matcher(key); | ||
match = PATTERN_BARE_SSK_CHK_KSK.matcher(key); | ||
if (match.matches()) { | ||
key = match.group(1) + "activelink.png"; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this has to go from 0 to 3 — Java is zero-indexed.