Skip to content

Instantly share code, notes, and snippets.

@pleebe pleebe/chunk notice
Created Jan 24, 2017

Embed
What would you like to do?
--- a/src/Controller/Chan.php
+++ b/src/Controller/Chan.php
@@ -492,6 +492,11 @@ class Chan extends Common
// get the current status of the thread
$thread_status = $board->getThreadStatus();
+
+ if(!isset($options['type']) && $thread_status['nreplies'] > 5000) {
+ return $this->error(_i('Threads this large can\'t be opened reliably. <a href="'.$this->uri->create($this->radix->shortname.'/chunk/'.$num.'/').'">Use the chunked method</a> or <a href="'.$this->uri->create($this->radix->shortname.'/last/50/'.$num.'/').'">view last 50 posts</a>.'));
+ }
+
$last_modified = $thread_status['last_modified'];
$this->setLastModified($last_modified);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.