danielbrendel / hortusfox-web

Self-hosted collaborative plant management and tracking system for plant enthusiasts
https://www.hortusfox.com
MIT License
674 stars 34 forks source link

Mysql Error from using Apostrophe in name. #237

Closed tumeden closed 4 months ago

tumeden commented 4 months ago

Describe the bug Mysql error caused from using apostrophe in name.

To Reproduce Add a name including an apostrophe to an inventory item name example: Grampy's Soil

Expected behavior For you to be able to use an apostrophe

Screenshots image

More details An string or a sql statement with an apostrophe becomes a unclosed string because of the presence of that single 'quote'

Software: HortusFox v3.2 PHP Version: 8.3.0 MySQL Version: 9.0.0

danielbrendel commented 4 months ago

Works flawlessly with MariaDB. Trying to reproduce with MySQL.

Edit: Works without problems using MySQL 9.0.0.

danielbrendel commented 4 months ago

@tumeden I see now what's happening. The problem is that when you tried to add the item to your inventory using the group identified via the token 300, it appears that the group item does not exist. That's why you get that message. The message Invalid group token: 300 indicates that there is no such group with the given token. It might be that someone deleted the group before you tried to add an inventory item while your page was not refreshed, so the group was still in list.

danielbrendel commented 4 months ago

Resolved via 56abc5f3da0a302c2c4ff67dc9c5f1c6941b1b58