From 1bce11aec73bcd6f90fe8e72877b4061ae8d45af Mon Sep 17 00:00:00 2001 From: Karol Nowacki Date: Thu, 21 Apr 2011 20:24:38 +0200 Subject: resolve php notices Including a lot of undefined $_GET values. --- type/Default.class.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'type') diff --git a/type/Default.class.php b/type/Default.class.php index 45c4458..6429e5e 100644 --- a/type/Default.class.php +++ b/type/Default.class.php @@ -59,13 +59,13 @@ class Type_Default { # parse $_GET values function parse_get() { $this->args = array( - 'host' => $_GET['h'], - 'plugin' => $_GET['p'], - 'pinstance' => $_GET['pi'], - 'type' => $_GET['t'], - 'tinstance' => $_GET['ti'], + 'host' => GET('h'), + 'plugin' => GET('p'), + 'pinstance' => GET('pi'), + 'type' => GET('t'), + 'tinstance' => GET('ti'), ); - $this->seconds = $_GET['s']; + $this->seconds = GET('s'); } function validate_color($color) { @@ -82,12 +82,12 @@ class Type_Default { $rgb = array('r', 'g', 'b'); - $fg[r] = hexdec(substr($fgc,0,2)); - $fg[g] = hexdec(substr($fgc,2,2)); - $fg[b] = hexdec(substr($fgc,4,2)); - $bg[r] = hexdec(substr($bgc,0,2)); - $bg[g] = hexdec(substr($bgc,2,2)); - $bg[b] = hexdec(substr($bgc,4,2)); + $fg['r'] = hexdec(substr($fgc,0,2)); + $fg['g'] = hexdec(substr($fgc,2,2)); + $fg['b'] = hexdec(substr($fgc,4,2)); + $bg['r'] = hexdec(substr($bgc,0,2)); + $bg['g'] = hexdec(substr($bgc,2,2)); + $bg['b'] = hexdec(substr($bgc,4,2)); foreach ($rgb as $pri) { $c[$pri] = dechex(round($percent * $fg[$pri]) + ((1.0 - $percent) * $bg[$pri])); @@ -95,7 +95,7 @@ class Type_Default { $c[$pri] = '00'; } - return $c[r].$c[g].$c[b]; + return $c['r'].$c['g'].$c['b']; } function rrd_files() { -- cgit v1.1