Browse Source

Allow empty post edits

spaghetti 7 years ago
parent
commit
e5013ec02b

+ 2
- 11
sections/ajax/password_validate.php View File

@@ -1,18 +1,9 @@
1 1
 <?php
2
-$Password = db_string($_POST['password']);
3
-$IsGoodPassword = false;
4
-
5 2
 $DB->query("
6 3
   SELECT Password
7 4
   FROM bad_passwords
8
-  WHERE Password='$Password'");
9
-
10
-if (!$DB->has_results()) {
11
-  $IsGoodPassword = true;
12
-}
5
+  WHERE Password = '".db_string($_POST['password'])."'");
13 6
 
14
-echo ($IsGoodPassword ? 'true' : 'false');
7
+echo ($DB->has_results() ? 'false' : 'true');
15 8
 exit();
16 9
 ?>
17
-
18
-

+ 1
- 1
sections/comments/take_edit.php View File

@@ -1,7 +1,7 @@
1 1
 <?
2 2
 authorize();
3 3
 
4
-if (!isset($_POST['postid']) || !is_number($_POST['postid']) || !isset($_POST['body']) || trim($_POST['body']) === '') {
4
+if (!isset($_POST['postid']) || !is_number($_POST['postid']) || !isset($_POST['body'])) {
5 5
   error(0);
6 6
 }
7 7
 

+ 1
- 4
static/functions/password_validate.js View File

@@ -1,7 +1,4 @@
1
-/**
2
-*
3
-* Validates passwords to make sure they are powerful
4
-**/
1
+// Validates passwords to make sure they are powerful
5 2
 
6 3
 (function() {
7 4
 var CLEAR = 0;

Loading…
Cancel
Save