Skip to content
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

Crash when removing a bookmark with a single quote in the description #179

Open
pieterdavid opened this issue May 17, 2018 · 0 comments
Open

Comments

@pieterdavid
Copy link

The problem seems to be that the single quote is not escaped when making the SQL query in me.zeeroooo.materialfb.Misc.DatabaseHelper.remove

Stack trace:

android.database.sqlite.SQLiteException: near "Vélo": syntax
error (code 1): , while compiling: DELETE FROM mfb_table WHERE TITLE =
'Apéro' Vélo Etterbeek' AND URL = '
https://m.facebook.com/events/1685925864802403/?acontext=%7B%22ref%22%3A%222%22%2C%22ref_dashboard_filter%22%3A%22upcoming%22%2C%22action_history%22%3A%22null%22%7D
'
at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native
Method)
at
android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:889)
at
android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java:500)
at android.database.sqlite.SQLiteSession.prepare(SQLiteSession.java:588)
at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:58)
at android.database.sqlite.SQLiteStatement.<init>(SQLiteStatement.java:31)
at
android.database.sqlite.SQLiteDatabase.executeSql(SQLiteDatabase.java:1675)
at android.database.sqlite.SQLiteDatabase.execSQL(SQLiteDatabase.java:1606)
at me.zeeroooo.materialfb.Misc.DatabaseHelper.remove(DatabaseHelper.java:57)
at
me.zeeroooo.materialfb.Misc.BookmarksAdapter$1.onClick(BookmarksAdapter.java:64)
at android.view.View.performClick(View.java:5619)
at android.view.View$PerformClick.run(View.java:22295)
at android.os.Handler.handleCallback(Handler.java:754)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:163)
at android.app.ActivityThread.main(ActivityThread.java:6342)
at java.lang.reflect.Method.invoke(Native Method)
at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:880)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:770)
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

No branches or pull requests

1 participant