The output of the $message should be cleared by the html_entity_decode() to prevent output like:

До конца ноября Госдума рассмотрит законопроект «Единой России», который обязывает приезжих сдавать экзамен по русскому языку. Это коснется трудовых мигрантов в сфере ЖКХ, торговли и бытового обслуживания.

This can be done by replacing

$message = htmlspecialchars_decode($message, $node->filter);

at string 143 with

$message = htmlspecialchars_decode(html_entity_decode($message, ENT_QUOTES, 'UTF-8'), $node->filter);

As result:
До конца ноября Госдума рассмотрит законопроект «Единой России», который обязывает приезжих сдавать экзамен по русскому языку. Это коснется трудовых мигрантов в сфере ЖКХ, торговли и бытового обслуживания.

Comments

spleshka’s picture

Status: Active » Needs work

What about this:

$message = htmlspecialchars_decode($message, ENT_QUOTES); 
areafix’s picture

This isn't working.

From PHP Manual:

The converted entities are: &, " (when ENT_NOQUOTES is not set), ' (when ENT_QUOTES is set), < and >.

i.e. &, ", ', <, > only but not «, », „, “ or samething else.

spleshka’s picture

Ok, I'll do it in your way.

spleshka’s picture

Status: Needs work » Fixed

Fixed at commit ea981ec

spleshka’s picture

Status: Fixed » Closed (fixed)