mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 11:05:54 +01:00 
			
		
		
		
	only use multipart on upload routes,
delete temp files if there is an error in admin, admin/mods should see topic reply
This commit is contained in:
		| @@ -1,11 +1,11 @@ | ||||
| "use strict"; | ||||
|  | ||||
| var utils = require('./../../public/src/utils'), | ||||
| 	meta = require('./../meta'), | ||||
| 	plugins = require('./../plugins'), | ||||
| 	db = require('./../database'), | ||||
| 	auth = require('./../routes/authentication'), | ||||
| 	emitter = require('./../emitter'), | ||||
| var utils = require('../../public/src/utils'), | ||||
| 	meta = require('../meta'), | ||||
| 	plugins = require('../plugins'), | ||||
| 	db = require('../database'), | ||||
| 	auth = require('../routes/authentication'), | ||||
| 	emitter = require('../emitter'), | ||||
|  | ||||
| 	async = require('async'), | ||||
| 	path = require('path'), | ||||
| @@ -19,7 +19,6 @@ var utils = require('./../../public/src/utils'), | ||||
| 	cookieParser = require('cookie-parser'), | ||||
| 	compression = require('compression'), | ||||
| 	favicon = require('serve-favicon'), | ||||
| 	multipart = require('connect-multiparty'), | ||||
| 	session = require('express-session'), | ||||
| 	cluster = require('cluster'), | ||||
|  | ||||
| @@ -31,7 +30,7 @@ var middleware = {}; | ||||
|  | ||||
| function routeCurrentTheme(app, themeId, themesData) { | ||||
| 	themeId = (themeId || 'nodebb-theme-vanilla'); | ||||
| 	 | ||||
|  | ||||
| 	var	themeObj = (function(id) { | ||||
| 			return themesData.filter(function(themeObj) { | ||||
| 				return themeObj.id === id; | ||||
| @@ -49,7 +48,7 @@ function routeCurrentTheme(app, themeId, themesData) { | ||||
| function setupFavicon(app) { | ||||
| 	var faviconPath = path.join(__dirname, '../../', 'public', meta.config['brand:favicon'] ? meta.config['brand:favicon'] : 'favicon.ico'); | ||||
| 	if (fs.existsSync(faviconPath)) { | ||||
| 		app.use(favicon(faviconPath));	 | ||||
| 		app.use(favicon(faviconPath)); | ||||
| 	} | ||||
| } | ||||
|  | ||||
| @@ -70,7 +69,7 @@ module.exports = function(app, data) { | ||||
| 	app.use(compression()); | ||||
|  | ||||
| 	setupFavicon(app); | ||||
| 	 | ||||
|  | ||||
| 	app.use(relativePath + '/apple-touch-icon', middleware.routeTouchIcon); | ||||
|  | ||||
| 	app.use(bodyParser.urlencoded({extended: true})); | ||||
| @@ -93,8 +92,6 @@ module.exports = function(app, data) { | ||||
| 		saveUninitialized: true | ||||
| 	})); | ||||
|  | ||||
| 	app.use(multipart()); | ||||
|  | ||||
| 	app.use(function (req, res, next) { | ||||
| 		res.setHeader('X-Powered-By', 'NodeBB'); | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user