summaryrefslogtreecommitdiff
path: root/lib/exe/ajax.php
diff options
context:
space:
mode:
authorKlap-in <klapinklapin@gmail.com>2013-01-29 01:44:45 +0100
committerKlap-in <klapinklapin@gmail.com>2013-01-29 01:44:45 +0100
commitd91a4ef556635b5298c47df2856851f0694b2885 (patch)
treeb8e2d5aecdfdfa1d93e47a6b4419467d2811e2ee /lib/exe/ajax.php
parente4a50ea7ef39fc26378570f7a62c58e9bbf4bfda (diff)
downloadrpg-d91a4ef556635b5298c47df2856851f0694b2885.tar.gz
rpg-d91a4ef556635b5298c47df2856851f0694b2885.tar.bz2
Add a break to ajax_qsearch()
When the search input is still only a few characters, the number of matching pages is big. Browsers have heavy work to progress this whole return, better cut off so only the part that is directly displayed will be sent.
Diffstat (limited to 'lib/exe/ajax.php')
-rw-r--r--lib/exe/ajax.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/exe/ajax.php b/lib/exe/ajax.php
index 9989269cf..fdc28d4f1 100644
--- a/lib/exe/ajax.php
+++ b/lib/exe/ajax.php
@@ -57,6 +57,7 @@ function ajax_qsearch(){
print '<strong>'.$lang['quickhits'].'</strong>';
print '<ul>';
+ $counter = 0;
foreach($data as $id => $title){
if (useHeading('navigation')) {
$name = $title;
@@ -69,6 +70,12 @@ function ajax_qsearch(){
}
}
echo '<li>' . html_wikilink(':'.$id,$name) . '</li>';
+
+ $counter ++;
+ if($counter > 50) {
+ echo '<li>...</li>';
+ break;
+ }
}
print '</ul>';
}