diff --git a/library/attach_mod/includes/functions_attach.php b/library/attach_mod/includes/functions_attach.php index c5bf4ab87..0933c5e24 100644 --- a/library/attach_mod/includes/functions_attach.php +++ b/library/attach_mod/includes/functions_attach.php @@ -114,7 +114,7 @@ function auth_unpack($auth_cache) $auth = []; $auth_len = 1; - for ($pos = 0; $pos < strlen($auth_cache); $pos += $auth_len) { + for ($pos = 0, $posMax = strlen($auth_cache); $pos < $posMax; $pos += $auth_len) { $forum_auth = $auth_cache[$pos]; if ($forum_auth == $one_char_encoding) { $auth_len = 1; @@ -149,7 +149,7 @@ function is_forum_authed($auth_cache, $check_forum_id) $auth = []; $auth_len = 1; - for ($pos = 0; $pos < strlen($auth_cache); $pos += $auth_len) { + for ($pos = 0, $posMax = strlen($auth_cache); $pos < $posMax; $pos += $auth_len) { $forum_auth = $auth_cache[$pos]; if ($forum_auth == $one_char_encoding) { $auth_len = 1; diff --git a/privmsg.php b/privmsg.php index 5e87c9213..8df644ad9 100644 --- a/privmsg.php +++ b/privmsg.php @@ -1288,7 +1288,7 @@ if ($mode == 'read') { $previous_days_text = array($lang['ALL_POSTS'], $lang['1_DAY'], $lang['7_DAYS'], $lang['2_WEEKS'], $lang['1_MONTH'], $lang['3_MONTHS'], $lang['6_MONTHS'], $lang['1_YEAR']); $select_msg_days = ''; - for ($i = 0; $i < count($previous_days); $i++) { + for ($i = 0, $iMax = count($previous_days); $i < $iMax; $i++) { $selected = ($msg_days == $previous_days[$i]) ? ' selected="selected"' : ''; $select_msg_days .= ''; }