diff options
Diffstat (limited to 'it_debug.class')
-rw-r--r-- | it_debug.class | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/it_debug.class b/it_debug.class index 89d5259..5501353 100644 --- a/it_debug.class +++ b/it_debug.class @@ -130,7 +130,7 @@ static function dump($args) $item = preg_replace_callback('/\b(1[234]\d\d\d\d\d\d\d\d)\b(.*)/', function($m) { return $m[1] . $m[2] . " # " . date('Y-m-d H:i:s', $m[1]); }, $item); $item = preg_replace("#(=>?)\s*\n\s*(array|class)#", '$1 $2', $item); # array( and class on same line as key - $item = preg_replace('#array \(\s+([^({,;]+),\s+\)#', 'array( $1 )', $item); # 1-element arrays on 1 line + $item = preg_replace_callback('#array \(\s+([^(){};]{1,100}),\s+\)#', function($m) { return "array (" . it::replace(array("\n\s*" => " "), $m[1]) . ")"; }, $item); # short arrays on 1 line $item = preg_replace('#class (\S+) \{\s+([^({,;]+;)?\s+\}#', 'class $1 { $2 }', $item); # 1-element objects on 1 line #$item = preg_replace('#\{\s*var \$attr#', '{ var $attr', $item); # move $attr on same line $item = preg_replace("#\\(\s*\n\s*\\)#", "()", $item); # empty arrays on 1 line @@ -138,7 +138,7 @@ static function dump($args) $item = "$red$item$nored"; if ($htmlok) - $item = preg_replace("#http://[^\s']*#", "<a href='\$0'>\$0</a>", htmlspecialchars($item)); + $item = preg_replace("#(https?:)?//[^\s']*#", "<a href='\$0'>\$0</a>", htmlspecialchars($item)); if (preg_match('/^[\'"]/', $var)) $r .= "$item "; @@ -156,7 +156,7 @@ static function dump($args) $title = htmlspecialchars(it_debug::backtrace(array('skiplevels' => 1)), ENT_COMPAT, "ISO-8859-1"); if ($htmlok) - return "<pre title='$title' style='color:#c00; text-align:left; background:white; margin:0 0 0.8em; border-bottom:1px solid #ddd; z-index:9999; position:relative'>$r</pre>\n"; + return "<pre title='$title' style='color:#c00; text-align:left; background:white; border-bottom:1px solid #ddd; z-index:9999; position:relative'>$r</pre>\n"; else return $ansiok ? "$r\n" : "\xe2\x96\x88\xe2\x96\x8c" . it::replace(array("\n" => "\n\xe2\x96\x88 "), "$r") . "\n"; } |