Page MenuHomePhabricator

HtmlFormatter performs weird undocumented transforms
Closed, ResolvedPublic

Description

Copying from CR: https://gerrit.wikimedia.org/r/#/c/84342/5

"$html = str_replace( ' <', '&#32;<', $html );" – commented only with a link to bug 53086, apparently ugly workaround for some bug or feature

"if ( wfIsWindows() ) { $html = str_replace( '&#13;', '', $html ); }" – not commented on at all

Supported CSS selectors for remove() are not documented.

elementsToFlatten functionality uses very simple regexes for the transformation; it should be documented that it only works correctly if the elements have no attributes, lest someone use it for HTML sanitization.


Version: 1.22.0
Severity: normal

Details

Reference
bz54473

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 2:11 AM
bzimport set Reference to bz54473.

Change 85687 had a related patch set uploaded by Brion VIBBER:
bug 54473: doc fixes for HtmlFormatter

https://gerrit.wikimedia.org/r/85687

Change 85687 had a related patch set uploaded by Krinkle:
bug 54473: doc fixes for HtmlFormatter

https://gerrit.wikimedia.org/r/85687

Change 85687 merged by jenkins-bot:
Fix doc for HtmlFormatter

https://gerrit.wikimedia.org/r/85687