Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions wiki.php
Original file line numberDiff line numberDiff line change
Expand Up@@ -98,7 +98,8 @@ protected function _render($page)
'parts' => $parts,
'page' => $page_data,
'html' => $list,
'is_dir' => true
'is_dir' => true,
'use_pastebin' => $this->_usePasteBin()
));
return;
}
Expand DownExpand Up@@ -126,7 +127,8 @@ protected function _render($page)
. "<input type='submit' class='btn btn-primary' value='Create this page' />"
. "</form>"
,
'is_dir' => false
'is_dir' => false,
'use_pastebin' => $this->_usePasteBin()
));
}
} else {
Expand DownExpand Up@@ -529,9 +531,17 @@ public function createAction()
{
$request = parse_url($_SERVER['REQUEST_URI']);
$page = str_replace("###" . APP_DIR . "/", "", "###" . urldecode($request['path']));
$filepath = LIBRARY . DIRECTORY_SEPARATOR . urldecode($page);

$filepath = LIBRARY . urldecode($request['path']);
$content = "# " . htmlspecialchars($page, ENT_QUOTES, 'UTF-8');
if (USE_PAGE_METADATA) {
$content =
"---\n\"title\": \"" .
htmlspecialchars($page, ENT_QUOTES, 'UTF-8') .
"\"\n---\n\n" .
$content;
}

// if feature not enabled, go to 404
if (!ENABLE_EDITING || file_exists($filepath)) {
$this->_404();
Expand Down