Skip to content

Node.js based forum software built for the modern web

dont allow move to same topic

barisusaklida4014eb71f1
diff --git a/src/topics/fork.js b/src/topics/fork.js
index 20f0d8abce..0a50cbb6c7 100644
--- a/src/topics/fork.js
+++ b/src/topics/fork.js
@@ -86,6 +86,11 @@ module.exports = function(Topics) {
if (!post || !post.tid) {
return next(new Error('[[error:no-post]]'));
}
+
+ if (parseInt(post.tid, 10) === parseInt(tid, 10)) {
+ return next(new Error('[[error:cant-move-to-same-topic]]'))
+ }
+
postData = post;
postData.pid = pid;