@ -83,14 +83,14 @@ class FaqModel
|
||||
public function addQuestion(int $room_id, string $question, string $nickname )
|
||||
{
|
||||
$stmnt = Database::getConnection()->prepare( 'INSERT INTO questions ( room_id, question, created_by ) VALUES ( :room_id, :question, :created_by )' );
|
||||
$stmnt->execute( array( 'room_id' => $room_id, 'question' => htmlspecialchars( $question ), 'created_by' => $nickname ) );
|
||||
$stmnt->execute( array( 'room_id' => $room_id, 'question' => htmlspecialchars($question, ENT_QUOTES, 'UTF-8'), 'created_by' => $nickname ) );
|
||||
|
||||
}
|
||||
|
||||
public function addAnswer(int $question_id, string $answer)
|
||||
{
|
||||
$stmnt = Database::getConnection()->prepare( 'UPDATE questions SET answer = :answer WHERE id = :id' );
|
||||
$stmnt->execute( array( 'answer' => htmlspecialchars( $answer ), 'id' => $question_id ) );
|
||||
$stmnt->execute( array( 'answer' => htmlspecialchars($answer, ENT_QUOTES, 'UTF-8'), 'id' => $question_id ) );
|
||||
|
||||
}
|
||||
|
||||
@ -123,7 +123,7 @@ class FaqModel
|
||||
{
|
||||
return false;
|
||||
}
|
||||
$result['question'] = str_replace( "\n", '<br>', $result['question'] );
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user