(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:
Szymon Świerkosz 2012-04-29 10:55:36 +02:00
parent 0c6faec654
commit 1ba92ac870

View file

@ -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 = '';