Skip to content

Commit 4f7b5eb

Browse files
committed
Skill: filter HTML when saving profiles
1 parent 6730eb2 commit 4f7b5eb

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

Diff for: main/inc/lib/skill.lib.php

+11-5
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,14 @@ public function updateProfileInfo($profileId, $name, $description)
6363
$name = Database::escape_string($name);
6464
$description = Database::escape_string($description);
6565

66-
$sql = "UPDATE $this->table SET
67-
name = '$name',
68-
description = '$description'
69-
WHERE id = $profileId ";
70-
Database::query($sql);
66+
Database::update(
67+
$this->table,
68+
[
69+
'name' => html_filter($name),
70+
'description' => html_filter($description),
71+
],
72+
['id = ?' => $profileId]
73+
);
7174

7275
return true;
7376
}
@@ -83,6 +86,9 @@ public function updateProfileInfo($profileId, $name, $description)
8386
public function save($params, $show_query = false)
8487
{
8588
if (!empty($params)) {
89+
$params['name'] = html_filter($params['name']);
90+
$params['description'] = html_filter($params['description']);
91+
8692
$profile_id = parent::save($params, $show_query);
8793
if ($profile_id) {
8894
$skill_rel_profile = new SkillRelProfile();

0 commit comments

Comments
 (0)