summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/profile.module9
-rw-r--r--modules/profile/profile.module9
2 files changed, 12 insertions, 6 deletions
diff --git a/modules/profile.module b/modules/profile.module
index 44d283167..df6e9fa2e 100644
--- a/modules/profile.module
+++ b/modules/profile.module
@@ -154,7 +154,8 @@ function profile_save_profile(&$edit, &$user, $category) {
$result = db_query('SELECT fid, name, type FROM {profile_fields} WHERE register = 1 ORDER BY category, weight');
}
else {
- $result = db_query("SELECT fid, name, type FROM {profile_fields} WHERE LOWER(category) = '%s'", strtolower($category));
+ $result = db_query("SELECT fid, name, type FROM {profile_fields} WHERE LOWER(category) = LOWER('%s')", $category);
+ // We use LOWER('%s') instead of PHP's strtolower() to avoid UTF-8 conversion issues.
}
while ($field = db_fetch_object($result)) {
if (_profile_field_serialize($field->type)) {
@@ -250,7 +251,8 @@ function profile_form_profile($edit, $user, $category) {
$result = db_query('SELECT * FROM {profile_fields} WHERE register = 1 ORDER BY category, weight');
}
else {
- $result = db_query("SELECT * FROM {profile_fields} WHERE LOWER(category) = '%s' ORDER BY weight", strtolower($category));
+ $result = db_query("SELECT * FROM {profile_fields} WHERE LOWER(category) = LOWER('%s') ORDER BY weight", $category);
+ // We use LOWER('%s') instead of PHP's strtolower() to avoid UTF-8 conversion issues.
}
$fields = array();
@@ -349,7 +351,8 @@ function profile_validate_profile($edit, $category) {
$result = db_query('SELECT * FROM {profile_fields} WHERE register = 1 ORDER BY category, weight');
}
else {
- $result = db_query("SELECT * FROM {profile_fields} WHERE LOWER(category) = '%s' ORDER BY weight", strtolower($category));
+ $result = db_query("SELECT * FROM {profile_fields} WHERE LOWER(category) = LOWER('%s') ORDER BY weight", $category);
+ // We use LOWER('%s') instead of PHP's strtolower() to avoid UTF-8 conversion issues.
}
while ($field = db_fetch_object($result)) {
diff --git a/modules/profile/profile.module b/modules/profile/profile.module
index 44d283167..df6e9fa2e 100644
--- a/modules/profile/profile.module
+++ b/modules/profile/profile.module
@@ -154,7 +154,8 @@ function profile_save_profile(&$edit, &$user, $category) {
$result = db_query('SELECT fid, name, type FROM {profile_fields} WHERE register = 1 ORDER BY category, weight');
}
else {
- $result = db_query("SELECT fid, name, type FROM {profile_fields} WHERE LOWER(category) = '%s'", strtolower($category));
+ $result = db_query("SELECT fid, name, type FROM {profile_fields} WHERE LOWER(category) = LOWER('%s')", $category);
+ // We use LOWER('%s') instead of PHP's strtolower() to avoid UTF-8 conversion issues.
}
while ($field = db_fetch_object($result)) {
if (_profile_field_serialize($field->type)) {
@@ -250,7 +251,8 @@ function profile_form_profile($edit, $user, $category) {
$result = db_query('SELECT * FROM {profile_fields} WHERE register = 1 ORDER BY category, weight');
}
else {
- $result = db_query("SELECT * FROM {profile_fields} WHERE LOWER(category) = '%s' ORDER BY weight", strtolower($category));
+ $result = db_query("SELECT * FROM {profile_fields} WHERE LOWER(category) = LOWER('%s') ORDER BY weight", $category);
+ // We use LOWER('%s') instead of PHP's strtolower() to avoid UTF-8 conversion issues.
}
$fields = array();
@@ -349,7 +351,8 @@ function profile_validate_profile($edit, $category) {
$result = db_query('SELECT * FROM {profile_fields} WHERE register = 1 ORDER BY category, weight');
}
else {
- $result = db_query("SELECT * FROM {profile_fields} WHERE LOWER(category) = '%s' ORDER BY weight", strtolower($category));
+ $result = db_query("SELECT * FROM {profile_fields} WHERE LOWER(category) = LOWER('%s') ORDER BY weight", $category);
+ // We use LOWER('%s') instead of PHP's strtolower() to avoid UTF-8 conversion issues.
}
while ($field = db_fetch_object($result)) {