mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 11:05:54 +01:00 
			
		
		
		
	upgraded categories to sorted set, score is the order set from acp, check if category topic exists before posting
This commit is contained in:
		
							
								
								
									
										36
									
								
								src/posts.js
									
									
									
									
									
								
							
							
						
						
									
										36
									
								
								src/posts.js
									
									
									
									
									
								
							| @@ -87,7 +87,7 @@ var db = require('./database'), | ||||
| 			function(postData, next) { | ||||
| 				postTools.parse(postData.content, function(err, content) { | ||||
| 					if(err) { | ||||
| 						return next(err, null); | ||||
| 						return next(err); | ||||
| 					} | ||||
|  | ||||
| 					postData.content = content; | ||||
| @@ -303,24 +303,24 @@ var db = require('./database'), | ||||
| 					}); | ||||
| 				}, | ||||
| 				function(postData, next) { | ||||
| 					if (postData.content) { | ||||
| 						postTools.parse(postData.content, function(err, content) { | ||||
| 							if(err) { | ||||
| 								return next(err); | ||||
| 							} | ||||
|  | ||||
| 							if(stripTags) { | ||||
| 								var s = S(content); | ||||
| 								postData.content = s.stripTags.apply(s, utils.getTagsExcept(['img', 'i'])).s; | ||||
| 							} else { | ||||
| 								postData.content = content; | ||||
| 							} | ||||
|  | ||||
| 							next(null, postData); | ||||
| 						}); | ||||
| 					} else { | ||||
| 						next(null, postData); | ||||
| 					if (!postData.content) { | ||||
| 						return next(null, postData); | ||||
| 					} | ||||
|  | ||||
| 					postTools.parse(postData.content, function(err, content) { | ||||
| 						if(err) { | ||||
| 							return next(err); | ||||
| 						} | ||||
|  | ||||
| 						if(stripTags) { | ||||
| 							var s = S(content); | ||||
| 							postData.content = s.stripTags.apply(s, utils.getTagsExcept(['img', 'i'])).s; | ||||
| 						} else { | ||||
| 							postData.content = content; | ||||
| 						} | ||||
|  | ||||
| 						next(null, postData); | ||||
| 					}); | ||||
| 				} | ||||
| 			], callback); | ||||
| 		} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user