Skip to content
Snippets Groups Projects
Commit 72155f8b authored by Steven Wittens's avatar Steven Wittens
Browse files

Using drupal_specialchars() instead of htmlentities(). htmlentities() is not UTF-8 safe.

parent 7ebcac26
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -131,7 +131,7 @@ function profile_view_field($user, $field) { ...@@ -131,7 +131,7 @@ function profile_view_field($user, $field) {
case 'textarea': case 'textarea':
return check_output($value); return check_output($value);
case 'selection': case 'selection':
return l($value, "profile/$field->name/". htmlentities($value)); return l($value, "profile/$field->name/". drupal_specialchars($value));
case 'checkbox': case 'checkbox':
return l($field->title, "profile/$field->name"); return l($field->title, "profile/$field->name");
case 'url': case 'url':
...@@ -141,7 +141,7 @@ function profile_view_field($user, $field) { ...@@ -141,7 +141,7 @@ function profile_view_field($user, $field) {
$fields = array(); $fields = array();
foreach ($values as $value) { foreach ($values as $value) {
if ($value = trim(strip_tags($value))) { if ($value = trim(strip_tags($value))) {
$fields[] = l($value, "profile/$field->name/". htmlentities($value)); $fields[] = l($value, "profile/$field->name/". drupal_specialchars($value));
} }
} }
return implode(', ', $fields); return implode(', ', $fields);
...@@ -244,7 +244,7 @@ function profile_validate_profile($edit, $category) { ...@@ -244,7 +244,7 @@ function profile_validate_profile($edit, $category) {
function profile_categories() { function profile_categories() {
$result = db_query("SELECT DISTINCT(category) FROM {profile_fields}"); $result = db_query("SELECT DISTINCT(category) FROM {profile_fields}");
while ($category = db_fetch_object($result)) { while ($category = db_fetch_object($result)) {
$data[] = array('name' => htmlentities(strtolower($category->category)), 'title' => strtolower($category->category), 'weight' => 3); $data[] = array('name' => drupal_specialchars(strtolower($category->category)), 'title' => strtolower($category->category), 'weight' => 3);
} }
return $data; return $data;
} }
......
...@@ -131,7 +131,7 @@ function profile_view_field($user, $field) { ...@@ -131,7 +131,7 @@ function profile_view_field($user, $field) {
case 'textarea': case 'textarea':
return check_output($value); return check_output($value);
case 'selection': case 'selection':
return l($value, "profile/$field->name/". htmlentities($value)); return l($value, "profile/$field->name/". drupal_specialchars($value));
case 'checkbox': case 'checkbox':
return l($field->title, "profile/$field->name"); return l($field->title, "profile/$field->name");
case 'url': case 'url':
...@@ -141,7 +141,7 @@ function profile_view_field($user, $field) { ...@@ -141,7 +141,7 @@ function profile_view_field($user, $field) {
$fields = array(); $fields = array();
foreach ($values as $value) { foreach ($values as $value) {
if ($value = trim(strip_tags($value))) { if ($value = trim(strip_tags($value))) {
$fields[] = l($value, "profile/$field->name/". htmlentities($value)); $fields[] = l($value, "profile/$field->name/". drupal_specialchars($value));
} }
} }
return implode(', ', $fields); return implode(', ', $fields);
...@@ -244,7 +244,7 @@ function profile_validate_profile($edit, $category) { ...@@ -244,7 +244,7 @@ function profile_validate_profile($edit, $category) {
function profile_categories() { function profile_categories() {
$result = db_query("SELECT DISTINCT(category) FROM {profile_fields}"); $result = db_query("SELECT DISTINCT(category) FROM {profile_fields}");
while ($category = db_fetch_object($result)) { while ($category = db_fetch_object($result)) {
$data[] = array('name' => htmlentities(strtolower($category->category)), 'title' => strtolower($category->category), 'weight' => 3); $data[] = array('name' => drupal_specialchars(strtolower($category->category)), 'title' => strtolower($category->category), 'weight' => 3);
} }
return $data; return $data;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment