Skip to content

DM-6617: fix parsing info link #228

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

Merged
merged 1 commit into from
Nov 16, 2016
Merged

Conversation

ejoliet
Copy link
Contributor

@ejoliet ejoliet commented Nov 15, 2016

Fixed the URL parsing when relative URL is found in master catalog table. In order to test, you need to build FF and redeploy the branch built.
Then go to 'catalog' search and check that 'info' and inner link in description are ok.

Copy link
Contributor

@loitly loitly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will approve the change because it does fix that one scenario mentioned in the ticket. I don't think this is the best fix though, for the reason I pointed out.

@@ -262,7 +262,7 @@ private static String modifyToFullURL(String inStr, String targetStr) {
int endAnchor= s.indexOf(">",start);
if (targetStr!=null && endAnchor>0 && url!=null &&
!s.substring(beginChar,endAnchor).contains("target=")) {
String rStr= "\\Q" + beginChar+url+beginChar + "\\E";
String rStr = beginChar + url + beginChar;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because rStr is used as a regex, simply removing the \Q \E will have a side-effect. If the url contains '?' for example, the modified code will fail.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've checked but those seems to not be part of regex characters set.
My test showed that the code above is also handling this kind of 'inStr' with '?' as mentioned:

res = WISE Preliminary Post-Cryo Single Exposure (L1b) Source Table (Superseded

Will merge the branch as it fixes at least the current problem. If something more complex and not resolved happens i will open a new ticket. Thanks for the review!

@ejoliet ejoliet merged commit fd9bae8 into dev Nov 16, 2016
@ejoliet ejoliet deleted the DM-6617-fix-master-cat-parsing branch November 16, 2016 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants