LIMIT 1 when fetching a wiki page

This commit is contained in:
Shish 2019-06-16 19:39:28 +01:00
parent 1d10baa719
commit 6313ebc339

View file

@ -213,7 +213,7 @@ class Wiki extends Extension
return false; return false;
} }
private function get_page(string $title, int $revision=-1): WikiPage private function get_page(string $title): WikiPage
{ {
global $database; global $database;
// first try and get the actual page // first try and get the actual page
@ -222,7 +222,9 @@ class Wiki extends Extension
SELECT * SELECT *
FROM wiki_pages FROM wiki_pages
WHERE SCORE_STRNORM(title) LIKE SCORE_STRNORM(:title) WHERE SCORE_STRNORM(title) LIKE SCORE_STRNORM(:title)
ORDER BY revision DESC"), ORDER BY revision DESC
LIMIT 1
"),
["title"=>$title] ["title"=>$title]
); );
@ -232,7 +234,9 @@ class Wiki extends Extension
SELECT * SELECT *
FROM wiki_pages FROM wiki_pages
WHERE title LIKE :title WHERE title LIKE :title
ORDER BY revision DESC", ["title"=>"wiki:default"]); ORDER BY revision DESC
LIMIT 1
", ["title"=>"wiki:default"]);
// fall further back to manual // fall further back to manual
if (empty($row)) { if (empty($row)) {