mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-23 21:53:35 +00:00
(bug 20310) Invalid value of edit_diff
This change makes EditFilterMerged handler replace all \r\n with \n. Parser::preSaveTransform replaces \r\n with \n for all texts, so there are no \r in the database. The hook EditFilterMerged is run before the text is processed by Parser::preSaveTransform, so the diff will be useless if the client sends content with \r\n as line endings. Change-Id: If81fe7cc5e3af51a6564f86597d3afaefc7ad4b7
This commit is contained in:
parent
0c6faec654
commit
1ba92ac870
|
@ -20,6 +20,10 @@ class AbuseFilterHooks {
|
|||
// Load vars
|
||||
$vars = new AbuseFilterVariableHolder;
|
||||
|
||||
# Replace line endings so the filter won't get confused as $text
|
||||
# was not processed by Parser::preSaveTransform (bug 20310)
|
||||
$text = str_replace( "\r\n", "\n", $text );
|
||||
|
||||
// Check for null edits.
|
||||
$oldtext = '';
|
||||
|
||||
|
|
Loading…
Reference in a new issue