Skip to content

Commit

Permalink
MDL-73156 user: Custom user profile field names now filtered.
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-milette authored and Michael Milette committed Jun 15, 2022
1 parent 4a9fa42 commit 4b2efd4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions user/filters/profilefield.php
Expand Up @@ -77,6 +77,9 @@ public function get_profile_fields() {
require_once($CFG->dirroot . '/user/profile/lib.php');

$fieldrecords = profile_get_custom_fields();
foreach ($fieldrecords as $key => $fieldrecord) {
$fieldrecords[$key]->name = format_string($fieldrecords[$key]->name, false, ['context' => context_system::instance()]);
}
$fields = array_combine(array_keys($fieldrecords), array_column($fieldrecords, 'name'));
core_collator::asort($fields);
$res = array(0 => get_string('anyfield', 'filters'));
Expand Down

0 comments on commit 4b2efd4

Please sign in to comment.