Invalid or missing security token. Please go back and try again.
'; die(); } $this->folder = $this->createFolder(); $this->words = $this->handleWords(); $_SESSION['words'] = $this->words; $_SESSION['folder'] = $this->folder; $_SESSION['collages'] = (int) $_POST['collages']; //number of zaps $_SESSION['width'] = (int) $_POST['width']; $_SESSION['height'] = (int) $_POST['height']; $_SESSION['date'] = ZAP_MOMENT; $ver = ZAP_VERSION; include getZAPTemplate($this->template); $this->tpl .= ob_get_clean(); } /** * Create folder and return path * @return string $folder path or throws exception */ private function createFolder() { try { $suffix = bin2hex(random_bytes(4)); $folder = ZAP_APP_BASE_DIR . DIRECTORY_SEPARATOR . ZAP_SESSIONS_DIR . DIRECTORY_SEPARATOR . 'zap_' . ZAP_MOMENT . '_' . $suffix; if (!mkdir($folder, 0777, true)) { throw new Exception('' . ERROR_PREFIX . 'Unable to create base dir: ' . $folder . '
'); } return $folder; } catch (Exception $e) { $this->tpl .= $e->getMessage(); return; } } /** * Create an array based on post data * @return array $words */ private function handleWords() { $words = array(); for ($i = 1; $i <= MAX_WORDS; $i++) { $key = 'word' . sprintf("%02d", $i); if (!empty($_POST[$key])) { $words[] = $_POST[$key]; } } return $words; } /** * return rendered content */ public function getContent() { return $this->tpl; } } ?>