@@ -430,8 +430,8 @@ |
||
430 | 430 | $real_name = $smcFunc['db_case_sensitive'] ? 'LOWER(real_name)' : 'real_name'; |
431 | 431 | |
432 | 432 | // Searches. |
433 | - $member_name_search = $member_name . ' ' . $comparison . ' ' . implode( ' OR ' . $member_name . ' ' . $comparison . ' ', $names_list); |
|
434 | - $real_name_search = $real_name . ' ' . $comparison . ' ' . implode( ' OR ' . $real_name . ' ' . $comparison . ' ', $names_list); |
|
433 | + $member_name_search = $member_name . ' ' . $comparison . ' ' . implode(' OR ' . $member_name . ' ' . $comparison . ' ', $names_list); |
|
434 | + $real_name_search = $real_name . ' ' . $comparison . ' ' . implode(' OR ' . $real_name . ' ' . $comparison . ' ', $names_list); |
|
435 | 435 | |
436 | 436 | // Search by username, display name, and email address. |
437 | 437 | $request = $smcFunc['db_query']('', ' |
@@ -899,13 +899,13 @@ |
||
899 | 899 | if ($start_char === 'C') |
900 | 900 | $limit_seek = $limit; |
901 | 901 | else |
902 | - $limit_seek = $limit + 1; |
|
902 | + $limit_seek = $limit + 1; |
|
903 | 903 | |
904 | 904 | $request = $smcFunc['db_query']('', ' |
905 | 905 | SELECT id_msg, id_member, approved |
906 | 906 | FROM {db_prefix}messages |
907 | 907 | WHERE id_topic = {int:current_topic} |
908 | - AND id_msg '. $page_operator . ' {int:page_id}'. (!$modSettings['postmod_active'] || $approve_posts ? '' : ' |
|
908 | + AND id_msg '. $page_operator . ' {int:page_id}' . (!$modSettings['postmod_active'] || $approve_posts ? '' : ' |
|
909 | 909 | AND (approved = {int:is_approved}' . ($user_info['is_guest'] ? '' : ' OR id_member = {int:current_member}') . ')') . ' |
910 | 910 | ORDER BY id_msg ' . ($ascending_seek ? '' : 'DESC') . ($context['messages_per_page'] == -1 ? '' : ' |
911 | 911 | LIMIT {int:limit}'), |
@@ -23,21 +23,21 @@ discard block |
||
23 | 23 | * |
24 | 24 | * @return array The truncated array |
25 | 25 | */ |
26 | -function truncateArray($arr, $max_length=1900) |
|
26 | +function truncateArray($arr, $max_length = 1900) |
|
27 | 27 | { |
28 | 28 | $curr_length = 0; |
29 | 29 | foreach ($arr as $key => $value) |
30 | 30 | if (is_array($value)) |
31 | 31 | foreach ($value as $key2 => $value2) |
32 | - $curr_length += strlen ($value2); |
|
32 | + $curr_length += strlen($value2); |
|
33 | 33 | else |
34 | - $curr_length += strlen ($value); |
|
34 | + $curr_length += strlen($value); |
|
35 | 35 | if ($curr_length <= $max_length) |
36 | 36 | return $arr; |
37 | 37 | else |
38 | 38 | { |
39 | 39 | // Truncate each element's value to a reasonable length |
40 | - $param_max = floor($max_length/count($arr)); |
|
40 | + $param_max = floor($max_length / count($arr)); |
|
41 | 41 | foreach ($arr as $key => &$value) |
42 | 42 | if (is_array($value)) |
43 | 43 | foreach ($value as $key2 => &$value2) |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | if (filemtime($cachedir . '/db_last_error.php') === $last_db_error_change) |
208 | 208 | { |
209 | 209 | // Write the change |
210 | - $write_db_change = '<' . '?' . "php\n" . '$db_last_error = ' . time() . ';' . "\n" . '?' . '>'; |
|
210 | + $write_db_change = '<' . '?' . "php\n" . '$db_last_error = ' . time() . ';' . "\n" . '?' . '>'; |
|
211 | 211 | $written_bytes = file_put_contents($cachedir . '/db_last_error.php', $write_db_change, LOCK_EX); |
212 | 212 | |
213 | 213 | // survey says ... |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | ', $txt['debug_language_files'], count($context['debug']['language_files']), ': <em>', implode('</em>, <em>', $context['debug']['language_files']), '</em>.<br> |
281 | 281 | ', $txt['debug_stylesheets'], count($context['debug']['sheets']), ': <em>', implode('</em>, <em>', $context['debug']['sheets']), '</em>.<br> |
282 | 282 | ', $txt['debug_hooks'], empty($context['debug']['hooks']) ? 0 : count($context['debug']['hooks']) . ' (<a href="javascript:void(0);" onclick="document.getElementById(\'debug_hooks\').style.display = \'inline\'; this.style.display = \'none\'; return false;">', $txt['debug_show'], '</a><span id="debug_hooks" style="display: none;"><em>' . implode('</em>, <em>', $context['debug']['hooks']), '</em></span>)', '<br> |
283 | - ',(isset($context['debug']['instances']) ? ($txt['debug_instances'] . (empty($context['debug']['instances']) ? 0 : count($context['debug']['instances'])) . ' (<a href="javascript:void(0);" onclick="document.getElementById(\'debug_instances\').style.display = \'inline\'; this.style.display = \'none\'; return false;">'. $txt['debug_show'] .'</a><span id="debug_instances" style="display: none;"><em>'. implode('</em>, <em>', array_keys($context['debug']['instances'])) .'</em></span>)'. '<br>') : ''),' |
|
283 | + ',(isset($context['debug']['instances']) ? ($txt['debug_instances'] . (empty($context['debug']['instances']) ? 0 : count($context['debug']['instances'])) . ' (<a href="javascript:void(0);" onclick="document.getElementById(\'debug_instances\').style.display = \'inline\'; this.style.display = \'none\'; return false;">' . $txt['debug_show'] . '</a><span id="debug_instances" style="display: none;"><em>' . implode('</em>, <em>', array_keys($context['debug']['instances'])) . '</em></span>)' . '<br>') : ''), ' |
|
284 | 284 | ', $txt['debug_files_included'], count($files), ' - ', round($total_size / 1024), $txt['debug_kb'], ' (<a href="javascript:void(0);" onclick="document.getElementById(\'debug_include_info\').style.display = \'inline\'; this.style.display = \'none\'; return false;">', $txt['debug_show'], '</a><span id="debug_include_info" style="display: none;"><em>', implode('</em>, <em>', $files), '</em></span>)<br>'; |
285 | 285 | |
286 | 286 | if (function_exists('memory_get_peak_usage')) |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | // INET. |
361 | 361 | elseif ($param_info['type'] == 'inet') |
362 | 362 | { |
363 | - if(count($search_params[$param_name]) === 1) |
|
363 | + if (count($search_params[$param_name]) === 1) |
|
364 | 364 | { |
365 | 365 | $query_parts[] = '(' . $param_info['db_fields'][0] . ' = {inet:' . $param_name . '})'; |
366 | 366 | $where_params[$param_name] = $search_params[$param_name][0]; |
@@ -368,8 +368,8 @@ discard block |
||
368 | 368 | elseif (count($search_params[$param_name]) === 2) |
369 | 369 | { |
370 | 370 | $query_parts[] = '(' . $param_info['db_fields'][0] . ' <= {inet:' . $param_name . '_high} and ' . $param_info['db_fields'][0] . ' >= {inet:' . $param_name . '_low})'; |
371 | - $where_params[$param_name.'_low'] = $search_params[$param_name]['low']; |
|
372 | - $where_params[$param_name.'_high'] = $search_params[$param_name]['high']; |
|
371 | + $where_params[$param_name . '_low'] = $search_params[$param_name]['low']; |
|
372 | + $where_params[$param_name . '_high'] = $search_params[$param_name]['high']; |
|
373 | 373 | } |
374 | 374 | |
375 | 375 | } |
@@ -592,7 +592,7 @@ discard block |
||
592 | 592 | 'Jessica "Suki" González', |
593 | 593 | 'Karl "RegularExpression" Benson', |
594 | 594 | 'Matthew "Labradoodle-360" Kerle', |
595 | - $user_info['is_admin'] ? 'Matt "Grudge" Wolf': 'Grudge', |
|
595 | + $user_info['is_admin'] ? 'Matt "Grudge" Wolf' : 'Grudge', |
|
596 | 596 | 'Michael "Thantos" Miller', |
597 | 597 | 'Norv', |
598 | 598 | 'Peter "Arantor" Spicer', |
@@ -824,13 +824,13 @@ discard block |
||
824 | 824 | $credit_info = $smcFunc['json_decode']($row['credits'], true); |
825 | 825 | |
826 | 826 | $copyright = empty($credit_info['copyright']) ? '' : $txt['credits_copyright'] . ' © ' . $smcFunc['htmlspecialchars']($credit_info['copyright']); |
827 | - $license = empty($credit_info['license']) ? '' : $txt['credits_license'] . ': ' . (!empty($credit_info['licenseurl']) ? '<a href="'. $smcFunc['htmlspecialchars']($credit_info['licenseurl']) .'">'. $smcFunc['htmlspecialchars']($credit_info['license']) .'</a>' : $smcFunc['htmlspecialchars']($credit_info['license'])); |
|
827 | + $license = empty($credit_info['license']) ? '' : $txt['credits_license'] . ': ' . (!empty($credit_info['licenseurl']) ? '<a href="' . $smcFunc['htmlspecialchars']($credit_info['licenseurl']) . '">' . $smcFunc['htmlspecialchars']($credit_info['license']) . '</a>' : $smcFunc['htmlspecialchars']($credit_info['license'])); |
|
828 | 828 | $version = $txt['credits_version'] . ' ' . $row['version']; |
829 | 829 | $title = (empty($credit_info['title']) ? $row['name'] : $smcFunc['htmlspecialchars']($credit_info['title'])) . ': ' . $version; |
830 | 830 | |
831 | 831 | // build this one out and stash it away |
832 | 832 | $mod_name = empty($credit_info['url']) ? $title : '<a href="' . $credit_info['url'] . '">' . $title . '</a>'; |
833 | - $mods[] = $mod_name . (!empty($license) ? ' | ' . $license : '') . (!empty($copyright) ? ' | ' . $copyright : ''); |
|
833 | + $mods[] = $mod_name . (!empty($license) ? ' | ' . $license : '') . (!empty($copyright) ? ' | ' . $copyright : ''); |
|
834 | 834 | } |
835 | 835 | cache_put_data('mods_credits', $mods, 86400); |
836 | 836 | } |
@@ -236,7 +236,7 @@ |
||
236 | 236 | $header = 'POST /cgi-bin/webscr HTTP/1.1' . "\r\n"; |
237 | 237 | $header .= 'content-type: application/x-www-form-urlencoded' . "\r\n"; |
238 | 238 | $header .= 'Host: www.' . (!empty($modSettings['paidsubs_test']) ? 'sandbox.' : '') . 'paypal.com' . "\r\n"; |
239 | - $header .= 'content-length: ' . strlen ($requestString) . "\r\n"; |
|
239 | + $header .= 'content-length: ' . strlen($requestString) . "\r\n"; |
|
240 | 240 | $header .= 'connection: close' . "\r\n\r\n"; |
241 | 241 | |
242 | 242 | // Open the connection. |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | // Just send a generic message. |
77 | 77 | else |
78 | 78 | $this->setResponse(array( |
79 | - 'text' => $this->_sa == 'add' ? 'attach_error_title' : 'attached_file_deleted_error', |
|
79 | + 'text' => $this->_sa == 'add' ? 'attach_error_title' : 'attached_file_deleted_error', |
|
80 | 80 | 'type' => 'error', |
81 | 81 | 'data' => false, |
82 | 82 | )); |
@@ -410,7 +410,7 @@ discard block |
||
410 | 410 | // Gotta urlencode the filename. |
411 | 411 | if ($this->_attachResults) |
412 | 412 | foreach ($this->_attachResults as $k => $v) |
413 | - $this->_attachResults[$k]['name'] = urlencode($this->_attachResults[$k]['name']); |
|
413 | + $this->_attachResults[$k]['name'] = urlencode($this->_attachResults[$k]['name']); |
|
414 | 414 | |
415 | 415 | $this->_response = array( |
416 | 416 | 'files' => $this->_attachResults ? $this->_attachResults : false, |
@@ -437,7 +437,7 @@ discard block |
||
437 | 437 | ob_start(); |
438 | 438 | |
439 | 439 | // Set the header. |
440 | - header('content-type: application/json; charset='. $context['character_set'] .''); |
|
440 | + header('content-type: application/json; charset=' . $context['character_set'] . ''); |
|
441 | 441 | |
442 | 442 | echo $smcFunc['json_encode']($this->_response ? $this->_response : array()); |
443 | 443 |
@@ -704,7 +704,7 @@ |
||
704 | 704 | $mail_result = false; |
705 | 705 | } |
706 | 706 | } |
707 | - catch(ErrorException $e) |
|
707 | + catch (ErrorException $e) |
|
708 | 708 | { |
709 | 709 | log_error($e->getMessage(), 'general', $e->getFile(), $e->getLine()); |
710 | 710 | log_error(sprintf($txt['mail_send_unable'], $to)); |
@@ -140,7 +140,7 @@ |
||
140 | 140 | $max_age = $time - $cached['time'] + (5 * 86400); |
141 | 141 | header('content-type: ' . $cached['content_type']); |
142 | 142 | header('content-length: ' . $cached['size']); |
143 | - header('cache-control: public, max-age=' . $max_age ); |
|
143 | + header('cache-control: public, max-age=' . $max_age); |
|
144 | 144 | header('last-modified: ' . gmdate('D, d M Y H:i:s', $cached['time']) . ' GMT'); |
145 | 145 | header('etag: ' . $eTag); |
146 | 146 | echo base64_decode($cached['body']); |