/** * @return bool */ public function isValid() { if (!$this->loaded) { return false; } $vuln = $this->pixie->getVulnService()->getField('photo'); if (is_array($vuln) && in_array('ArbitraryFileUpload', $vuln)) { return true; } $ext = $this->getExtension(); if (!in_array($ext, $this->params['extensions'])) { return false; } if (count($this->params['types'])) { if (in_array('image', $this->params['types'])) { try { $size = getimagesize($this->getTmpName(), $imageInfo); } catch (\Exception $e) { $size = false; } if ($size === false || $size[0] == 0 || $size[1] == 0) { return false; } } } return true; }
protected function getVulns() { $service = $this->pixie->getVulnService(); if (!$service) { return []; } return $service->getVulnerabilities(); }