pigallery2 icon indicating copy to clipboard operation
pigallery2 copied to clipboard

Quote in search input crashes server

Open mcdamo opened this issue 2 years ago • 2 comments

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 237e61c35083ddc73c2ef47ab1fb78c4e3c593ac

mcdamo avatar Nov 12 '23 04:11 mcdamo

That looks odd. Thanks for the report. I will fix it at some point

bpatrik avatar Nov 13 '23 16:11 bpatrik