Safen User Input Part I - htmlspecialchars
Description:
Safen User Input Part I - htmlspecialchars
You are a(n) novice/average/experienced/professional/world-famous Web Developer (choose one) who owns a(n) simple/clean/slick/beautiful/complicated/professional/business website (choose one or more) which contains form fields so visitors can send emails or leave a comment on your website with ease. However, with ease comes danger. Every now and then, a hacker visits your website and attempts to compromise it through the use of XSS (Cross Site Scripting). This is done by injecting script
tags into the website through form fields which may contain malicious code (e.g. a redirection to a malicious website that steals personal information).
Mission
Your mission is to implement a function that converts the following potentially harmful characters:
<
--><
>
-->>
"
-->"
&
-->&
Good luck :D
Similar Kata:
Stats:
Created | Feb 11, 2016 |
Published | Feb 11, 2016 |
Warriors Trained | 15790 |
Total Skips | 449 |
Total Code Submissions | 31079 |
Total Times Completed | 9462 |
JavaScript Completions | 4982 |
TypeScript Completions | 503 |
CoffeeScript Completions | 25 |
Rust Completions | 662 |
Python Completions | 3399 |
Ruby Completions | 173 |
RISC-V Completions | 20 |
Scala Completions | 11 |
Total Stars | 165 |
% of votes with a positive feedback rating | 91% of 1154 |
Total "Very Satisfied" Votes | 989 |
Total "Somewhat Satisfied" Votes | 124 |
Total "Not Satisfied" Votes | 41 |