public function renderPage($path) { if (preg_match('#(^|/)\\.\\.?(/|$)#', $path)) { throw new \Exception('Invalid path'); } $path = $this->wikiPath . '/' . $path . '.md'; if (!file_exists($path)) { throw new \Exception('File not found'); } $html = $this->parsedown->parse(file_get_contents($path)); return $html; }