freebsd-ports/net-mgmt/pnp/files/patch-share_pnp_application_helpers_rrd.php
Lars Engels 18ee779f87 net-mgmt/pnp:
- Add patches from Check_MK that workaround missing sizeof() function in PHP 7.x
- Bump PORTREVSION
2019-01-16 13:37:50 +00:00

20 lines
1 KiB
PHP

--- share/pnp/application/helpers/rrd.php.orig 2017-08-21 15:52:37 UTC
+++ share/pnp/application/helpers/rrd.php
@@ -207,7 +207,7 @@ class rrd_Core {
if(is_array($cf)){
foreach($cf as $key => $val){
$line .= sprintf("GPRINT:%s:%s:",$vname,$val);
- if($key == sizeof($cf)-1){
+ if($key == count($cf)-1){
$line .= '"'.$text.' '.ucfirst(strtolower($val)).'\\l" ';
}else{
$line .= '"'.$text.' '.ucfirst(strtolower($val)).'" ';
@@ -234,7 +234,7 @@ class rrd_Core {
if(is_array($cf)){
foreach($cf as $key => $val){
$line .= sprintf("GPRINT:%s:%s:",$vname,$val);
- if(($key == sizeof($cf)-1)and($align != "")){
+ if(($key == count($cf)-1)and($align != "")){
$line .= '"'.$text.' '.ucfirst(strtolower($val)).$align.'" ';
}else{
$line .= '"'.$text.' '.ucfirst(strtolower($val)).'" ';