@@ -100,18 +100,22 @@ |
||
| 100 | 100 | $tempTab++; |
| 101 | 101 | $context['tabindex'] = $tempTab; |
| 102 | 102 | |
| 103 | - foreach ($context['richedit_buttons'] as $name => $button) { |
|
| 104 | - if ($name == 'spell_check') { |
|
| 103 | + foreach ($context['richedit_buttons'] as $name => $button) |
|
| 104 | + { |
|
| 105 | + if ($name == 'spell_check') |
|
| 106 | + { |
|
| 105 | 107 | $button['onclick'] = 'oEditorHandle_' . $editor_id . '.spellCheckStart();'; |
| 106 | 108 | } |
| 107 | 109 | |
| 108 | - if ($name == 'preview') { |
|
| 110 | + if ($name == 'preview') |
|
| 111 | + { |
|
| 109 | 112 | $button['value'] = isset($editor_context['labels']['preview_button']) ? $editor_context['labels']['preview_button'] : $button['value']; |
| 110 | 113 | $button['onclick'] = $editor_context['preview_type'] == 2 ? '' : 'return submitThisOnce(this);'; |
| 111 | 114 | $button['show'] = $editor_context['preview_type']; |
| 112 | 115 | } |
| 113 | 116 | |
| 114 | - if ($button['show']) { |
|
| 117 | + if ($button['show']) |
|
| 118 | + { |
|
| 115 | 119 | echo ' |
| 116 | 120 | <input type="', $button['type'], '"', $button['type'] == 'hidden' ? ' id="' . $name . '"' : '', ' name="', $name, '" value="', $button['value'], '"', $button['type'] != 'hidden' ? ' tabindex="' . --$tempTab . '"' : '', !empty($button['onclick']) ? ' onclick="' . $button['onclick'] . '"' : '', !empty($button['accessKey']) ? ' accesskey="' . $button['accessKey'] . '"' : '', $button['type'] != 'hidden' ? ' class="button"' : '', '>'; |
| 117 | 121 | } |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | require_once($sourcedir . '/Load.php'); |
| 54 | 54 | |
| 55 | 55 | // If $maintenance is set specifically to 2, then we're upgrading or something. |
| 56 | -if (!empty($maintenance) && 2 === $maintenance) |
|
| 56 | +if (!empty($maintenance) && 2 === $maintenance) |
|
| 57 | 57 | display_maintenance_message(); |
| 58 | 58 | |
| 59 | 59 | // Create a variable to store some SMF specific functions in. |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | * |
| 105 | 105 | * @param string $class The fully-qualified class name. |
| 106 | 106 | */ |
| 107 | -spl_autoload_register(function ($class) use ($sourcedir) |
|
| 107 | +spl_autoload_register(function($class) use ($sourcedir) |
|
| 108 | 108 | { |
| 109 | 109 | $classMap = array( |
| 110 | 110 | 'ReCaptcha\\' => 'ReCaptcha/', |
@@ -1257,7 +1257,6 @@ discard block |
||
| 1257 | 1257 | |
| 1258 | 1258 | continue; |
| 1259 | 1259 | } |
| 1260 | - |
|
| 1261 | 1260 | else |
| 1262 | 1261 | { |
| 1263 | 1262 | $fh = @fopen($path . '/.htaccess', 'w'); |
@@ -1269,7 +1268,6 @@ discard block |
||
| 1269 | 1268 | Deny from all' . $close); |
| 1270 | 1269 | fclose($fh); |
| 1271 | 1270 | } |
| 1272 | - |
|
| 1273 | 1271 | else |
| 1274 | 1272 | $errors[] = 'htaccess_cannot_create_file'; |
| 1275 | 1273 | } |
@@ -1280,7 +1278,6 @@ discard block |
||
| 1280 | 1278 | |
| 1281 | 1279 | continue; |
| 1282 | 1280 | } |
| 1283 | - |
|
| 1284 | 1281 | else |
| 1285 | 1282 | { |
| 1286 | 1283 | $fh = @fopen($path . '/index.php', 'w'); |
@@ -1307,7 +1304,6 @@ discard block |
||
| 1307 | 1304 | ?' . '>'); |
| 1308 | 1305 | fclose($fh); |
| 1309 | 1306 | } |
| 1310 | - |
|
| 1311 | 1307 | else |
| 1312 | 1308 | $errors[] = 'index-php_cannot_create_file'; |
| 1313 | 1309 | } |
@@ -816,7 +816,7 @@ |
||
| 816 | 816 | |
| 817 | 817 | $out = 'POST /smf/stats/collect_stats.php HTTP/1.1' . "\r\n"; |
| 818 | 818 | $out .= 'Host: www.simplemachines.org' . "\r\n"; |
| 819 | - $out .= 'user-agent: '. SMF_USER_AGENT . "\r\n"; |
|
| 819 | + $out .= 'user-agent: ' . SMF_USER_AGENT . "\r\n"; |
|
| 820 | 820 | $out .= 'content-type: application/x-www-form-urlencoded' . "\r\n"; |
| 821 | 821 | $out .= 'connection: Close' . "\r\n"; |
| 822 | 822 | $out .= 'content-length: ' . $length . "\r\n\r\n"; |
@@ -67,8 +67,7 @@ |
||
| 67 | 67 | $sound_letter = substr($sound_letter, strpos($sound_letter, 'data') + 8); |
| 68 | 68 | switch ($word[$i] === 's' ? 0 : mt_rand(0, 2)) |
| 69 | 69 | { |
| 70 | - case 0 : |
|
| 71 | - for ($j = 0, $n = strlen($sound_letter); $j < $n; $j++) |
|
| 70 | + case 0 : for ($j = 0, $n = strlen($sound_letter); $j < $n; $j++) |
|
| 72 | 71 | for ($k = 0, $m = round(mt_rand(15, 25) / 10); $k < $m; $k++) |
| 73 | 72 | $sound_word .= $word[$i] === 's' ? $sound_letter[$j] : chr(mt_rand(max(ord($sound_letter[$j]) - 1, 0x00), min(ord($sound_letter[$j]) + 1, 0xFF))); |
| 74 | 73 | break; |
@@ -959,7 +959,7 @@ |
||
| 959 | 959 | $incontext['continue'] = 1; |
| 960 | 960 | |
| 961 | 961 | // Check Postgres setting |
| 962 | - if ( $db_type === 'postgresql') |
|
| 962 | + if ($db_type === 'postgresql') |
|
| 963 | 963 | { |
| 964 | 964 | load_database(); |
| 965 | 965 | $result = $smcFunc['db_query']('', ' |
@@ -973,7 +973,7 @@ |
||
| 973 | 973 | { |
| 974 | 974 | $row = $smcFunc['db_fetch_assoc']($result); |
| 975 | 975 | if ($row['standard_conforming_strings'] !== 'on') |
| 976 | - { |
|
| 976 | + { |
|
| 977 | 977 | $incontext['continue'] = 0; |
| 978 | 978 | $incontext['error'] = $txt['error_pg_scs']; |
| 979 | 979 | } |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | clean_cache(); |
| 170 | 170 | |
| 171 | 171 | // If warning decrement is enabled and we have people who have not had a new warning in 24 hours, lower their warning level. |
| 172 | - list (, , $modSettings['warning_decrement']) = explode(',', $modSettings['warning_settings']); |
|
| 172 | + list (,, $modSettings['warning_decrement']) = explode(',', $modSettings['warning_settings']); |
|
| 173 | 173 | if ($modSettings['warning_decrement']) |
| 174 | 174 | { |
| 175 | 175 | // Find every member who has a warning level... |
@@ -1622,7 +1622,7 @@ discard block |
||
| 1622 | 1622 | // Determine action based on last_login... |
| 1623 | 1623 | $purgeMembers = array(); |
| 1624 | 1624 | $markReadMembers = array(); |
| 1625 | - foreach($members as $member) |
|
| 1625 | + foreach ($members as $member) |
|
| 1626 | 1626 | { |
| 1627 | 1627 | if ($member['last_login'] <= $cleanupBeyond) |
| 1628 | 1628 | $purgeMembers[] = $member['id_member']; |
@@ -2263,7 +2263,7 @@ |
||
| 2263 | 2263 | { |
| 2264 | 2264 | uasort($loaded_attachments, function($a, $b) { |
| 2265 | 2265 | if ($a['filesize'] == $b['filesize']) |
| 2266 | - return 0; |
|
| 2266 | + return 0; |
|
| 2267 | 2267 | return ($a['filesize'] < $b['filesize']) ? -1 : 1; |
| 2268 | 2268 | }); |
| 2269 | 2269 | } |
@@ -2261,7 +2261,8 @@ |
||
| 2261 | 2261 | // Sort the attachments by size to make things easier below |
| 2262 | 2262 | if (!empty($loaded_attachments)) |
| 2263 | 2263 | { |
| 2264 | - uasort($loaded_attachments, function($a, $b) { |
|
| 2264 | + uasort($loaded_attachments, function($a, $b) |
|
| 2265 | + { |
|
| 2265 | 2266 | if ($a['filesize'] == $b['filesize']) |
| 2266 | 2267 | return 0; |
| 2267 | 2268 | return ($a['filesize'] < $b['filesize']) ? -1 : 1; |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | ); |
| 93 | 93 | foreach (array('action', 'sa', 'type', 'board', 'boards', 'c', 'u', 'limit', 'offset') as $var) |
| 94 | 94 | if (isset($_GET[$var])) |
| 95 | - $feed_meta['self'] .= ($feed_meta['self'] === $scripturl ? '?' : ';' ) . $var . '=' . $_GET[$var]; |
|
| 95 | + $feed_meta['self'] .= ($feed_meta['self'] === $scripturl ? '?' : ';') . $var . '=' . $_GET[$var]; |
|
| 96 | 96 | |
| 97 | 97 | // Handle the cases where a board, boards, or category is asked for. |
| 98 | 98 | $query_this_board = 1; |
@@ -299,17 +299,17 @@ discard block |
||
| 299 | 299 | * namespaces, which could cause it to mangle the XML horrifically |
| 300 | 300 | * during processing. |
| 301 | 301 | */ |
| 302 | - $smf_ns = 'htt'.'p:/'.'/ww'.'w.simple'.'machines.o'.'rg/xml/' . $subaction; |
|
| 302 | + $smf_ns = 'htt' . 'p:/' . '/ww' . 'w.simple' . 'machines.o' . 'rg/xml/' . $subaction; |
|
| 303 | 303 | |
| 304 | 304 | // Allow mods to add extra namespaces and tags to the feed/channel |
| 305 | 305 | $namespaces = array( |
| 306 | 306 | 'rss' => array(), |
| 307 | - 'rss2' => array('atom' => 'htt'.'p:/'.'/ww'.'w.w3.o'.'rg/2005/Atom'), |
|
| 308 | - 'atom' => array('' => 'htt'.'p:/'.'/ww'.'w.w3.o'.'rg/2005/Atom'), |
|
| 307 | + 'rss2' => array('atom' => 'htt' . 'p:/' . '/ww' . 'w.w3.o' . 'rg/2005/Atom'), |
|
| 308 | + 'atom' => array('' => 'htt' . 'p:/' . '/ww' . 'w.w3.o' . 'rg/2005/Atom'), |
|
| 309 | 309 | 'rdf' => array( |
| 310 | - '' => 'htt'.'p:/'.'/purl.o'.'rg/rss/1.0/', |
|
| 311 | - 'rdf' => 'htt'.'p:/'.'/ww'.'w.w3.o'.'rg/1999/02/22-rdf-syntax-ns#', |
|
| 312 | - 'dc' => 'htt'.'p:/'.'/purl.o'.'rg/dc/elements/1.1/', |
|
| 310 | + '' => 'htt' . 'p:/' . '/purl.o' . 'rg/rss/1.0/', |
|
| 311 | + 'rdf' => 'htt' . 'p:/' . '/ww' . 'w.w3.o' . 'rg/1999/02/22-rdf-syntax-ns#', |
|
| 312 | + 'dc' => 'htt' . 'p:/' . '/purl.o' . 'rg/dc/elements/1.1/', |
|
| 313 | 313 | ), |
| 314 | 314 | 'smf' => array( |
| 315 | 315 | 'smf' => $smf_ns, |
@@ -330,7 +330,7 @@ |
||
| 330 | 330 | WHERE t.id_board = {int:current_board} ' |
| 331 | 331 | . (!$modSettings['postmod_active'] || $context['can_approve_posts'] ? '' : ' |
| 332 | 332 | AND (t.approved = {int:is_approved}' . ($user_info['is_guest'] ? '' : ' OR t.id_member_started = {int:current_member}') . ')') . (!empty($message_index_topic_wheres) ? ' |
| 333 | - AND ' . implode("\n\t\t\t\tAND ", $message_index_topic_wheres) : ''). ' |
|
| 333 | + AND ' . implode("\n\t\t\t\tAND ", $message_index_topic_wheres) : '') . ' |
|
| 334 | 334 | ORDER BY is_sticky' . ($fake_ascending ? '' : ' DESC') . ', ' . $_REQUEST['sort'] . ($ascending ? '' : ' DESC') . ' |
| 335 | 335 | LIMIT {int:maxindex} |
| 336 | 336 | OFFSET {int:start} '; |