mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 03:26:04 +01:00
fix: escape hook method
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
const validator = require('validator');
|
||||||
var plugins = require('../../plugins');
|
var plugins = require('../../plugins');
|
||||||
|
|
||||||
var hooksController = module.exports;
|
var hooksController = module.exports;
|
||||||
@@ -18,7 +19,7 @@ hooksController.get = function (req, res) {
|
|||||||
current.methods.push({
|
current.methods.push({
|
||||||
id: hookData.id,
|
id: hookData.id,
|
||||||
priority: hookData.priority,
|
priority: hookData.priority,
|
||||||
method: hookData.method ? hookData.method.toString() : 'No plugin function!',
|
method: hookData.method ? validator.escape(hookData.method.toString()) : 'No plugin function!',
|
||||||
index: hookIndex + '-code-' + methodIndex,
|
index: hookIndex + '-code-' + methodIndex,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user