mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 02:55:58 +01:00 
			
		
		
		
	removing restriction that caused hook system to go weird when arrays were
passed in as args
This commit is contained in:
		| @@ -155,8 +155,7 @@ var fs = require('fs'), | ||||
| 				var hookType = hook.split(':')[0]; | ||||
| 				switch (hookType) { | ||||
| 					case 'filter': | ||||
| 						// Filters only take one argument, so only args[0] will be passed in | ||||
| 						var returnVal = (Array.isArray(args) ? args[0] : args); | ||||
| 						var returnVal = args; | ||||
|  | ||||
| 						async.eachSeries(hookList, function(hookObj, next) { | ||||
| 							if (hookObj[2]) { | ||||
| @@ -197,7 +196,7 @@ var fs = require('fs'), | ||||
| 				} | ||||
| 			} else { | ||||
| 				// Otherwise, this hook contains no methods | ||||
| 				var returnVal = (Array.isArray(args) ? args[0] : args); | ||||
| 				var returnVal = args; | ||||
| 				if (callback) callback(null, returnVal); | ||||
| 			} | ||||
| 		}, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user