Skip to content

Commit

Permalink
Merge pull request SimpleMachines#8275 from Sesquipedalian/2.1/misc
Browse files Browse the repository at this point in the history
2.1/misc
  • Loading branch information
Sesquipedalian authored Jul 1, 2024
2 parents 22c12cd + 6ba0a42 commit 055c2e9
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Sources/ManageMaintenance.php
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@ function AdminBoardRecount()
validateToken(!isset($_REQUEST['step']) ? 'admin-maint' : 'admin-boardrecount');
$context['not_done_token'] = 'admin-boardrecount';
createToken($context['not_done_token']);

$context['page_title'] = $txt['not_done_title'];
$context['continue_post_data'] = '';
$context['continue_countdown'] = 3;
Expand Down
2 changes: 1 addition & 1 deletion Sources/Profile-View.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ function fetch_alerts($memID, $to_fetch = false, $limit = 0, $offset = 0, $with_
// Basic sanitation.
$memID = (int) $memID;
$unread = $to_fetch === false;

if (empty($limit) || $limit > 1000)
$limit = min(!empty($modSettings['alerts_per_page']) && (int) $modSettings['alerts_per_page'] < 1000 ? (int) $modSettings['alerts_per_page'] : 1000, 1000);

Expand Down
10 changes: 7 additions & 3 deletions Sources/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function loadSession()
@ini_set('session.serialize_handler', 'php_serialize');
if (ini_get('session.serialize_handler') != 'php_serialize')
@ini_set('session.serialize_handler', 'php');

$context['session_handler'] = new SmfSessionHandler();
session_set_save_handler($context['session_handler'], true);

Expand Down Expand Up @@ -101,8 +101,12 @@ function loadSession()
* Class SmfSessionHandler
*
* An implementation of the SessionHandler
* Note: To support PHP 8.x ,we use the attribute ReturnTypeWillChange. When 8.1 is the miniumn, this can be removed.
* Note: To support PHP 7.x, we do not use type hints as SessionHandlerInterface does not have them.
*
* Note: To support PHP 8.x, we use the attribute ReturnTypeWillChange. When
* 8.1 is the miniumn, this can be removed.
*
* Note: To support PHP 7.x, we do not use type hints as SessionHandlerInterface
* does not have them.
*/
class SmfSessionHandler extends SessionHandler implements SessionHandlerInterface, SessionIdInterface
{
Expand Down
2 changes: 1 addition & 1 deletion Sources/Subs-Attachments.php
Original file line number Diff line number Diff line change
Expand Up @@ -1403,7 +1403,7 @@ function prepareAttachsByMsg($msgIDs)
if (!empty($msgIDs) || !empty($_SESSION['attachments_can_preview']))
{
// Where clause - there may or may not be msg ids, & may or may not be attachs to preview,
// depending on post vs edit, inserted or not, preview or not, post error or not, etc.
// depending on post vs edit, inserted or not, preview or not, post error or not, etc.
// Either way, they may be needed in a display of a list of posts or in the dropzone 'mock' list of thumbnails.
$msg_or_att = '';
if (!empty($msgIDs))
Expand Down
2 changes: 1 addition & 1 deletion Sources/Subs-Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,7 @@ function smf_setcookie($name, $value = '', $expire = 0, $path = '', $domain = ''
'path' => $path,
'domain' => $domain,
'secure' => $secure,
'httponly' => $httponly,
'httponly' => $httponly,
'samesite' => $samesite
));
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/Subs-Graphics.php
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ function resizeImage($src_img, $destName, $src_width, $src_height, $max_width, $
elseif (!empty($preferred_format) && ($preferred_format == 15) && function_exists('imagewbmp'))
$success = imagewbmp($dst_img, $destName);
elseif (!empty($preferred_format) && ($preferred_format == 18) && function_exists('imagewebp'))
$success = imagewebp($dst_img, $destName);
$success = imagewebp($dst_img, $destName);
elseif (function_exists('imagejpeg'))
$success = imagejpeg($dst_img, $destName, !empty($modSettings['avatar_jpeg_quality']) ? $modSettings['avatar_jpeg_quality'] : 82);

Expand Down
2 changes: 1 addition & 1 deletion Sources/Subs-Membergroups.php
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ function addMembersToGroup($members, $group, $type = 'auto', $permissionCheckDon
if ($is_protected == 1)
return false;
}

// Do the actual updates.
if ($type == 'only_additional')
$smcFunc['db_query']('', '
Expand Down
2 changes: 1 addition & 1 deletion Sources/Subs.php
Original file line number Diff line number Diff line change
Expand Up @@ -5853,7 +5853,7 @@ function add_integration_function($hook, $function, $permanent = true, $file = '

// Cleanup enabled/disabled variants before taking action.
$current_functions = array_diff($current_functions, array($enabled_call, $disabled_call));

$permanent_functions = array_unique(array_merge($current_functions, array($integration_call)));
}
else
Expand Down
2 changes: 1 addition & 1 deletion Sources/tasks/CreatePost-Notify.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public function execute()
mem.email_address, mem.lngfile, mem.pm_ignore_list,
mem.id_group, mem.id_post_group, mem.additional_groups,
mem.time_format, mem.time_offset, mem.timezone,
b.member_groups, t.id_member_started, t.id_member_updated
t.id_member_started, t.id_member_updated
FROM {db_prefix}log_notify AS ln
INNER JOIN {db_prefix}members AS mem ON (ln.id_member = mem.id_member)
LEFT JOIN {db_prefix}topics AS t ON (t.id_topic = ln.id_topic)
Expand Down
2 changes: 1 addition & 1 deletion other/upgrade_2-1_mysql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ if (!empty($modSettings['currentAttachmentUploadDir']) && !is_array($modSettings
$modSettings['attachmentUploadDir'] = @json_decode($modSettings['attachmentUploadDir'], true);

// No need to do this if we already did it previously... Unless requested...
if (empty($modSettings['attachments_21_done']) || !empty($upcontext['reprocess_attachments']))
if (empty($modSettings['attachments_21_done']) || !empty($upcontext['reprocess_attachments']))
$is_done = false;
else
$is_done = true;
Expand Down

0 comments on commit 055c2e9

Please sign in to comment.