-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Illegal character in query: pipe character in file field #11876
Comments
Seems like a problem with the underlying URI implementation in the JDK, they implement RFC2396 + RFC2732 while the usage of pipe characters is only supported in RFC3986. Source: gatling/gatling#1981 (comment). Solution: Encode pipe characters as
This is bad. This type of exceptions should never make the program unusable. |
hi @ryan-carpenter , Is this issue still available for contribution? I have a student assignment that requires contributing to an open-source project, and I’m interested in contributing to this one.Could you assign this issue to me? |
@jiaxin0103 Please have a look at https://github.com/orgs/JabRef/projects/5 and choose a "free to take" issue, as it depends on the JDK. It would be needed to open a PR over there, if a solution is found. Edit: Sorry, this is not search related. My bad. Not sure, why I completely missed HoussemNasri's comment. |
I think, this can be done inside JabRef, too. As stated at #11876 (comment), one needs to recode the pipe sign into Replace all calls to
The method in step 2 does that escaping. Test cases need to be added to |
@jiaxin0103 Please reply with |
Hello @koppor , I would like to work on this problem. |
/assign @hitalo-siriano |
👋 Hey @hitalo-siriano, thank you for your interest in this issue! 🎉 We're excited to have you on board. Start by exploring our Contributing guidelines, and don't forget to check out our workspace setup guidelines to get started smoothly. In case you encounter failing tests during development, please check our developer FAQs! Having any questions or issues? Feel free to ask here on GitHub. Need help setting up your local workspace? Join the conversation on JabRef's Gitter chat. And don't hesitate to open a (draft) pull request early on to show the direction it is heading towards. This way, you will receive valuable feedback. Happy coding! 🚀 ⏳ Please note, you will be automatically unassigned if the issue isn't closed within 30 days (by 19 November 2024). A maintainer can also add the "📌 Pinned"" label to prevent automatic unassignment. |
Modified the handling of URLs in the file field to replace the pipe character (|) with its encoded representation (%7C) to avoid exceptions in JabRef. Closes JabRef#11876
…loses JabRef#11876. - Introduced URLUtil.createUri() and URLUtil.create() to handle URL sanitization. - Replaced direct calls to URI.create() and URI.create().toURL() with the new utility methods. - URLs containing the pipe character ('|') are now properly encoded as '%7C' to prevent parsing errors. - Added test cases to URLUtilTest to verify correct sanitization and URL creation.
…loses JabRef#11876. - Introduced URLUtil.createUri() and URLUtil.create() to handle URL sanitization. - Replaced direct calls to URI.create() and URI.create().toURL() with the new utility methods. - URLs containing the pipe character ('|') are now properly encoded as '%7C' to prevent parsing errors. - Added test cases to URLUtilTest to verify correct sanitization and URL creation. - Added @archtest to ensure that the URI.create() method is not directly called in the codebase.
…loses JabRef#11876. - Introduced URLUtil.createUri() and URLUtil.create() to handle URL sanitization. - Replaced direct calls to URI.create() and URI.create().toURL() with the new utility methods. - URLs containing the pipe character ('|') are now properly encoded as '%7C' to prevent parsing errors. - Added test cases to URLUtilTest to verify correct sanitization and URL creation. - Added @archtest to ensure that the URI.create() method is not directly called in the codebase.
…loses JabRef#11876. - Introduced URLUtil.createUri() and URLUtil.create() to handle URL sanitization. - Replaced direct calls to URI.create() and URI.create().toURL() with the new utility methods. - URLs containing the pipe character ('|') are now properly encoded as '%7C' to prevent parsing errors. - Added test cases to URLUtilTest to verify correct sanitization and URL creation. - Added @archtest to ensure that the URI.create() method is not directly called in the codebase.
JabRef version
Other (please describe below)
Operating system
GNU / Linux
Details on version and operating system
No response
Checked with the latest development build (copy version output from About dialog)
Steps to reproduce the behaviour
I think this exception was trigger by searching full text online, which added a URL to the file field. The important part is that a pipe character in the URL raised an exception that recurred until l I killed JabRef and removed the offending URL from the .bib file.
|
) character to the file field (URLs from GALE ONEFILE, containing the string&docId=GALE|
)Appendix
JabRef 6.0--2024-09-25--91d0709
Linux 6.9.9-1-default amd64
Java 21.0.2
JavaFX 23+29
Log File
The text was updated successfully, but these errors were encountered: