htmlspecialchars hassle

This commit is contained in:
Claude 2013-04-13 12:27:54 +02:00
parent da6858b211
commit b92c64767f

View File

@ -236,12 +236,14 @@ class Pastes extends CI_Model
{ {
//diff //diff
//yes, I'm aware, two times htmlspecialchars_decode(). Needs to be, since it's saved that way in the DB from the original stikked author ages ago ;)
include_once ('./application/libraries/finediff.php'); include_once ('./application/libraries/finediff.php');
$from_text = $row['raw']; $from_text = htmlspecialchars_decode($row['raw']);
$to_text = $data['raw']; $to_text = htmlspecialchars_decode($data['raw']);
$opcodes = FineDiff::getDiffOpcodes($from_text, $to_text, FineDiff::$wordGranularity); $opcodes = FineDiff::getDiffOpcodes($from_text, $to_text, FineDiff::$wordGranularity);
$to_text = FineDiff::renderToTextFromOpcodes($from_text, $opcodes); $to_text = FineDiff::renderToTextFromOpcodes($from_text, $opcodes);
$data['paste'] = $this->_format_diff(nl2br(FineDiff::renderDiffToHTMLFromOpcodes($from_text, $opcodes))); $data['paste'] = htmlspecialchars_decode($this->_format_diff(nl2br(FineDiff::renderDiffToHTMLFromOpcodes($from_text, $opcodes))));
} }
} }
else else