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 someone adds unicode characters to the URL #1

Closed
ciencia opened this issue Mar 24, 2020 · 0 comments
Closed

Crash when someone adds unicode characters to the URL #1

ciencia opened this issue Mar 24, 2020 · 0 comments

Comments

@ciencia
Copy link
Owner

ciencia commented Mar 24, 2020

Looks like someone adding a random unicode character to the URL (out of the Latin1 charmap) causes the site to break.

For example, add the character 🔰 to the URL for a page that doesn't exist and...

2020-03-23 17:38:52 wikidex11 wikidexwiki: [3d1f0ede1948a33add5bf022] /wiki/A_page_that_doesnt_exist%F0%9F%94%B0%F0%9F%94%B0   Wikimedia\Rdbms\DBQueryError from line 1506 of .../includes/libs/rdbms/database/D
atabase.php: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading?
Query: SELECT  page_id  FROM `page`    WHERE page_namespace = '0' AND convert(page_title using utf8) = 'A_page_that_doesnt_exist🔰🔰'  LIMIT 1
Function: Wikimedia\Rdbms\Database::selectRow
Error: 1300 Invalid utf8 character string: 'F09F94' (databaseserver:3308)

#0 .../includes/libs/rdbms/database/Database.php(1476): Wikimedia\Rdbms\Database->makeQueryException(string, integer, string, string)
#1 .../includes/libs/rdbms/database/Database.php(1236): Wikimedia\Rdbms\Database->reportQueryError(string, integer, string, string, boolean)
#2 .../includes/libs/rdbms/database/Database.php(1703): Wikimedia\Rdbms\Database->query(string, string)
#3 .../includes/libs/rdbms/database/Database.php(1794): Wikimedia\Rdbms\Database->select(string, array, array, string, array, array)
#4 .../extensions/SaneCase/SaneCase.php(9): Wikimedia\Rdbms\Database->selectRow(string, array, array)
#5 .../includes/Hooks.php(174): SaneCase::onBeforeDisplayNoArticleText(Article)
#6 .../includes/Hooks.php(202): Hooks::callHook(string, array, array, NULL)
#7 .../includes/page/Article.php(1438): Hooks::run(string, array)
#8 .../includes/page/Article.php(682): Article->showMissingArticle()
#9 .../includes/actions/ViewAction.php(68): Article->view()
#10 .../includes/MediaWiki.php(501): ViewAction->show()
#11 .../includes/MediaWiki.php(294): MediaWiki->performAction(Article, Title)
#12 .../includes/MediaWiki.php(860): MediaWiki->performRequest()
#13 .../includes/MediaWiki.php(517): MediaWiki->main()

ciencia added a commit that referenced this issue Mar 24, 2020
Since some unicode characters will cause the query to error because utf8 can't
handle all avaialble characters, causing the wiki to crash in such an event.

Fixes #1
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