Fixed bug with strings rendering.

1 now works with different LF
2 fixed the bug with 'empty string' in cases when htmlspecialchars returns empry string
This commit is contained in:
KOLANICH 2013-10-27 00:27:00 +04:00
parent b2a6f0c7af
commit a39261588e

View file

@ -236,8 +236,8 @@ class dBug {
return; return;
} }
$length=strlen($var); $length=strlen($var);
$nv=htmlspecialchars($var); $nv=htmlspecialchars($var,ENT_QUOTES | ENT_SUBSTITUTE,'');
$lines=explode("\n",$nv); $lines=preg_split('/\R/', $nv);
$linesCount=count($lines); $linesCount=count($lines);
if($linesCount==1 && $length<=self::$embeddedStringMaxLength){ if($linesCount==1 && $length<=self::$embeddedStringMaxLength){
$this->renderPrimitiveType('string','string ['.$length.']',$var); $this->renderPrimitiveType('string','string ['.$length.']',$var);