Browse Source

Merge pull request #78 from live627/errors

! Do not warn for old replies on new topic
emanuele45 12 years ago
parent
commit
e5351ba6bb
1 changed files with 5 additions and 1 deletions
  1. 5 1
      Sources/Post.php

+ 5 - 1
Sources/Post.php

@@ -354,7 +354,7 @@ function Post($post_errors = array())
 	}
 
 	// Check whether this is a really old post being bumped...
-	if (!empty($modSettings['oldTopicDays']) && $lastPostTime + $modSettings['oldTopicDays'] * 86400 < time() && empty($sticky) && !isset($_REQUEST['subject']))
+	if (!empty($modSettings['oldTopicDays']) && $lastPostTime + $modSettings['oldTopicDays'] * 86400 < time() && empty($sticky) && !empty($topic) && !isset($_REQUEST['subject']))
 		$post_errors[] = array('old_topic', array($modSettings['oldTopicDays']));
 
 	// Get a response prefix (like 'Re:') in the default forum language.
@@ -1180,6 +1180,10 @@ function Post2()
 		}
 	}
 
+	// Previewing? Go back to start.
+	if (isset($_REQUEST['preview']))
+		return Post();
+
 	// Previewing? Go back to start.
 	if (isset($_REQUEST['preview']))
 		return Post();