Skip to content

Quote in search input crashes server #757

@mcdamo

Description

@mcdamo

Describe the bug

Entering a quote " in search text crashes the server. For example typing "tokyo tower"

Photo/video (optional) that causes the bug

N/A

Screenshots (optional)

N/A

Server logs (optional)

undefined:1 
{"type":100,"text":"/"tokyo tower/""} 
                      ^ 
 
SyntaxError: Unexpected token t in JSON at position 22 
    at JSON.parse (<anonymous>) 
    at search (/usr/home/pigallery/pigallery2/src/backend/middlewares/GalleryMWs.js:156:28) 
    at Layer.handle [as handle_request] (/usr/home/pigallery/pigallery2/node_modules/express/lib/router/layer.js:95:5)    at next (/usr/home/pigallery/pigallery2/node_modules/express/lib/router/route.js:144:13)
    at injectGalleryVersion (/usr/home/pigallery/pigallery2/src/backend/middlewares/VersionMWs.js:14:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)                        
                                                                                                                      
Node.js v18.18.2

Environment (please complete the following information):
FreeBSD 13

Used app version:
compiled from source 237e61c

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions