WikiPage: Truncate redirect fragments before inserting them into the DB
authorRoan Kattouw <roan.kattouw@gmail.com>
Thu, 25 Oct 2018 00:09:59 +0000 (17:09 -0700)
committerRoan Kattouw <roan.kattouw@gmail.com>
Thu, 25 Oct 2018 00:33:56 +0000 (17:33 -0700)
commit13a1d8957b9d639c69cef251b831ed03319182b1
treef70ca3ab698961a5bc6560b9ee703e8bc9870215
parentd47e2822bc06ad8069718b76b3f228e9f6c0a218
WikiPage: Truncate redirect fragments before inserting them into the DB

The rd_fragment field is 255 bytes wide, but there is no limit on how
long title fragments can be. We don't want to let the database silently
truncate the fragment for us, because that can result in invalid UTF-8.
Instead, truncate it before insertion in a UTF-8-aware way.

Bug: T207876
Change-Id: I12745f3f4c174eaced56d80f3661a71d0e5637e6
includes/page/WikiPage.php
tests/phpunit/includes/page/WikiPageDbTestBase.php