Where or what new condition is showing HTML characters?
Hello,
I've had some sites no longer echo back HTML Text as rendered html. This worked fine but now I need use the htmlspecialchars_decode() function to solve the problem. It's a problem as this was not expected and it's disappointing when Customers are the ones making us aware of the change.
Solved as shown:
<?php echo htmlspecialchars_decode($info->getColumnVal("invDescr")); ?>
I guess it's unrealistic to expect rsobj.php automatically re-write with the htmlspecialchars_decode function. So what solutions do we have? Just remember if you work on a page that will render html content from a recordset value, you'll need wrap it in the noted function...
public function getColumnVal($col,$crossSiteProtect=null) {
if (is_null($crossSiteProtect)) $crossSiteProtect = $this->CrossSiteProtect;
$colVal = "";
if (isset($this->Results[$this->Index]) && isset($this->Results[$this->Index][$col])) {
$colVal = $this->Results[$this->Index][$col];
if ($crossSiteProtect) $colVal = htmlspecialchars($colVal);
}
return $colVal;
}