Repository navigation
Fix encoded names on the renewal page - #5430
Conversation
|
Hi @guerricv, thanks for this one. Moving search and text sorting to PHP has two side effects I would like fixed before merging, plus a few smaller points. 1. Text sorting no longer follows the database collation
The columns are 2. Search is no longer accent-insensitive With the SQL Suggested fix for 1 and 2: build one folded key per row and use it for both matching and sorting. Fold the search term the same way. Without 3. Compute the sort key once per row The comparator currently lowercases both sides on every comparison. On synthetic data the PHP side takes about 0.2 s for 20,000 rows and about 1.9 s for 100,000, almost all of it in 4. Skip the SQL When 5. Reuse the existing helpers
6. Tests Please add cases for the two behaviours above:
Guard them with 7. Live check You mention that visual verification on an installed instance is still pending. Could you confirm once it is done? A screenshot of the table with an accented item and folder name is enough. No schema, setting or language change is needed, and nothing else in the PR needs to move. Thanks again. |
|
Hi Nils, thanks for the review. I've addressed the code points in
Local validation on PHP 8.2.34: 155 tests / 5,476 assertions pass with I'm keeping the PR in draft while the new checks run and the lab verification is completed. No schema, setting or language change is included. Lab screenshotsBefore the fix
After the fix After screenshot to be added here.
|


Description
The renewal page displays stored HTML entities literally: an item named
Arrivéeappears asArrivéeinstead ofArrivée. Folder names have the same double-escaping problem.Decode one storage entity layer before escaping item labels and folder breadcrumbs for HTML output. Search and text sorting also use decoded labels and folder names, so users can search for the text they see and entity fragments such as
amporquotdo not produce false matches. Filtering and text sorting happen before pagination, within the existing server-side authorization scope. The default chronological view retains SQL pagination.Published commit:
0b323c677—Fix encoded names on the renewal page.Related issue
No linked issue.
Type of change
How has this been tested?
R&D,O'Brien, quotes, angle brackets and encoded HTML payloads. They cover safe output, item/folder search, false entity-fragment matches, text sorting and pagination.git diff --checkpass.app/config/settings.php; the analysis bootstrap uses the shipped sample configuration. Full PHPStan analysis passes in CI.0b323c677: Quality (PHP 8.2/8.3 test suites, JavaScript tests, PHPStan level 4, table-prefix and production-autoloader guards, concurrent recipient requests with MariaDB), CodeQL, and Scrutinizer.Checklist
php app/vendor/bin/phpstan analyse --memory-limit=2G)php _tools/phpunit.phar— see CONTRIBUTING.md for the one-time setup)var_dump()orconsole.log()left in the codeapp/sources/*.queries.phpfiles have a matchingpublic/sources/proxy shimteampassclasseswere applied to both copies (app/includes/libraries/andapp/vendor/)app/vendor/composer/is in its production form (git checkout -- app/vendor/composer/)No new queries controller or
teampassclasseschange is included. All CI checks passed on the published commit; the PR is ready for review.Impact on install / upgrade
install/upgrade_run_X.X.X.phpscript is included and the fresh install path was testedNo installation or migration step is required.
Screenshots
No screenshot from a live installation. Regression tests verify the HTML returned for table cells; visual verification on an installed instance is still pending.