Skip to content

Commit

Permalink
Merge pull request #4377 from evertton/profile-fixes
Browse files Browse the repository at this point in the history
Profile fixes
  • Loading branch information
nilsteampassnet authored Sep 30, 2024
2 parents 5a0744f + c89d270 commit 1ffe4f7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
22 changes: 11 additions & 11 deletions pages/profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -396,19 +396,19 @@
</div>

<div class="form-group">
<label class="col-sm-10 control-label"><?php echo $lang->get('timezone_selection'); ?></label>
<label class="col-sm-10 control-label"><?php echo $lang->get('timezone_selection');?></label>
<div class="col-sm-10">
<select class="form-control" id="profile-user-timezone">
<?php
foreach ($zones as $key => $zone) {
echo '
<option value="' . $key . '"',
$session->has('user-timezone') && $session->get('user-timezone') && null !== $session->get('user-timezone') && $session->get('user-timezone') === $key ?
' selected' :
(isset($SETTINGS['timezone']) === true && $SETTINGS['timezone'] === $key ? ' selected' : ''),
'>' . $zone . '</option>';
}
?>
<?php foreach ($zones as $key => $zone): ?>
<option value="<?php echo $key; ?>"<?php
if ($session->has('user-timezone'))
if($session->get('user-timezone') === $key)
echo ' selected';
elseif ($session->get('user-timezone') === 'not_defined')
if (isset($SETTINGS['timezone']) && $SETTINGS['timezone'] === $key)
echo ' selected';
?>><?php echo $zone; ?></option>
<?php endforeach; ?>
</select>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion sources/users.queries.php
Original file line number Diff line number Diff line change
Expand Up @@ -2210,7 +2210,7 @@
);

// Prevent LFI.
$inputData['language'] = preg_replace('/[^a-z]/', "", $inputData['language']);
$inputData['language'] = preg_replace('/[^a-z_]/', "", $inputData['language']);

// Force english if non-existent language.
if (!file_exists(__DIR__."/../includes/language/".$inputData['language'].".php")) {
Expand Down

0 comments on commit 1ffe4f7

Please sign in to comment.