From eafb5f8730f61e22078d96d7b333f33df36fe791 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Tue, 31 Jul 2012 11:06:55 +0000 Subject: [PATCH] take care of php-warning on str_repeat (second param has to be greater or equal to 0) --- phpgwapi/inc/htmLawed/htmLawed.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/phpgwapi/inc/htmLawed/htmLawed.php b/phpgwapi/inc/htmLawed/htmLawed.php index 312ada1fa3..0c6dff1415 100644 --- a/phpgwapi/inc/htmLawed/htmLawed.php +++ b/phpgwapi/inc/htmLawed/htmLawed.php @@ -664,11 +664,11 @@ for($i=-1, $j=count($t); ++$i<$j;){ $y = !$x ? ltrim($e, '/') : ($x > 0 ? substr($e, 0, strcspn($e, ' ')) : 0); $e = "<$e>"; if(isset($d[$y])){ - if(!$x){echo "\n", str_repeat($s, --$n), "$e\n", str_repeat($s, $n);} - else{echo "\n", str_repeat($s, $n), "$e\n", str_repeat($s, ($x != 1 ? ++$n : $n));} + if(!$x){echo "\n", str_repeat($s, (--$n>=0?$n:0)), "$e\n", str_repeat($s, ($n>=0?$n:0));} + else{echo "\n", str_repeat($s, ($n>=0?$n:0)), "$e\n", str_repeat($s, ($x != 1 ? (++$n>=0?$n:0) : ($n>=0?$n:0)));} echo ltrim($r); continue; } - $f = "\n". str_repeat($s, $n); + $f = "\n". str_repeat($s, ($n>=0?$n:0)); if(isset($c[$y])){ if(!$x){echo $e, $f, ltrim($r);} else{echo $f, $e, $r;}