Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Profile fixes #4377

Merged
merged 3 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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