$value) { $sanitized[$key] = htmlspecialchars($value); } return $sanitized; } /** * Populate the properties from the current request. */ public function initFromRequest() { $this->data = explode(',', $_GET['data']); foreach ($this->data as $key => $value) { $this->data[$key] = (int)$value; } for ($i = 0; $i < count($this->data); $i++) { $this->labels[] = ''; } if (array_key_exists('colors', $_GET)) { $this->colors = $this->sanitizeStringArray(explode(',', $_GET['colors'])); } while (count($this->colors) < count($this->data)) { $this->colors[] = '#FEFEFE'; } if (array_key_exists('width', $_GET)) { $this->width = (int)$_GET['width']; } if (array_key_exists('height', $_GET)) { $this->height = (int)$_GET['height']; } } }