commit 8a08705d19342617fbaded2c8a890efd516a5bd4
parent cbffbc9a66fda03d12ac7acac7c2d035baf2b597
Author: MTRNord <mtrnord1@gmail.com>
Date: Wed, 13 May 2015 19:32:13 +0200
fix having empty posts
Diffstat:
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/core/backend/admin/blog/newpost.php b/core/backend/admin/blog/newpost.php
@@ -40,12 +40,13 @@ while (ob_get_status()) {
$title = $_POST['title'];
$text = $_POST['content'];
$category = $_POST['category'];
-
- if ($resultat = $connection->query("INSERT INTO posts (id,text,title,author,date,category) VALUES ('$ids', '$text', '$title', '$author', NOW(), '$category')")) {
- }
- $connection->close();
+ if (!empty($title)){
+ if ($resultat = $connection->query("INSERT INTO posts (id,text,title,author,date,category) VALUES ('$ids', '$text', '$title', '$author', NOW(), '$category')")) {
+ }
+ $connection->close();
+ }
ob_end_clean();
}
header("HTTP/1.1 301 Moved Permanently", true, 301);
header( "Location: ../../../../" );
-?>
-\ No newline at end of file
+?>