Lets say you get a string from user input and store in into a database. Later you retrieve that string and populate a new form input's value with that string. Is there any XSS danger without any sanitization, if so, what is the best way with minimal disruption to the original input.
$str = $_POST['string'];
// INSERT $str INTO MYSQL
// LATER
$string = // database fetched string
<input type="text" name="data" value="<?= $string ?>" /> // << XSS vulnerable?