php - Do I need to sanitize strings used to declare geometric shapes? -
I want a SQL function to get a string, such as point_str = "47.572820 -34.628906"
. Inside the function, the string will be converted into a shape variable, for example SET xpoint = PointFromText (concat ("POINT (", point_str, ")"));
Before sending this string from php to sql, do i need to hybridize it (for example floatval
)?
You can throw an error on both situations; Either when the text is read, then when it is read when the data is read and the function fails, then all the visitors of that page will see the error.
If you put an error on creation, there is only one person who will never get the wrong data in your database as well as error. If input is dependent on input, make sure input is suitable for output and compress it.
Comments
Post a Comment