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(); $ix = 1; $postix = sprintf("%02d", $ix); $wd = 'word' . $postix; while(!empty($_POST[$wd])) { array_push($words, $_POST[$wd]); $ix++; $postfix = sprintf("%02d", $ix); $wd = 'word' . $postfix; } return $words; } /** * return rendered content */ public function getContent() { return $this->tpl; } } ?>