Conta Excluída
KPCKevin Powell - Community
•Created by MD on 3/9/2024 in #back-end
When to use htmlspecialchars vs filter_input ?
So, in response to your inquiry,
filter_input
can also be used to prevent XSS attacks (provided you use an appropriate sanitization filter).
However, I recommend not escaping user input before saving it to the database. It's better to save the user input as is, and then only escape it when it's being rendered/echoed to a browser.11 replies
KPCKevin Powell - Community
•Created by MD on 3/9/2024 in #back-end
When to use htmlspecialchars vs filter_input ?
Yes,
htmlspecialchars
can also be used for that.11 replies
KPCKevin Powell - Community
•Created by MD on 3/9/2024 in #back-end
When to use htmlspecialchars vs filter_input ?
The main reason I can think of is that
htmlspecialchars
exists in PHP for a long time and it has been retained for backwards compatibility, but that function has been generalized by the filter_input
function as of PHP 5.2.
While the htmlspecialchars
will convert characters specific to HTML, such as the <
and >
to their equivalent HTML entity (<
and >
), the filter_input
is configurable in regards to the type of filtering that it should perform.
It can be made to behave in the same manner as the old htmlspecialchars
by using the FILTER_SANITIZE_FULL_SPECIAL_CHARS
. But there are many other filters available.
For example, it's also typically used to validate email addresses:
11 replies
KPCKevin Powell - Community
•Created by internal_error_ on 3/9/2024 in #os-and-tools
Error message regarding label tag element
Oh, yeah, my bad.
22 replies
KPCKevin Powell - Community
•Created by internal_error_ on 3/9/2024 in #os-and-tools
Error message regarding label tag element
Try disabling each one of them until you find the one causing the error message to appear
22 replies
KPCKevin Powell - Community
•Created by internal_error_ on 3/9/2024 in #os-and-tools
Error message regarding label tag element
Another extension might provide the same rules.
22 replies
KPCKevin Powell - Community
•Created by internal_error_ on 3/9/2024 in #os-and-tools
Error message regarding label tag element
Well, which ones do you have installed?
22 replies
KPCKevin Powell - Community
•Created by M Rashaad Hartley on 3/8/2024 in #os-and-tools
VS Code
Not as far as I know.
In fact, when you create a
New Text File
, no file is really created on your computer. A file is only created after it is saved.
The New Text File
command simply creates a new editor tab for temporary modification.11 replies