Fix error on publishing single quotes
This commit is contained in:
parent
92c6bea0fb
commit
375fdf887c
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
session_start();
|
||||
include("../include/settings.php");
|
||||
|
||||
$db = new SQLite3('../ask.db');
|
||||
|
||||
|
@ -16,12 +17,13 @@ if(isset($_POST["post-submit"])){
|
|||
else{
|
||||
$u = $p_user["id"];
|
||||
$by = 0;
|
||||
$question = htmlspecialchars($_POST["post-text"]);
|
||||
$question = htmlspecialchars($_POST["post-text"], ENT_QUOTES);
|
||||
|
||||
// Insert user into DB
|
||||
$db->exec("INSERT INTO questions(user,by,question,answered,date) VALUES ('$u','$by','$question',0,". strtotime('now') .");");
|
||||
unset($_POST["post-text"]);
|
||||
header("Location: /user/" . $p_user["username"]);
|
||||
if($fancy_urls) header("Location: /user/" . $p_user["username"]);
|
||||
else header("Location: /user.php?q=" . $p_user["username"]);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
Loading…
Reference in New Issue