TypeError: Object #<Object> has no method 'escape'



  • source: the latest master code.

    /home/anderson/projects/forum.zaijiajiaoyu.net/node_modules/redis/index.js:535
                throw err;
                      ^
    TypeError: Object #<Object> has no method 'escape'
        at /home/anderson/projects/forum.zaijiajiaoyu.net/src/topics.js:318:28
        at try_callback (/home/anderson/projects/forum.zaijiajiaoyu.net/node_modules/redis/index.js:532:9)
        at RedisClient.return_reply (/home/anderson/projects/forum.zaijiajiaoyu.net/node_modules/redis/index.js:614:13)
        at HiredisReplyParser.<anonymous> (/home/anderson/projects/forum.zaijiajiaoyu.net/node_modules/redis/index.js:266:14)
        at HiredisReplyParser.EventEmitter.emit (events.js:95:17)
        at HiredisReplyParser.execute (/home/anderson/projects/forum.zaijiajiaoyu.net/node_modules/redis/lib/parser/hiredis.js:43:18)
        at RedisClient.on_data (/home/anderson/projects/forum.zaijiajiaoyu.net/node_modules/redis/index.js:488:27)
        at Socket.<anonymous> (/home/anderson/projects/forum.zaijiajiaoyu.net/node_modules/redis/index.js:82:14)
        at Socket.EventEmitter.emit (events.js:95:17)
        at Socket.<anonymous> (_stream_readable.js:746:14)
    

    change src/topics.js:318 from:

        data.title = validator.escape(data.title);
    

    to:

        data.title = data.title; //validator.escape(data.title);
    

    It works now.


  • GNU/Linux Admin

    @anderson916 Looks like your version of validator is out of date. Please run ./nodebb upgrade



  • yes, it works.


Log in to reply
 

Suggested Topics

| |