Callable calls in loops termination condition.

This commit is contained in:
Yuriy Pikhtarev 2017-06-25 17:00:25 +03:00
commit f779fb3896
No known key found for this signature in database
GPG key ID: 3A9B5A757B48ECC6
2 changed files with 3 additions and 3 deletions

View file

@ -114,7 +114,7 @@ function auth_unpack($auth_cache)
$auth = []; $auth = [];
$auth_len = 1; $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]; $forum_auth = $auth_cache[$pos];
if ($forum_auth == $one_char_encoding) { if ($forum_auth == $one_char_encoding) {
$auth_len = 1; $auth_len = 1;
@ -149,7 +149,7 @@ function is_forum_authed($auth_cache, $check_forum_id)
$auth = []; $auth = [];
$auth_len = 1; $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]; $forum_auth = $auth_cache[$pos];
if ($forum_auth == $one_char_encoding) { if ($forum_auth == $one_char_encoding) {
$auth_len = 1; $auth_len = 1;

View file

@ -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']); $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 = ''; $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"' : ''; $selected = ($msg_days == $previous_days[$i]) ? ' selected="selected"' : '';
$select_msg_days .= '<option value="' . $previous_days[$i] . '"' . $selected . '>' . $previous_days_text[$i] . '</option>'; $select_msg_days .= '<option value="' . $previous_days[$i] . '"' . $selected . '>' . $previous_days_text[$i] . '</option>';
} }