@@ -355,8 +355,8 @@ |
||
| 355 | 355 | elseif (isset($_POST['delall']) && isset($filter)) |
| 356 | 356 | { |
| 357 | 357 | // ip need a different placeholder type |
| 358 | - $filter_type = $filter['variable'] == 'ip'? 'inet' : 'string'; |
|
| 359 | - $filter_op = $filter['variable'] == 'ip'? '=' : 'LIKE'; |
|
| 358 | + $filter_type = $filter['variable'] == 'ip' ? 'inet' : 'string'; |
|
| 359 | + $filter_op = $filter['variable'] == 'ip' ? '=' : 'LIKE'; |
|
| 360 | 360 | $smcFunc['db_query']('', ' |
| 361 | 361 | DELETE FROM {db_prefix}log_errors |
| 362 | 362 | WHERE ' . $filter['variable'] . ' ' . $filter_op . ' {' . $filter_type . ':filter}', |
@@ -163,7 +163,8 @@ |
||
| 163 | 163 | else |
| 164 | 164 | $context['help_text'] = $_GET['help']; |
| 165 | 165 | |
| 166 | - switch ($_GET['help']) { |
|
| 166 | + switch ($_GET['help']) |
|
| 167 | + { |
|
| 167 | 168 | case 'cal_short_months': |
| 168 | 169 | $context['help_text'] = sprintf($context['help_text'], $txt['months_short'][1], $txt['months_titles'][1]); |
| 169 | 170 | break; |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | AND a.is_read = 0' : '') . (!empty($alertIDs) ? ' |
| 262 | 262 | AND a.id_alert IN ({array_int:alertIDs})' : '') . ' |
| 263 | 263 | ORDER BY id_alert DESC' . (!empty($limit) ? ' |
| 264 | - LIMIT {int:limit}' : '') . (!empty($offset) ?' |
|
| 264 | + LIMIT {int:limit}' : '') . (!empty($offset) ? ' |
|
| 265 | 265 | OFFSET {int:offset}' : ''), |
| 266 | 266 | array( |
| 267 | 267 | 'id_member' => $memID, |
@@ -1160,20 +1160,20 @@ discard block |
||
| 1160 | 1160 | $context['posts'][$key]['quickbuttons'] = array( |
| 1161 | 1161 | 'reply' => array( |
| 1162 | 1162 | 'label' => $txt['reply'], |
| 1163 | - 'href' => $scripturl.'?action=post;topic='.$post['topic'].'.'.$post['start'], |
|
| 1163 | + 'href' => $scripturl . '?action=post;topic=' . $post['topic'] . '.' . $post['start'], |
|
| 1164 | 1164 | 'icon' => 'reply_button', |
| 1165 | 1165 | 'show' => $post['can_reply'] |
| 1166 | 1166 | ), |
| 1167 | 1167 | 'quote' => array( |
| 1168 | 1168 | 'label' => $txt['quote_action'], |
| 1169 | - 'href' => $scripturl.'?action=post;topic='.$post['topic'].'.'.$post['start'].';quote='.$post['id'], |
|
| 1169 | + 'href' => $scripturl . '?action=post;topic=' . $post['topic'] . '.' . $post['start'] . ';quote=' . $post['id'], |
|
| 1170 | 1170 | 'icon' => 'quote', |
| 1171 | 1171 | 'show' => $post['can_quote'] |
| 1172 | 1172 | ), |
| 1173 | 1173 | 'remove' => array( |
| 1174 | 1174 | 'label' => $txt['remove'], |
| 1175 | - 'href' => $scripturl.'?action=deletemsg;msg='.$post['id'].';topic='.$post['topic'].';profile;u='.$context['member']['id'].';start='.$context['start'].';'.$context['session_var'].'='.$context['session_id'], |
|
| 1176 | - 'javascript' => 'data-confirm="'.$txt['remove_message'].'"', |
|
| 1175 | + 'href' => $scripturl . '?action=deletemsg;msg=' . $post['id'] . ';topic=' . $post['topic'] . ';profile;u=' . $context['member']['id'] . ';start=' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'], |
|
| 1176 | + 'javascript' => 'data-confirm="' . $txt['remove_message'] . '"', |
|
| 1177 | 1177 | 'class' => 'you_sure', |
| 1178 | 1178 | 'icon' => 'remove_button', |
| 1179 | 1179 | 'show' => $post['can_delete'] |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | |
| 204 | 204 | $feed_meta = array( |
| 205 | 205 | 'title' => sprintf($txt['profile_of_username'], $user_profile[$uid]['real_name']), |
| 206 | - 'desc' => sentence_list(array_map(function ($datatype) use ($txt) { return $txt[$datatype]; }, array_keys($included))), |
|
| 206 | + 'desc' => sentence_list(array_map(function($datatype) use ($txt) { return $txt[$datatype]; }, array_keys($included))), |
|
| 207 | 207 | 'author' => $mbname, |
| 208 | 208 | 'source' => $scripturl . '?action=profile;u=' . $uid, |
| 209 | 209 | 'self' => '', // Unused, but can't be null. |
@@ -723,7 +723,7 @@ discard block |
||
| 723 | 723 | 'src' => 'src="' . $currentAttachment['href'] . '" onerror="$(\'.dlattach_' . $currentAttachment['id'] . '\').show(); $(\'.dlattach_' . $currentAttachment['id'] . '\').css({\'position\': \'absolute\'});"', |
| 724 | 724 | ), |
| 725 | 725 | $returnContext |
| 726 | - ) . $hidden_orig_link . '</span>' ; |
|
| 726 | + ) . $hidden_orig_link . '</span>'; |
|
| 727 | 727 | } |
| 728 | 728 | elseif (strpos($currentAttachment['mime_type'], 'video/') === 0) |
| 729 | 729 | { |
@@ -203,7 +203,9 @@ |
||
| 203 | 203 | |
| 204 | 204 | $feed_meta = array( |
| 205 | 205 | 'title' => sprintf($txt['profile_of_username'], $user_profile[$uid]['real_name']), |
| 206 | - 'desc' => sentence_list(array_map(function ($datatype) use ($txt) { return $txt[$datatype]; }, array_keys($included))), |
|
| 206 | + 'desc' => sentence_list(array_map(function ($datatype) use ($txt) |
|
| 207 | + { |
|
| 208 | +return $txt[$datatype]; }, array_keys($included))), |
|
| 207 | 209 | 'author' => $mbname, |
| 208 | 210 | 'source' => $scripturl . '?action=profile;u=' . $uid, |
| 209 | 211 | 'self' => '', // Unused, but can't be null. |
@@ -393,17 +393,17 @@ discard block |
||
| 393 | 393 | $quickbuttons = array( |
| 394 | 394 | 'approve' => array( |
| 395 | 395 | 'label' => $txt['approve'], |
| 396 | - 'href' => $scripturl.'?action=moderate;area=postmod;sa='.$context['current_view'].';start='.$context['start'].';'.$context['session_var'].'='.$context['session_id'].';approve='.$item['id'], |
|
| 396 | + 'href' => $scripturl . '?action=moderate;area=postmod;sa=' . $context['current_view'] . ';start=' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'] . ';approve=' . $item['id'], |
|
| 397 | 397 | 'icon' => 'approve', |
| 398 | 398 | ), |
| 399 | 399 | 'delete' => array( |
| 400 | 400 | 'label' => $txt['remove'], |
| 401 | - 'href' => $scripturl.'?action=moderate;area=postmod;sa='.$context['current_view'].';start='.$context['start'].';'.$context['session_var'].'='.$context['session_id'].';delete='.$item['id'], |
|
| 401 | + 'href' => $scripturl . '?action=moderate;area=postmod;sa=' . $context['current_view'] . ';start=' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'] . ';delete=' . $item['id'], |
|
| 402 | 402 | 'icon' => 'remove_button', |
| 403 | 403 | 'show' => $item['can_delete'] |
| 404 | 404 | ), |
| 405 | 405 | 'quickmod' => array( |
| 406 | - 'content' => '<input type="checkbox" name="item[]" value="'.$item['id'].'" checked>', |
|
| 406 | + 'content' => '<input type="checkbox" name="item[]" value="' . $item['id'] . '" checked>', |
|
| 407 | 407 | 'show' => !empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 |
| 408 | 408 | ), |
| 409 | 409 | ); |
@@ -468,7 +468,7 @@ discard block |
||
| 468 | 468 | $quickbuttons = array( |
| 469 | 469 | 'delete' => array( |
| 470 | 470 | 'label' => $txt['remove_message'], |
| 471 | - 'href' => $scripturl.'?action=moderate;area=userwatch;sa=post;delete='.$post['id'].';start='.$context['start'].';'.$context['session_var'].'='.$context['session_id'], |
|
| 471 | + 'href' => $scripturl . '?action=moderate;area=userwatch;sa=post;delete=' . $post['id'] . ';start=' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'], |
|
| 472 | 472 | 'javascript' => 'data-confirm="' . $txt['mc_watched_users_delete_post'] . '"', |
| 473 | 473 | 'class' => 'you_sure', |
| 474 | 474 | 'icon' => 'remove_button', |
@@ -1721,7 +1721,7 @@ discard block |
||
| 1721 | 1721 | { |
| 1722 | 1722 | // Avoid double separators and empty titled sections |
| 1723 | 1723 | $empty_section = true; |
| 1724 | - for ($j=$i+1; $j < count($context['theme_options']); $j++) |
|
| 1724 | + for ($j = $i + 1; $j < count($context['theme_options']); $j++) |
|
| 1725 | 1725 | { |
| 1726 | 1726 | // Found another separator, so we're done |
| 1727 | 1727 | if (!is_array($context['theme_options'][$j])) |
@@ -2700,8 +2700,7 @@ discard block |
||
| 2700 | 2700 | foreach ($context['post_errors'] as $error) |
| 2701 | 2701 | { |
| 2702 | 2702 | $text_key_error = $error == 'password_short' ? |
| 2703 | - sprintf($txt['profile_error_' . $error], (empty($modSettings['password_strength']) ? 4 : 8)) : |
|
| 2704 | - $txt['profile_error_' . $error]; |
|
| 2703 | + sprintf($txt['profile_error_' . $error], (empty($modSettings['password_strength']) ? 4 : 8)) : $txt['profile_error_' . $error]; |
|
| 2705 | 2704 | |
| 2706 | 2705 | echo ' |
| 2707 | 2706 | <li>', isset($txt['profile_error_' . $error]) ? $text_key_error : $error, '</li>'; |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | // Set a list of common functions. |
| 105 | 105 | $ent_list = '&(?:#' . (empty($modSettings['disableEntityCheck']) ? '\d{1,7}' : '021') . '|quot|amp|lt|gt|nbsp);'; |
| 106 | 106 | $ent_check = empty($modSettings['disableEntityCheck']) ? function($string) |
| 107 | - { |
|
| 107 | + { |
|
| 108 | 108 | $string = preg_replace_callback('~(&#(\d{1,7}|x[0-9a-fA-F]{1,6});)~', 'entity_fix__callback', $string); |
| 109 | 109 | return $string; |
| 110 | 110 | } : function($string) |
@@ -929,7 +929,6 @@ discard block |
||
| 929 | 929 | $user_info_min[$row['id_member']]['time_offset'] = ($tz_user->getOffset($time_user) - |
| 930 | 930 | $tz_system->getOffset($time_system)) / 3600; |
| 931 | 931 | } |
| 932 | - |
|
| 933 | 932 | else |
| 934 | 933 | $user_info_min[$row['id_member']]['time_offset'] = empty($row['time_offset']) ? 0 : $row['time_offset']; |
| 935 | 934 | } |
@@ -1657,7 +1656,6 @@ discard block |
||
| 1657 | 1656 | $time_user = new DateTime('now', $tz_user); |
| 1658 | 1657 | $profile['time_offset'] = ($tz_user->getOffset($time_user) - $tz_system->getOffset($time_system)) / 3600; |
| 1659 | 1658 | } |
| 1660 | - |
|
| 1661 | 1659 | else |
| 1662 | 1660 | { |
| 1663 | 1661 | // !!! Compatibility. |
@@ -2351,7 +2349,6 @@ discard block |
||
| 2351 | 2349 | loadLanguage('index+Modifications'); |
| 2352 | 2350 | $context['template_layers'] = array(); |
| 2353 | 2351 | } |
| 2354 | - |
|
| 2355 | 2352 | else |
| 2356 | 2353 | { |
| 2357 | 2354 | // Custom templates to load, or just default? |
@@ -2718,8 +2718,7 @@ discard block |
||
| 2718 | 2718 | $context['css_files_order'] = array(); |
| 2719 | 2719 | |
| 2720 | 2720 | $params['seed'] = (!array_key_exists('seed', $params) || (array_key_exists('seed', $params) && $params['seed'] === true)) ? |
| 2721 | - (array_key_exists('browser_cache', $context) ? $context['browser_cache'] : '') : |
|
| 2722 | - (is_string($params['seed']) ? '?' . ltrim($params['seed'], '?') : ''); |
|
| 2721 | + (array_key_exists('browser_cache', $context) ? $context['browser_cache'] : '') : (is_string($params['seed']) ? '?' . ltrim($params['seed'], '?') : ''); |
|
| 2723 | 2722 | $params['force_current'] = isset($params['force_current']) ? $params['force_current'] : false; |
| 2724 | 2723 | $themeRef = !empty($params['default_theme']) ? 'default_theme' : 'theme'; |
| 2725 | 2724 | $params['minimize'] = isset($params['minimize']) ? $params['minimize'] : true; |
@@ -2833,8 +2832,7 @@ discard block |
||
| 2833 | 2832 | global $settings, $context, $modSettings; |
| 2834 | 2833 | |
| 2835 | 2834 | $params['seed'] = (!array_key_exists('seed', $params) || (array_key_exists('seed', $params) && $params['seed'] === true)) ? |
| 2836 | - (array_key_exists('browser_cache', $context) ? $context['browser_cache'] : '') : |
|
| 2837 | - (is_string($params['seed']) ? '?' . ltrim($params['seed'], '?') : ''); |
|
| 2835 | + (array_key_exists('browser_cache', $context) ? $context['browser_cache'] : '') : (is_string($params['seed']) ? '?' . ltrim($params['seed'], '?') : ''); |
|
| 2838 | 2836 | $params['force_current'] = isset($params['force_current']) ? $params['force_current'] : false; |
| 2839 | 2837 | $themeRef = !empty($params['default_theme']) ? 'default_theme' : 'theme'; |
| 2840 | 2838 | $params['async'] = isset($params['async']) ? $params['async'] : false; |
@@ -3577,8 +3575,7 @@ discard block |
||
| 3577 | 3575 | |
| 3578 | 3576 | // What accelerator we are going to try. |
| 3579 | 3577 | $cache_class_name = !empty($cache_accelerator) ? $cache_accelerator : CacheApi::APIS_DEFAULT; |
| 3580 | - $fully_qualified_class_name = !empty($overrideCache) ? $overrideCache : |
|
| 3581 | - CacheApi::APIS_NAMESPACE . $cache_class_name; |
|
| 3578 | + $fully_qualified_class_name = !empty($overrideCache) ? $overrideCache : CacheApi::APIS_NAMESPACE . $cache_class_name; |
|
| 3582 | 3579 | |
| 3583 | 3580 | // Do some basic tests. |
| 3584 | 3581 | if (class_exists($fully_qualified_class_name)) |
@@ -1860,25 +1860,25 @@ |
||
| 1860 | 1860 | $fields = array(); |
| 1861 | 1861 | $new_sort = array(); |
| 1862 | 1862 | |
| 1863 | - while($row = $smcFunc['db_fetch_assoc']($request)) |
|
| 1863 | + while ($row = $smcFunc['db_fetch_assoc']($request)) |
|
| 1864 | 1864 | $fields[] = $row['id_field']; |
| 1865 | 1865 | $smcFunc['db_free_result']($request); |
| 1866 | 1866 | |
| 1867 | 1867 | $idx = array_search($context['fid'], $fields); |
| 1868 | 1868 | |
| 1869 | - if ($_GET['move'] == 'down' && count($fields) - 1 > $idx ) |
|
| 1869 | + if ($_GET['move'] == 'down' && count($fields) - 1 > $idx) |
|
| 1870 | 1870 | { |
| 1871 | - $new_sort = array_slice($fields ,0 ,$idx ,true); |
|
| 1871 | + $new_sort = array_slice($fields, 0, $idx, true); |
|
| 1872 | 1872 | $new_sort[] = $fields[$idx + 1]; |
| 1873 | 1873 | $new_sort[] = $fields[$idx]; |
| 1874 | - $new_sort += array_slice($fields ,$idx + 2 ,count($fields) ,true); |
|
| 1874 | + $new_sort += array_slice($fields, $idx + 2, count($fields), true); |
|
| 1875 | 1875 | } |
| 1876 | 1876 | elseif ($context['fid'] > 0 and $idx < count($fields)) |
| 1877 | 1877 | { |
| 1878 | - $new_sort = array_slice($fields ,0 ,($idx - 1) ,true); |
|
| 1878 | + $new_sort = array_slice($fields, 0, ($idx - 1), true); |
|
| 1879 | 1879 | $new_sort[] = $fields[$idx]; |
| 1880 | 1880 | $new_sort[] = $fields[$idx - 1]; |
| 1881 | - $new_sort += array_slice($fields ,($idx + 1) ,count($fields) ,true); |
|
| 1881 | + $new_sort += array_slice($fields, ($idx + 1), count($fields), true); |
|
| 1882 | 1882 | } |
| 1883 | 1883 | else |
| 1884 | 1884 | redirectexit('action=admin;area=featuresettings;sa=profile'); // @todo implement an error handler |
@@ -320,7 +320,7 @@ |
||
| 320 | 320 | { |
| 321 | 321 | // PHPBB 3 check this function exists in PHP 5.5 or higher |
| 322 | 322 | if (function_exists('password_verify')) |
| 323 | - $other_passwords[] = password_verify($_POST['passwrd'],$user_settings['password_salt']); |
|
| 323 | + $other_passwords[] = password_verify($_POST['passwrd'], $user_settings['password_salt']); |
|
| 324 | 324 | |
| 325 | 325 | // PHP-Fusion |
| 326 | 326 | $other_passwords[] = hash_hmac('sha256', $_POST['passwrd'], $user_settings['password_salt']); |