Browse Source

CONFIG_MIN_POST_BYTES: require a minimum character count

Limits spam!
yumi 1 month ago
parent
commit
dcdb493632

+ 2
- 2
includes/Continuity.php View File

@@ -168,15 +168,15 @@ HTML;
168 168
 		$WROOT = CONFIG_WEBROOT;
169 169
 		$action = htmlentities($this->resolveComposer());
170 170
 		$cancel = htmlentities($this->resolve());
171
+		$minlength = CONFIG_MIN_POST_BYTES;
171 172
 		if (CONFIG_CLEAN_URL) $bbcoderef = "{$WROOT}bbcode-help";
172 173
 		else $bbcoderef = "{$WROOT}bbcode-help.php";
173 174
 		print <<<HTML
174 175
 		<h2>New topic on {$this->title()}</h2>
175 176
 		<form method=POST action="$action" class=composer>
176
-
177 177
 		<div class=textarea>
178 178
 			<textarea autofocus rows=5 tabindex=1
179
-			maxlength=5000
179
+			maxlength=5000 minlength=$minlength
180 180
 			placeholder="Contribute your thoughts and desires..."
181 181
 			name=content>$content</textarea>
182 182
 		</div>

+ 1
- 1
includes/PreviewPost.php View File

@@ -6,7 +6,7 @@ class PreviewPost extends Reply {
6 6
 	}
7 7
 	public function getRM() { return $this->Parent->getRM(); }
8 8
 	public function renderAsHtml() {
9
-		$content = $this->getContentAsHtml();
9
+		$content = $this->Rm()->asHtml($this->Content);
10 10
 		$time = time();
11 11
 		$prettydate = date('l M jS \'y', $time);
12 12
 		$datetime = date(DATE_W3C, $time);

+ 1
- 1
includes/ResourceManager.php View File

@@ -4,7 +4,7 @@ if (is_dir("{$dir}/jBBCode")) {
4 4
 	include "{$dir}/jBBCode/Parser.php";
5 5
 	include "{$dir}/LineBreakVisitor.php";
6 6
 } if (is_dir("{$dir}/b8")) {
7
-	include "{$dir}/b8/b8/b8.php";
7
+	include "{$dir}/b8/b8.php";
8 8
 }
9 9
 
10 10
 class ResourceManager {

+ 2
- 1
includes/Topic.php View File

@@ -178,6 +178,7 @@ BREAD;
178 178
 		$WROOT = CONFIG_WEBROOT;
179 179
 		$action = htmlentities($this->resolveComposer());
180 180
 		$cancel = htmlentities($this->resolve());
181
+		$minlength = CONFIG_MIN_POST_BYTES;
181 182
 		if (CONFIG_CLEAN_URL) $bbcoderef = "{$WROOT}bbcode-help";
182 183
 		else $bbcoderef = "{$WROOT}bbcode-help.php";
183 184
 		print <<<HTML
@@ -185,7 +186,7 @@ BREAD;
185 186
 		<form method=POST action="$action" class=composer>
186 187
 		<div class=textarea>
187 188
 			<textarea autofocus rows=5 tabindex=1
188
-			maxlength=5000
189
+			maxlength=5000 minlength=$minlength
189 190
 			placeholder="Contribute your thoughts and desires..."
190 191
 			name=content>$content</textarea>
191 192
 		</div>

+ 1
- 0
includes/config.template.php View File

@@ -42,6 +42,7 @@ define("CONFIG_LOCALROOT", "/var/http/hub/ral/");
42 42
 // SPAM parameters
43 43
 define("CONFIG_SPAM_DB", "/var/http/hub/ral/tmp/b8-wordlist.db");
44 44
 define("CONFIG_SPAM_THRESHOLD", 0.75);
45
+define("CONFIG_MIN_POST_BYTES", 25);
45 46
 
46 47
 define("CONFIG_SECRET_SALT", "NOT_SO_SECRET");
47 48