Skip to content

Commit

Permalink
Refactored some code lines that were too long.
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-milette committed Jul 23, 2024
1 parent 67ee59d commit fa0c46e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,8 @@ private function getuserprofilefields($user, $fields = []) {
foreach ($fields as $field) {
// Skip fields that don't exist (likely a typo).
if (isset($user->$field)) {
$profilefields[$field] = (object)['shortname' => $field, 'visible' => '1', 'datatype' => 'text', 'value' => $user->$field];
$profilefields[$field] = (object)['shortname' => $field, 'visible' => '1',
'datatype' => 'text', 'value' => $user->$field];
}
}
$lastfields = $fields;
Expand Down Expand Up @@ -3930,7 +3931,8 @@ function ($matches) use ($USER) {
// Requires content between tags.
if (stripos($text, '{/ifprofile}') !== false) {
// Retrieve all custom profile fields and specified core fields.
$corefields = ['id', 'username', 'auth', 'idnumber', 'email', 'institution', 'department', 'city', 'country', 'timezone', 'lang'];
$corefields = ['id', 'username', 'auth', 'idnumber', 'email', 'institution',
'department', 'city', 'country', 'timezone', 'lang'];
$profilefields = $this->getuserprofilefields($USER, $corefields);

// Find all ifprofile tags.
Expand Down

0 comments on commit fa0c46e

Please sign in to comment.