@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | |
232 | 232 | foreach ($message['custom_fields']['above_member'] as $custom) |
233 | 233 | echo ' |
234 | - <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
|
234 | + <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
|
235 | 235 | |
236 | 236 | echo ' |
237 | 237 | </ul> |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | if (!empty($message['custom_fields']['below_avatar'])) |
269 | 269 | foreach ($message['custom_fields']['below_avatar'] as $custom) |
270 | 270 | echo ' |
271 | - <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
|
271 | + <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
|
272 | 272 | |
273 | 273 | if (!$message['member']['is_guest']) |
274 | 274 | echo ' |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | |
311 | 311 | foreach ($message['custom_fields']['icons'] as $custom) |
312 | 312 | echo ' |
313 | - <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
|
313 | + <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
|
314 | 314 | |
315 | 315 | echo ' |
316 | 316 | </ol> |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | if (!empty($message['custom_fields']['standard'])) |
369 | 369 | foreach ($message['custom_fields']['standard'] as $custom) |
370 | 370 | echo ' |
371 | - <li class="custom ', $custom['col_name'] ,'">', $custom['title'], ': ', $custom['value'], '</li>'; |
|
371 | + <li class="custom ', $custom['col_name'], '">', $custom['title'], ': ', $custom['value'], '</li>'; |
|
372 | 372 | |
373 | 373 | // Are we showing the warning status? |
374 | 374 | if ($message['member']['can_see_warning']) |
@@ -379,7 +379,7 @@ discard block |
||
379 | 379 | if (!empty($message['custom_fields']['bottom_poster'])) |
380 | 380 | foreach ($message['custom_fields']['bottom_poster'] as $custom) |
381 | 381 | echo ' |
382 | - <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
|
382 | + <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
|
383 | 383 | } |
384 | 384 | |
385 | 385 | // Done with the information about the poster... on to the post itself. |
@@ -477,7 +477,7 @@ discard block |
||
477 | 477 | |
478 | 478 | foreach ($message['custom_fields']['above_signature'] as $custom) |
479 | 479 | echo ' |
480 | - <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
|
480 | + <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
|
481 | 481 | |
482 | 482 | echo ' |
483 | 483 | </ul> |
@@ -498,7 +498,7 @@ discard block |
||
498 | 498 | |
499 | 499 | foreach ($message['custom_fields']['below_signature'] as $custom) |
500 | 500 | echo ' |
501 | - <li class="custom ', $custom['col_name'] ,'">', $custom['value'], '</li>'; |
|
501 | + <li class="custom ', $custom['col_name'], '">', $custom['value'], '</li>'; |
|
502 | 502 | |
503 | 503 | echo ' |
504 | 504 | </ul> |
@@ -630,7 +630,7 @@ discard block |
||
630 | 630 | while ($message = $context['get_pmessage']('subject')) |
631 | 631 | { |
632 | 632 | echo ' |
633 | - <tr class="windowbg', $message['is_unread'] ? ' unread_pm' : '','"> |
|
633 | + <tr class="windowbg', $message['is_unread'] ? ' unread_pm' : '', '"> |
|
634 | 634 | <td class="table_icon"> |
635 | 635 | <script> |
636 | 636 | currentLabels[', $message['id'], '] = {'; |
@@ -902,12 +902,12 @@ discard block |
||
902 | 902 | // You can only reply if they are not a guest... |
903 | 903 | if (!$message['member']['is_guest']) |
904 | 904 | echo ' |
905 | - <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=', $context['folder'] == 'sent' ? '' : $message['member']['id'], '">', $quote_button , '</a>', $context['menu_separator'], ' |
|
906 | - <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';u=', $message['member']['id'], '">', $reply_button , '</a> ', $context['menu_separator']; |
|
905 | + <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote;u=', $context['folder'] == 'sent' ? '' : $message['member']['id'], '">', $quote_button, '</a>', $context['menu_separator'], ' |
|
906 | + <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';u=', $message['member']['id'], '">', $reply_button, '</a> ', $context['menu_separator']; |
|
907 | 907 | // This is for "forwarding" - even if the member is gone. |
908 | 908 | else |
909 | 909 | echo ' |
910 | - <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote">', $quote_button , '</a>', $context['menu_separator']; |
|
910 | + <a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote">', $quote_button, '</a>', $context['menu_separator']; |
|
911 | 911 | } |
912 | 912 | |
913 | 913 | echo ' |
@@ -1007,7 +1007,7 @@ discard block |
||
1007 | 1007 | <div class="', empty($context['error_type']) || $context['error_type'] != 'serious' ? 'noticebox' : 'errorbox', '"', empty($context['post_error']['messages']) ? ' style="display: none"' : '', ' id="errors"> |
1008 | 1008 | <dl> |
1009 | 1009 | <dt> |
1010 | - <strong id="error_serious">', $txt['error_while_submitting'] , '</strong> |
|
1010 | + <strong id="error_serious">', $txt['error_while_submitting'], '</strong> |
|
1011 | 1011 | </dt> |
1012 | 1012 | <dd class="error" id="error_list"> |
1013 | 1013 | ', empty($context['post_error']['messages']) ? '' : implode('<br>', $context['post_error']['messages']), ' |
@@ -1063,7 +1063,7 @@ discard block |
||
1063 | 1063 | <span', (isset($context['post_error']['no_subject']) ? ' class="error"' : ''), ' id="caption_subject">', $txt['subject'], ':</span> |
1064 | 1064 | </dt> |
1065 | 1065 | <dd id="pm_subject"> |
1066 | - <input type="text" name="subject" value="', $context['subject'], '" tabindex="', $context['tabindex']++, '" size="80" maxlength="80"',isset($context['post_error']['no_subject']) ? ' class="error"' : '', '/> |
|
1066 | + <input type="text" name="subject" value="', $context['subject'], '" tabindex="', $context['tabindex']++, '" size="80" maxlength="80"', isset($context['post_error']['no_subject']) ? ' class="error"' : '', '/> |
|
1067 | 1067 | </dd> |
1068 | 1068 | </dl><hr>'; |
1069 | 1069 | |
@@ -1426,7 +1426,7 @@ discard block |
||
1426 | 1426 | echo ' |
1427 | 1427 | <div class="padding"> |
1428 | 1428 | <input type="submit" name="save" value="', $txt['save'], '" class="button"> |
1429 | - <input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" data-confirm="', $txt['pm_labels_delete'] ,'" class="button you_sure"> |
|
1429 | + <input type="submit" name="delete" value="', $txt['quickmod_delete_selected'], '" data-confirm="', $txt['pm_labels_delete'], '" class="button you_sure"> |
|
1430 | 1430 | </div>'; |
1431 | 1431 | |
1432 | 1432 | echo ' |
@@ -1590,7 +1590,7 @@ discard block |
||
1590 | 1590 | if (!empty($context['rules'])) |
1591 | 1591 | echo ' |
1592 | 1592 | <input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '"> |
1593 | - <input type="submit" name="delselected" value="', $txt['pm_delete_selected_rule'], '" data-confirm="', $txt['pm_js_delete_rule_confirm'] ,'" class="button smalltext you_sure">'; |
|
1593 | + <input type="submit" name="delselected" value="', $txt['pm_delete_selected_rule'], '" data-confirm="', $txt['pm_js_delete_rule_confirm'], '" class="button smalltext you_sure">'; |
|
1594 | 1594 | |
1595 | 1595 | echo ' |
1596 | 1596 | </div> |
@@ -1831,9 +1831,9 @@ discard block |
||
1831 | 1831 | |
1832 | 1832 | echo ' |
1833 | 1833 | <select name="acttype[', $k, ']" id="acttype', $k, '" onchange="updateActionDef(', $k, '); rebuildRuleDesc();"> |
1834 | - <option value="">', $txt['pm_rule_sel_action'] , ':</option> |
|
1835 | - <option value="lab"', $action['t'] == 'lab' ? ' selected' : '', '>', $txt['pm_rule_label'] , '</option> |
|
1836 | - <option value="del"', $action['t'] == 'del' ? ' selected' : '', '>', $txt['pm_rule_delete'] , '</option> |
|
1834 | + <option value="">', $txt['pm_rule_sel_action'], ':</option> |
|
1835 | + <option value="lab"', $action['t'] == 'lab' ? ' selected' : '', '>', $txt['pm_rule_label'], '</option> |
|
1836 | + <option value="del"', $action['t'] == 'del' ? ' selected' : '', '>', $txt['pm_rule_delete'], '</option> |
|
1837 | 1837 | </select> |
1838 | 1838 | <span id="labdiv', $k, '"> |
1839 | 1839 | <select name="labdef[', $k, ']" id="labdef', $k, '" onchange="rebuildRuleDesc();"> |
@@ -1945,7 +1945,7 @@ discard block |
||
1945 | 1945 | </div> |
1946 | 1946 | <ul class="quickbuttons"> |
1947 | 1947 | <li><a href="', $scripturl, '?action=pm;sa=showpmdrafts;id_draft=', $draft['id_draft'], ';', $context['session_var'], '=', $context['session_id'], '"><span class="generic_icons modifybutton"></span>', $txt['draft_edit'], '</a></li> |
1948 | - <li><a href="', $scripturl, '?action=pm;sa=showpmdrafts;delete=', $draft['id_draft'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['draft_remove'] ,'?" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['draft_delete'], '</a></li> |
|
1948 | + <li><a href="', $scripturl, '?action=pm;sa=showpmdrafts;delete=', $draft['id_draft'], ';', $context['session_var'], '=', $context['session_id'], '" data-confirm="', $txt['draft_remove'], '?" class="you_sure"><span class="generic_icons remove_button"></span>', $txt['draft_delete'], '</a></li> |
|
1949 | 1949 | </ul> |
1950 | 1950 | </div>'; |
1951 | 1951 | } |
@@ -416,8 +416,8 @@ discard block |
||
416 | 416 | </div> |
417 | 417 | <div class="progressBar" role="progressBar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><span></span></div> |
418 | 418 | <div class="attach-ui"> |
419 | - <a data-dz-remove class="button cancel">', $txt['modify_cancel'] ,'</a> |
|
420 | - <a class="button upload">', $txt['upload'] ,'</a> |
|
419 | + <a data-dz-remove class="button cancel">', $txt['modify_cancel'], '</a> |
|
420 | + <a class="button upload">', $txt['upload'], '</a> |
|
421 | 421 | </div> |
422 | 422 | </div> |
423 | 423 | </div> |
@@ -435,10 +435,10 @@ discard block |
||
435 | 435 | </dt> |
436 | 436 | <dd class="smalltext fallback"> |
437 | 437 | <div id="attachUpload" class="descbox"> |
438 | - <h5>', $txt['attach_drop_zone'] ,'</h5> |
|
439 | - <a class="button" id="attach-cancelAll">', $txt['attached_cancelAll'] ,'</a> |
|
440 | - <a class="button" id="attach-uploadAll">', $txt['attached_uploadAll'] ,'</a> |
|
441 | - <a class="button fileinput-button">', $txt['attach_add'] ,'</a> |
|
438 | + <h5>', $txt['attach_drop_zone'], '</h5> |
|
439 | + <a class="button" id="attach-cancelAll">', $txt['attached_cancelAll'], '</a> |
|
440 | + <a class="button" id="attach-uploadAll">', $txt['attached_uploadAll'], '</a> |
|
441 | + <a class="button fileinput-button">', $txt['attach_add'], '</a> |
|
442 | 442 | <div id="total-progress" class="progressBar" role="progressBar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><span></span></div> |
443 | 443 | <div class="fallback"> |
444 | 444 | <input type="file" multiple="multiple" name="attachment[]" id="attachment1" class="fallback"> (<a href="javascript:void(0);" onclick="cleanFileInput(\'attachment1\');">', $txt['clean_attach'], '</a>) |
@@ -545,7 +545,7 @@ discard block |
||
545 | 545 | // Option to delete an event if user is editing one. |
546 | 546 | if ($context['make_event'] && !$context['event']['new']) |
547 | 547 | echo ' |
548 | - <input type="submit" name="deleteevent" value="', $txt['event_delete'], '" data-confirm="', $txt['event_delete_confirm'] ,'" class="button you_sure">'; |
|
548 | + <input type="submit" name="deleteevent" value="', $txt['event_delete'], '" data-confirm="', $txt['event_delete_confirm'], '" class="button you_sure">'; |
|
549 | 549 | |
550 | 550 | echo ' |
551 | 551 | </span> |
@@ -799,7 +799,7 @@ discard block |
||
799 | 799 | });'; |
800 | 800 | |
801 | 801 | echo ' |
802 | - var oEditorID = "', $context['post_box_name'] ,'"; |
|
802 | + var oEditorID = "', $context['post_box_name'], '"; |
|
803 | 803 | var oEditorObject = oEditorHandle_', $context['post_box_name'], '; |
804 | 804 | </script>'; |
805 | 805 | |
@@ -831,7 +831,7 @@ discard block |
||
831 | 831 | { |
832 | 832 | echo ' |
833 | 833 | <ul class="quickbuttons" id="msg_', $post['id'], '_quote"> |
834 | - <li style="display:none;" id="quoteSelected_', $post['id'], '" data-msgid="', $post['id'], '"><a href="javascript:void(0)"><span class="generic_icons quote_selected"></span>', $txt['quote_selected_action'] ,'</a></li> |
|
834 | + <li style="display:none;" id="quoteSelected_', $post['id'], '" data-msgid="', $post['id'], '"><a href="javascript:void(0)"><span class="generic_icons quote_selected"></span>', $txt['quote_selected_action'], '</a></li> |
|
835 | 835 | <li id="post_modify"><a href="#postmodify" onclick="return insertQuoteFast(', $post['id'], ');"><span class="generic_icons quote"></span>', $txt['quote'], '</a></li> |
836 | 836 | </ul>'; |
837 | 837 | } |
@@ -918,7 +918,7 @@ discard block |
||
918 | 918 | <head> |
919 | 919 | <meta charset="', $context['character_set'], '"> |
920 | 920 | <title>', $txt['spell_check'], '</title> |
921 | - <link rel="stylesheet" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css', $modSettings['browser_cache'] ,'"> |
|
921 | + <link rel="stylesheet" href="', $settings['theme_url'], '/css/index', $context['theme_variant'], '.css', $modSettings['browser_cache'], '"> |
|
922 | 922 | <style> |
923 | 923 | body, td |
924 | 924 | { |
@@ -951,8 +951,8 @@ discard block |
||
951 | 951 | var spell_formname = window.opener.spell_formname; |
952 | 952 | var spell_fieldname = window.opener.spell_fieldname; |
953 | 953 | </script> |
954 | - <script src="', $settings['default_theme_url'], '/scripts/spellcheck.js', $modSettings['browser_cache'] ,'"></script> |
|
955 | - <script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'] ,'"></script> |
|
954 | + <script src="', $settings['default_theme_url'], '/scripts/spellcheck.js', $modSettings['browser_cache'], '"></script> |
|
955 | + <script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'], '"></script> |
|
956 | 956 | <script> |
957 | 957 | ', $context['spell_js'], ' |
958 | 958 | </script> |
@@ -994,7 +994,7 @@ discard block |
||
994 | 994 | <head> |
995 | 995 | <meta charset="', $context['character_set'], '"> |
996 | 996 | <title>', $txt['retrieving_quote'], '</title> |
997 | - <script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'] ,'"></script> |
|
997 | + <script src="', $settings['default_theme_url'], '/scripts/script.js', $modSettings['browser_cache'], '"></script> |
|
998 | 998 | </head> |
999 | 999 | <body> |
1000 | 1000 | ', $txt['retrieving_quote'], ' |
@@ -247,7 +247,7 @@ |
||
247 | 247 | } |
248 | 248 | $smcFunc['db_free_result']($request); |
249 | 249 | |
250 | - if($withSender) |
|
250 | + if ($withSender) |
|
251 | 251 | { |
252 | 252 | $senders = loadMemberData($senders); |
253 | 253 | foreach ($senders as $member) |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | { |
388 | 388 | $val = 'CASE '; |
389 | 389 | foreach ($members as $k => $v) |
390 | - $val .= 'WHEN id_member = ' . $v . ' THEN '. count(fetch_alerts($v, false, 0, array(), false)) . ' '; |
|
390 | + $val .= 'WHEN id_member = ' . $v . ' THEN ' . count(fetch_alerts($v, false, 0, array(), false)) . ' '; |
|
391 | 391 | $val = $val . ' END'; |
392 | 392 | $type = 'raw'; |
393 | 393 | } |
@@ -820,7 +820,7 @@ discard block |
||
820 | 820 | $unsupportedFormats = (array) cache_get_data('unsupportedtimeformats', 86400); |
821 | 821 | if (empty($unsupportedFormats)) |
822 | 822 | { |
823 | - foreach($strftimeFormatSubstitutions as $format => $substitution) |
|
823 | + foreach ($strftimeFormatSubstitutions as $format => $substitution) |
|
824 | 824 | { |
825 | 825 | $value = @strftime('%' . $format); |
826 | 826 | |
@@ -1185,7 +1185,7 @@ discard block |
||
1185 | 1185 | 'height' => array('optional' => true, 'match' => '(\d+)'), |
1186 | 1186 | ), |
1187 | 1187 | 'content' => '$1', |
1188 | - 'validate' => function (&$tag, &$data, $disabled, $params) use ($modSettings, $context, $sourcedir, $txt) |
|
1188 | + 'validate' => function(&$tag, &$data, $disabled, $params) use ($modSettings, $context, $sourcedir, $txt) |
|
1189 | 1189 | { |
1190 | 1190 | $returnContext = ''; |
1191 | 1191 | |
@@ -1220,7 +1220,7 @@ discard block |
||
1220 | 1220 | } |
1221 | 1221 | |
1222 | 1222 | if ($currentAttachment['thumbnail']['has_thumb'] && empty($params['{width}']) && empty($params['{height}'])) |
1223 | - $returnContext .= '<a href="'. $currentAttachment['href']. ';image" id="link_'. $currentAttachment['id']. '" onclick="'. $currentAttachment['thumbnail']['javascript']. '"><img src="'. $currentAttachment['thumbnail']['href']. '"' . $alt . $title . ' id="thumb_'. $currentAttachment['id']. '" class="atc_img"></a>'; |
|
1223 | + $returnContext .= '<a href="' . $currentAttachment['href'] . ';image" id="link_' . $currentAttachment['id'] . '" onclick="' . $currentAttachment['thumbnail']['javascript'] . '"><img src="' . $currentAttachment['thumbnail']['href'] . '"' . $alt . $title . ' id="thumb_' . $currentAttachment['id'] . '" class="atc_img"></a>'; |
|
1224 | 1224 | else |
1225 | 1225 | $returnContext .= '<img src="' . $currentAttachment['href'] . ';image"' . $alt . $title . $width . $height . ' class="bbc_img"/>'; |
1226 | 1226 | } |
@@ -1249,7 +1249,7 @@ discard block |
||
1249 | 1249 | 'type' => 'unparsed_content', |
1250 | 1250 | 'content' => '<div class="codeheader"><span class="code floatleft">' . $txt['code'] . '</span> <a class="codeoperation smf_select_text">' . $txt['code_select'] . '</a></div><code class="bbc_code">$1</code>', |
1251 | 1251 | // @todo Maybe this can be simplified? |
1252 | - 'validate' => isset($disabled['code']) ? null : function (&$tag, &$data, $disabled) use ($context) |
|
1252 | + 'validate' => isset($disabled['code']) ? null : function(&$tag, &$data, $disabled) use ($context) |
|
1253 | 1253 | { |
1254 | 1254 | if (!isset($disabled['code'])) |
1255 | 1255 | { |
@@ -1286,7 +1286,7 @@ discard block |
||
1286 | 1286 | 'type' => 'unparsed_equals_content', |
1287 | 1287 | 'content' => '<div class="codeheader"><span class="code floatleft">' . $txt['code'] . '</span> ($2) <a class="codeoperation smf_select_text">' . $txt['code_select'] . '</a></div><code class="bbc_code">$1</code>', |
1288 | 1288 | // @todo Maybe this can be simplified? |
1289 | - 'validate' => isset($disabled['code']) ? null : function (&$tag, &$data, $disabled) use ($context) |
|
1289 | + 'validate' => isset($disabled['code']) ? null : function(&$tag, &$data, $disabled) use ($context) |
|
1290 | 1290 | { |
1291 | 1291 | if (!isset($disabled['code'])) |
1292 | 1292 | { |
@@ -1330,7 +1330,7 @@ discard block |
||
1330 | 1330 | 'type' => 'unparsed_content', |
1331 | 1331 | 'content' => '<a href="mailto:$1" class="bbc_email">$1</a>', |
1332 | 1332 | // @todo Should this respect guest_hideContacts? |
1333 | - 'validate' => function (&$tag, &$data, $disabled) |
|
1333 | + 'validate' => function(&$tag, &$data, $disabled) |
|
1334 | 1334 | { |
1335 | 1335 | $data = strtr($data, array('<br>' => '')); |
1336 | 1336 | }, |
@@ -1349,7 +1349,7 @@ discard block |
||
1349 | 1349 | 'type' => 'unparsed_commas_content', |
1350 | 1350 | 'test' => '\d+,\d+\]', |
1351 | 1351 | 'content' => '<embed type="application/x-shockwave-flash" src="$1" width="$2" height="$3" play="true" loop="true" quality="high" AllowScriptAccess="never">', |
1352 | - 'validate' => function (&$tag, &$data, $disabled) |
|
1352 | + 'validate' => function(&$tag, &$data, $disabled) |
|
1353 | 1353 | { |
1354 | 1354 | if (isset($disabled['url'])) |
1355 | 1355 | $tag['content'] = '$1'; |
@@ -1365,7 +1365,7 @@ discard block |
||
1365 | 1365 | 'test' => '(left|right)(\s+max=\d+(?:%|px|em|rem|ex|pt|pc|ch|vw|vh|vmin|vmax|cm|mm|in)?)?\]', |
1366 | 1366 | 'before' => '<div $1>', |
1367 | 1367 | 'after' => '</div>', |
1368 | - 'validate' => function (&$tag, &$data, $disabled) |
|
1368 | + 'validate' => function(&$tag, &$data, $disabled) |
|
1369 | 1369 | { |
1370 | 1370 | $class = 'class="bbc_float float' . (strpos($data, 'left') === 0 ? 'left' : 'right') . '"'; |
1371 | 1371 | |
@@ -1414,7 +1414,7 @@ discard block |
||
1414 | 1414 | 'height' => array('optional' => true, 'value' => ' height="$1"', 'match' => '(\d+)'), |
1415 | 1415 | ), |
1416 | 1416 | 'content' => '<img src="$1" alt="{alt}" title="{title}"{width}{height} class="bbc_img resized">', |
1417 | - 'validate' => function (&$tag, &$data, $disabled) |
|
1417 | + 'validate' => function(&$tag, &$data, $disabled) |
|
1418 | 1418 | { |
1419 | 1419 | global $image_proxy_enabled, $image_proxy_secret, $boardurl; |
1420 | 1420 | |
@@ -1437,7 +1437,7 @@ discard block |
||
1437 | 1437 | 'tag' => 'img', |
1438 | 1438 | 'type' => 'unparsed_content', |
1439 | 1439 | 'content' => '<img src="$1" alt="" class="bbc_img">', |
1440 | - 'validate' => function (&$tag, &$data, $disabled) |
|
1440 | + 'validate' => function(&$tag, &$data, $disabled) |
|
1441 | 1441 | { |
1442 | 1442 | global $image_proxy_enabled, $image_proxy_secret, $boardurl; |
1443 | 1443 | |
@@ -1460,7 +1460,7 @@ discard block |
||
1460 | 1460 | 'tag' => 'iurl', |
1461 | 1461 | 'type' => 'unparsed_content', |
1462 | 1462 | 'content' => '<a href="$1" class="bbc_link">$1</a>', |
1463 | - 'validate' => function (&$tag, &$data, $disabled) |
|
1463 | + 'validate' => function(&$tag, &$data, $disabled) |
|
1464 | 1464 | { |
1465 | 1465 | $data = strtr($data, array('<br>' => '')); |
1466 | 1466 | $scheme = parse_url($data, PHP_URL_SCHEME); |
@@ -1474,7 +1474,7 @@ discard block |
||
1474 | 1474 | 'quoted' => 'optional', |
1475 | 1475 | 'before' => '<a href="$1" class="bbc_link">', |
1476 | 1476 | 'after' => '</a>', |
1477 | - 'validate' => function (&$tag, &$data, $disabled) |
|
1477 | + 'validate' => function(&$tag, &$data, $disabled) |
|
1478 | 1478 | { |
1479 | 1479 | if (substr($data, 0, 1) == '#') |
1480 | 1480 | $data = '#post_' . substr($data, 1); |
@@ -1554,7 +1554,7 @@ discard block |
||
1554 | 1554 | 'tag' => 'php', |
1555 | 1555 | 'type' => 'unparsed_content', |
1556 | 1556 | 'content' => '<span class="phpcode">$1</span>', |
1557 | - 'validate' => isset($disabled['php']) ? null : function (&$tag, &$data, $disabled) |
|
1557 | + 'validate' => isset($disabled['php']) ? null : function(&$tag, &$data, $disabled) |
|
1558 | 1558 | { |
1559 | 1559 | if (!isset($disabled['php'])) |
1560 | 1560 | { |
@@ -1652,7 +1652,7 @@ discard block |
||
1652 | 1652 | 'test' => '[1-7]\]', |
1653 | 1653 | 'before' => '<span style="font-size: $1;" class="bbc_size">', |
1654 | 1654 | 'after' => '</span>', |
1655 | - 'validate' => function (&$tag, &$data, $disabled) |
|
1655 | + 'validate' => function(&$tag, &$data, $disabled) |
|
1656 | 1656 | { |
1657 | 1657 | $sizes = array(1 => 0.7, 2 => 1.0, 3 => 1.35, 4 => 1.45, 5 => 2.0, 6 => 2.65, 7 => 3.95); |
1658 | 1658 | $data = $sizes[$data] . 'em'; |
@@ -1690,7 +1690,7 @@ discard block |
||
1690 | 1690 | 'tag' => 'time', |
1691 | 1691 | 'type' => 'unparsed_content', |
1692 | 1692 | 'content' => '$1', |
1693 | - 'validate' => function (&$tag, &$data, $disabled) |
|
1693 | + 'validate' => function(&$tag, &$data, $disabled) |
|
1694 | 1694 | { |
1695 | 1695 | if (is_numeric($data)) |
1696 | 1696 | $data = timeformat($data); |
@@ -1718,7 +1718,7 @@ discard block |
||
1718 | 1718 | 'tag' => 'url', |
1719 | 1719 | 'type' => 'unparsed_content', |
1720 | 1720 | 'content' => '<a href="$1" class="bbc_link" target="_blank">$1</a>', |
1721 | - 'validate' => function (&$tag, &$data, $disabled) |
|
1721 | + 'validate' => function(&$tag, &$data, $disabled) |
|
1722 | 1722 | { |
1723 | 1723 | $data = strtr($data, array('<br>' => '')); |
1724 | 1724 | $scheme = parse_url($data, PHP_URL_SCHEME); |
@@ -1732,7 +1732,7 @@ discard block |
||
1732 | 1732 | 'quoted' => 'optional', |
1733 | 1733 | 'before' => '<a href="$1" class="bbc_link" target="_blank">', |
1734 | 1734 | 'after' => '</a>', |
1735 | - 'validate' => function (&$tag, &$data, $disabled) |
|
1735 | + 'validate' => function(&$tag, &$data, $disabled) |
|
1736 | 1736 | { |
1737 | 1737 | $scheme = parse_url($data, PHP_URL_SCHEME); |
1738 | 1738 | if (empty($scheme)) |
@@ -1758,7 +1758,7 @@ discard block |
||
1758 | 1758 | { |
1759 | 1759 | if (isset($temp_bbc)) |
1760 | 1760 | $bbc_codes = $temp_bbc; |
1761 | - usort($codes, function ($a, $b) { |
|
1761 | + usort($codes, function($a, $b) { |
|
1762 | 1762 | return strcmp($a['tag'], $b['tag']); |
1763 | 1763 | }); |
1764 | 1764 | return $codes; |
@@ -1995,7 +1995,7 @@ discard block |
||
1995 | 1995 | # a run of Unicode domain name characters and a dot |
1996 | 1996 | [\p{L}\p{M}\p{N}\-.:@]+\. |
1997 | 1997 | # and then a TLD valid in the DNS or the reserved "local" TLD |
1998 | - (?:'. $modSettings['tld_regex'] .'|local) |
|
1998 | + (?:'. $modSettings['tld_regex'] . '|local) |
|
1999 | 1999 | ) |
2000 | 2000 | # followed by a non-domain character or end of line |
2001 | 2001 | (?=[^\p{L}\p{N}\-.]|$) |
@@ -2063,7 +2063,7 @@ discard block |
||
2063 | 2063 | )? |
2064 | 2064 | '; |
2065 | 2065 | |
2066 | - $data = preg_replace_callback('~' . $url_regex . '~xi' . ($context['utf8'] ? 'u' : ''), function ($matches) { |
|
2066 | + $data = preg_replace_callback('~' . $url_regex . '~xi' . ($context['utf8'] ? 'u' : ''), function($matches) { |
|
2067 | 2067 | $url = array_shift($matches); |
2068 | 2068 | |
2069 | 2069 | $scheme = parse_url($url, PHP_URL_SCHEME); |
@@ -2800,7 +2800,7 @@ discard block |
||
2800 | 2800 | for ($i = 0, $n = count($smileysfrom); $i < $n; $i++) |
2801 | 2801 | { |
2802 | 2802 | $specialChars = $smcFunc['htmlspecialchars']($smileysfrom[$i], ENT_QUOTES); |
2803 | - $smileyCode = '<img src="' . $smileys_path . $smileysto[$i] . '" alt="' . strtr($specialChars, array(':' => ':', '(' => '(', ')' => ')', '$' => '$', '[' => '[')). '" title="' . strtr($smcFunc['htmlspecialchars']($smileysdescs[$i]), array(':' => ':', '(' => '(', ')' => ')', '$' => '$', '[' => '[')) . '" class="smiley">'; |
|
2803 | + $smileyCode = '<img src="' . $smileys_path . $smileysto[$i] . '" alt="' . strtr($specialChars, array(':' => ':', '(' => '(', ')' => ')', '$' => '$', '[' => '[')) . '" title="' . strtr($smcFunc['htmlspecialchars']($smileysdescs[$i]), array(':' => ':', '(' => '(', ')' => ')', '$' => '$', '[' => '[')) . '" class="smiley">'; |
|
2804 | 2804 | |
2805 | 2805 | $smileyPregReplacements[$smileysfrom[$i]] = $smileyCode; |
2806 | 2806 | |
@@ -2817,7 +2817,7 @@ discard block |
||
2817 | 2817 | |
2818 | 2818 | // Replace away! |
2819 | 2819 | $message = preg_replace_callback($smileyPregSearch, |
2820 | - function ($matches) use ($smileyPregReplacements) |
|
2820 | + function($matches) use ($smileyPregReplacements) |
|
2821 | 2821 | { |
2822 | 2822 | return $smileyPregReplacements[$matches[1]]; |
2823 | 2823 | }, $message); |
@@ -2883,13 +2883,13 @@ discard block |
||
2883 | 2883 | { |
2884 | 2884 | if (defined('SID') && SID != '') |
2885 | 2885 | $setLocation = preg_replace_callback('~^' . preg_quote($scripturl, '/') . '\?(?:' . SID . '(?:;|&|&))((?:board|topic)=[^#]+?)(#[^"]*?)?$~', |
2886 | - function ($m) use ($scripturl) |
|
2886 | + function($m) use ($scripturl) |
|
2887 | 2887 | { |
2888 | - return $scripturl . '/' . strtr("$m[1]", '&;=', '//,') . '.html?' . SID. (isset($m[2]) ? "$m[2]" : ""); |
|
2888 | + return $scripturl . '/' . strtr("$m[1]", '&;=', '//,') . '.html?' . SID . (isset($m[2]) ? "$m[2]" : ""); |
|
2889 | 2889 | }, $setLocation); |
2890 | 2890 | else |
2891 | 2891 | $setLocation = preg_replace_callback('~^' . preg_quote($scripturl, '/') . '\?((?:board|topic)=[^#"]+?)(#[^"]*?)?$~', |
2892 | - function ($m) use ($scripturl) |
|
2892 | + function($m) use ($scripturl) |
|
2893 | 2893 | { |
2894 | 2894 | return $scripturl . '/' . strtr("$m[1]", '&;=', '//,') . '.html' . (isset($m[2]) ? "$m[2]" : ""); |
2895 | 2895 | }, $setLocation); |
@@ -3212,7 +3212,7 @@ discard block |
||
3212 | 3212 | |
3213 | 3213 | // Add a generic "Are you sure?" confirmation message. |
3214 | 3214 | addInlineJavaScript(' |
3215 | - var smf_you_sure =' . JavaScriptEscape($txt['quickmod_confirm']) .';'); |
|
3215 | + var smf_you_sure =' . JavaScriptEscape($txt['quickmod_confirm']) . ';'); |
|
3216 | 3216 | |
3217 | 3217 | // Now add the capping code for avatars. |
3218 | 3218 | if (!empty($modSettings['avatar_max_width_external']) && !empty($modSettings['avatar_max_height_external']) && !empty($modSettings['avatar_action_too_large']) && $modSettings['avatar_action_too_large'] == 'option_css_resize') |
@@ -3573,7 +3573,7 @@ discard block |
||
3573 | 3573 | |
3574 | 3574 | else |
3575 | 3575 | echo ' |
3576 | - <script src="', $settings['theme_url'] ,'/scripts/minified', ($do_deferred ? '_deferred' : '') ,'.js', $minSeed ,'"></script>'; |
|
3576 | + <script src="', $settings['theme_url'], '/scripts/minified', ($do_deferred ? '_deferred' : ''), '.js', $minSeed, '"></script>'; |
|
3577 | 3577 | } |
3578 | 3578 | |
3579 | 3579 | // Inline JavaScript - Actually useful some times! |
@@ -3651,14 +3651,14 @@ discard block |
||
3651 | 3651 | |
3652 | 3652 | else |
3653 | 3653 | echo ' |
3654 | - <link rel="stylesheet" href="', $settings['theme_url'] ,'/css/minified.css', $minSeed ,'">'; |
|
3654 | + <link rel="stylesheet" href="', $settings['theme_url'], '/css/minified.css', $minSeed, '">'; |
|
3655 | 3655 | } |
3656 | 3656 | |
3657 | 3657 | // Print the rest after the minified files. |
3658 | 3658 | if (!empty($normal)) |
3659 | 3659 | foreach ($normal as $nf) |
3660 | 3660 | echo ' |
3661 | - <link rel="stylesheet" href="', $nf ,'">'; |
|
3661 | + <link rel="stylesheet" href="', $nf, '">'; |
|
3662 | 3662 | |
3663 | 3663 | if ($db_show_debug === true) |
3664 | 3664 | { |
@@ -3674,7 +3674,7 @@ discard block |
||
3674 | 3674 | <style>'; |
3675 | 3675 | |
3676 | 3676 | foreach ($context['css_header'] as $css) |
3677 | - echo $css .' |
|
3677 | + echo $css . ' |
|
3678 | 3678 | '; |
3679 | 3679 | |
3680 | 3680 | echo' |
@@ -3703,27 +3703,27 @@ discard block |
||
3703 | 3703 | return false; |
3704 | 3704 | |
3705 | 3705 | // Did we already did this? |
3706 | - $toCache = cache_get_data('minimized_'. $settings['theme_id'] .'_'. $type, 86400); |
|
3706 | + $toCache = cache_get_data('minimized_' . $settings['theme_id'] . '_' . $type, 86400); |
|
3707 | 3707 | |
3708 | 3708 | // Already done? |
3709 | 3709 | if (!empty($toCache)) |
3710 | 3710 | return true; |
3711 | 3711 | |
3712 | 3712 | // No namespaces, sorry! |
3713 | - $classType = 'MatthiasMullie\\Minify\\'. strtoupper($type); |
|
3713 | + $classType = 'MatthiasMullie\\Minify\\' . strtoupper($type); |
|
3714 | 3714 | |
3715 | 3715 | // Temp path. |
3716 | - $cTempPath = $settings['theme_dir'] .'/'. ($type == 'css' ? 'css' : 'scripts') .'/'; |
|
3716 | + $cTempPath = $settings['theme_dir'] . '/' . ($type == 'css' ? 'css' : 'scripts') . '/'; |
|
3717 | 3717 | |
3718 | 3718 | // What kind of file are we going to create? |
3719 | - $toCreate = $cTempPath .'minified'. ($do_deferred ? '_deferred' : '') .'.'. $type; |
|
3719 | + $toCreate = $cTempPath . 'minified' . ($do_deferred ? '_deferred' : '') . '.' . $type; |
|
3720 | 3720 | |
3721 | 3721 | // File has to exists, if it isn't try to create it. |
3722 | 3722 | if ((!file_exists($toCreate) && @fopen($toCreate, 'w') === false) || !smf_chmod($toCreate)) |
3723 | 3723 | { |
3724 | 3724 | loadLanguage('Errors'); |
3725 | 3725 | log_error(sprintf($txt['file_not_created'], $toCreate), 'general'); |
3726 | - cache_put_data('minimized_'. $settings['theme_id'] .'_'. $type, null); |
|
3726 | + cache_put_data('minimized_' . $settings['theme_id'] . '_' . $type, null); |
|
3727 | 3727 | |
3728 | 3728 | // The process failed so roll back to print each individual file. |
3729 | 3729 | return $data; |
@@ -3758,14 +3758,14 @@ discard block |
||
3758 | 3758 | { |
3759 | 3759 | loadLanguage('Errors'); |
3760 | 3760 | log_error(sprintf($txt['file_not_created'], $toCreate), 'general'); |
3761 | - cache_put_data('minimized_'. $settings['theme_id'] .'_'. $type, null); |
|
3761 | + cache_put_data('minimized_' . $settings['theme_id'] . '_' . $type, null); |
|
3762 | 3762 | |
3763 | 3763 | // The process failed so roll back to print each individual file. |
3764 | 3764 | return $data; |
3765 | 3765 | } |
3766 | 3766 | |
3767 | 3767 | // And create a long lived cache entry. |
3768 | - cache_put_data('minimized_'. $settings['theme_id'] .'_'. $type, $toCreate, 86400); |
|
3768 | + cache_put_data('minimized_' . $settings['theme_id'] . '_' . $type, $toCreate, 86400); |
|
3769 | 3769 | |
3770 | 3770 | return true; |
3771 | 3771 | } |
@@ -3825,7 +3825,7 @@ discard block |
||
3825 | 3825 | else |
3826 | 3826 | $path = $modSettings['attachmentUploadDir']; |
3827 | 3827 | |
3828 | - return $path . '/' . $attachment_id . '_' . $file_hash .'.dat'; |
|
3828 | + return $path . '/' . $attachment_id . '_' . $file_hash . '.dat'; |
|
3829 | 3829 | } |
3830 | 3830 | |
3831 | 3831 | /** |
@@ -3869,10 +3869,10 @@ discard block |
||
3869 | 3869 | $valid_low = isValidIP($ip_parts[0]); |
3870 | 3870 | $valid_high = isValidIP($ip_parts[1]); |
3871 | 3871 | $count = 0; |
3872 | - $mode = (preg_match('/:/',$ip_parts[0]) > 0 ? ':' : '.'); |
|
3872 | + $mode = (preg_match('/:/', $ip_parts[0]) > 0 ? ':' : '.'); |
|
3873 | 3873 | $max = ($mode == ':' ? 'ffff' : '255'); |
3874 | 3874 | $min = 0; |
3875 | - if(!$valid_low) |
|
3875 | + if (!$valid_low) |
|
3876 | 3876 | { |
3877 | 3877 | $ip_parts[0] = preg_replace('/\*/', '0', $ip_parts[0]); |
3878 | 3878 | $valid_low = isValidIP($ip_parts[0]); |
@@ -3886,7 +3886,7 @@ discard block |
||
3886 | 3886 | } |
3887 | 3887 | |
3888 | 3888 | $count = 0; |
3889 | - if(!$valid_high) |
|
3889 | + if (!$valid_high) |
|
3890 | 3890 | { |
3891 | 3891 | $ip_parts[1] = preg_replace('/\*/', $max, $ip_parts[1]); |
3892 | 3892 | $valid_high = isValidIP($ip_parts[1]); |
@@ -3899,7 +3899,7 @@ discard block |
||
3899 | 3899 | } |
3900 | 3900 | } |
3901 | 3901 | |
3902 | - if($valid_high && $valid_low) |
|
3902 | + if ($valid_high && $valid_low) |
|
3903 | 3903 | { |
3904 | 3904 | $ip_array['low'] = $ip_parts[0]; |
3905 | 3905 | $ip_array['high'] = $ip_parts[1]; |
@@ -4081,7 +4081,7 @@ discard block |
||
4081 | 4081 | addInlineJavaScript(' |
4082 | 4082 | var user_menus = new smc_PopupMenu(); |
4083 | 4083 | user_menus.add("profile", "' . $scripturl . '?action=profile;area=popup"); |
4084 | - user_menus.add("alerts", "' . $scripturl . '?action=profile;area=alerts_popup;u='. $context['user']['id'] .'");', true); |
|
4084 | + user_menus.add("alerts", "' . $scripturl . '?action=profile;area=alerts_popup;u=' . $context['user']['id'] . '");', true); |
|
4085 | 4085 | if ($context['allow_pm']) |
4086 | 4086 | addInlineJavaScript(' |
4087 | 4087 | user_menus.add("pm", "' . $scripturl . '?action=pm;sa=popup");', true); |
@@ -4701,7 +4701,7 @@ discard block |
||
4701 | 4701 | // No? try a fallback to $sourcedir |
4702 | 4702 | else |
4703 | 4703 | { |
4704 | - $absPath = $sourcedir .'/'. $file; |
|
4704 | + $absPath = $sourcedir . '/' . $file; |
|
4705 | 4705 | |
4706 | 4706 | if (file_exists($absPath)) |
4707 | 4707 | require_once($absPath); |
@@ -4782,15 +4782,15 @@ discard block |
||
4782 | 4782 | |
4783 | 4783 | // UTF-8 occurences of MS special characters |
4784 | 4784 | $findchars_utf8 = array( |
4785 | - "\xe2\x80\x9a", // single low-9 quotation mark |
|
4786 | - "\xe2\x80\x9e", // double low-9 quotation mark |
|
4787 | - "\xe2\x80\xa6", // horizontal ellipsis |
|
4788 | - "\xe2\x80\x98", // left single curly quote |
|
4789 | - "\xe2\x80\x99", // right single curly quote |
|
4790 | - "\xe2\x80\x9c", // left double curly quote |
|
4791 | - "\xe2\x80\x9d", // right double curly quote |
|
4792 | - "\xe2\x80\x93", // en dash |
|
4793 | - "\xe2\x80\x94", // em dash |
|
4785 | + "\xe2\x80\x9a", // single low-9 quotation mark |
|
4786 | + "\xe2\x80\x9e", // double low-9 quotation mark |
|
4787 | + "\xe2\x80\xa6", // horizontal ellipsis |
|
4788 | + "\xe2\x80\x98", // left single curly quote |
|
4789 | + "\xe2\x80\x99", // right single curly quote |
|
4790 | + "\xe2\x80\x9c", // left double curly quote |
|
4791 | + "\xe2\x80\x9d", // right double curly quote |
|
4792 | + "\xe2\x80\x93", // en dash |
|
4793 | + "\xe2\x80\x94", // em dash |
|
4794 | 4794 | ); |
4795 | 4795 | |
4796 | 4796 | // windows 1252 / iso equivalents |
@@ -4808,15 +4808,15 @@ discard block |
||
4808 | 4808 | |
4809 | 4809 | // safe replacements |
4810 | 4810 | $replacechars = array( |
4811 | - ',', // ‚ |
|
4812 | - ',,', // „ |
|
4813 | - '...', // … |
|
4814 | - "'", // ‘ |
|
4815 | - "'", // ’ |
|
4816 | - '"', // “ |
|
4817 | - '"', // ” |
|
4818 | - '-', // – |
|
4819 | - '--', // — |
|
4811 | + ',', // ‚ |
|
4812 | + ',,', // „ |
|
4813 | + '...', // … |
|
4814 | + "'", // ‘ |
|
4815 | + "'", // ’ |
|
4816 | + '"', // “ |
|
4817 | + '"', // ” |
|
4818 | + '-', // – |
|
4819 | + '--', // — |
|
4820 | 4820 | ); |
4821 | 4821 | |
4822 | 4822 | if ($context['utf8']) |
@@ -5234,7 +5234,7 @@ discard block |
||
5234 | 5234 | */ |
5235 | 5235 | function inet_dtop($bin) |
5236 | 5236 | { |
5237 | - if(empty($bin)) |
|
5237 | + if (empty($bin)) |
|
5238 | 5238 | return ''; |
5239 | 5239 | |
5240 | 5240 | global $db_type; |
@@ -5265,28 +5265,28 @@ discard block |
||
5265 | 5265 | */ |
5266 | 5266 | function _safe_serialize($value) |
5267 | 5267 | { |
5268 | - if(is_null($value)) |
|
5268 | + if (is_null($value)) |
|
5269 | 5269 | return 'N;'; |
5270 | 5270 | |
5271 | - if(is_bool($value)) |
|
5272 | - return 'b:'. (int) $value .';'; |
|
5271 | + if (is_bool($value)) |
|
5272 | + return 'b:' . (int) $value . ';'; |
|
5273 | 5273 | |
5274 | - if(is_int($value)) |
|
5275 | - return 'i:'. $value .';'; |
|
5274 | + if (is_int($value)) |
|
5275 | + return 'i:' . $value . ';'; |
|
5276 | 5276 | |
5277 | - if(is_float($value)) |
|
5278 | - return 'd:'. str_replace(',', '.', $value) .';'; |
|
5277 | + if (is_float($value)) |
|
5278 | + return 'd:' . str_replace(',', '.', $value) . ';'; |
|
5279 | 5279 | |
5280 | - if(is_string($value)) |
|
5281 | - return 's:'. strlen($value) .':"'. $value .'";'; |
|
5280 | + if (is_string($value)) |
|
5281 | + return 's:' . strlen($value) . ':"' . $value . '";'; |
|
5282 | 5282 | |
5283 | - if(is_array($value)) |
|
5283 | + if (is_array($value)) |
|
5284 | 5284 | { |
5285 | 5285 | $out = ''; |
5286 | - foreach($value as $k => $v) |
|
5286 | + foreach ($value as $k => $v) |
|
5287 | 5287 | $out .= _safe_serialize($k) . _safe_serialize($v); |
5288 | 5288 | |
5289 | - return 'a:'. count($value) .':{'. $out .'}'; |
|
5289 | + return 'a:' . count($value) . ':{' . $out . '}'; |
|
5290 | 5290 | } |
5291 | 5291 | |
5292 | 5292 | // safe_serialize cannot serialize resources or objects. |
@@ -5328,7 +5328,7 @@ discard block |
||
5328 | 5328 | function _safe_unserialize($str) |
5329 | 5329 | { |
5330 | 5330 | // Input is not a string. |
5331 | - if(empty($str) || !is_string($str)) |
|
5331 | + if (empty($str) || !is_string($str)) |
|
5332 | 5332 | return false; |
5333 | 5333 | |
5334 | 5334 | $stack = array(); |
@@ -5342,40 +5342,40 @@ discard block |
||
5342 | 5342 | * 3 - in array, expecting value or another array |
5343 | 5343 | */ |
5344 | 5344 | $state = 0; |
5345 | - while($state != 1) |
|
5345 | + while ($state != 1) |
|
5346 | 5346 | { |
5347 | 5347 | $type = isset($str[0]) ? $str[0] : ''; |
5348 | - if($type == '}') |
|
5348 | + if ($type == '}') |
|
5349 | 5349 | $str = substr($str, 1); |
5350 | 5350 | |
5351 | - else if($type == 'N' && $str[1] == ';') |
|
5351 | + else if ($type == 'N' && $str[1] == ';') |
|
5352 | 5352 | { |
5353 | 5353 | $value = null; |
5354 | 5354 | $str = substr($str, 2); |
5355 | 5355 | } |
5356 | - else if($type == 'b' && preg_match('/^b:([01]);/', $str, $matches)) |
|
5356 | + else if ($type == 'b' && preg_match('/^b:([01]);/', $str, $matches)) |
|
5357 | 5357 | { |
5358 | 5358 | $value = $matches[1] == '1' ? true : false; |
5359 | 5359 | $str = substr($str, 4); |
5360 | 5360 | } |
5361 | - else if($type == 'i' && preg_match('/^i:(-?[0-9]+);(.*)/s', $str, $matches)) |
|
5361 | + else if ($type == 'i' && preg_match('/^i:(-?[0-9]+);(.*)/s', $str, $matches)) |
|
5362 | 5362 | { |
5363 | - $value = (int)$matches[1]; |
|
5363 | + $value = (int) $matches[1]; |
|
5364 | 5364 | $str = $matches[2]; |
5365 | 5365 | } |
5366 | - else if($type == 'd' && preg_match('/^d:(-?[0-9]+\.?[0-9]*(E[+-][0-9]+)?);(.*)/s', $str, $matches)) |
|
5366 | + else if ($type == 'd' && preg_match('/^d:(-?[0-9]+\.?[0-9]*(E[+-][0-9]+)?);(.*)/s', $str, $matches)) |
|
5367 | 5367 | { |
5368 | - $value = (float)$matches[1]; |
|
5368 | + $value = (float) $matches[1]; |
|
5369 | 5369 | $str = $matches[3]; |
5370 | 5370 | } |
5371 | - else if($type == 's' && preg_match('/^s:([0-9]+):"(.*)/s', $str, $matches) && substr($matches[2], (int)$matches[1], 2) == '";') |
|
5371 | + else if ($type == 's' && preg_match('/^s:([0-9]+):"(.*)/s', $str, $matches) && substr($matches[2], (int) $matches[1], 2) == '";') |
|
5372 | 5372 | { |
5373 | - $value = substr($matches[2], 0, (int)$matches[1]); |
|
5374 | - $str = substr($matches[2], (int)$matches[1] + 2); |
|
5373 | + $value = substr($matches[2], 0, (int) $matches[1]); |
|
5374 | + $str = substr($matches[2], (int) $matches[1] + 2); |
|
5375 | 5375 | } |
5376 | - else if($type == 'a' && preg_match('/^a:([0-9]+):{(.*)/s', $str, $matches)) |
|
5376 | + else if ($type == 'a' && preg_match('/^a:([0-9]+):{(.*)/s', $str, $matches)) |
|
5377 | 5377 | { |
5378 | - $expectedLength = (int)$matches[1]; |
|
5378 | + $expectedLength = (int) $matches[1]; |
|
5379 | 5379 | $str = $matches[2]; |
5380 | 5380 | } |
5381 | 5381 | |
@@ -5383,10 +5383,10 @@ discard block |
||
5383 | 5383 | else |
5384 | 5384 | return false; |
5385 | 5385 | |
5386 | - switch($state) |
|
5386 | + switch ($state) |
|
5387 | 5387 | { |
5388 | 5388 | case 3: // In array, expecting value or another array. |
5389 | - if($type == 'a') |
|
5389 | + if ($type == 'a') |
|
5390 | 5390 | { |
5391 | 5391 | $stack[] = &$list; |
5392 | 5392 | $list[$key] = array(); |
@@ -5395,7 +5395,7 @@ discard block |
||
5395 | 5395 | $state = 2; |
5396 | 5396 | break; |
5397 | 5397 | } |
5398 | - if($type != '}') |
|
5398 | + if ($type != '}') |
|
5399 | 5399 | { |
5400 | 5400 | $list[$key] = $value; |
5401 | 5401 | $state = 2; |
@@ -5406,29 +5406,29 @@ discard block |
||
5406 | 5406 | return false; |
5407 | 5407 | |
5408 | 5408 | case 2: // in array, expecting end of array or a key |
5409 | - if($type == '}') |
|
5409 | + if ($type == '}') |
|
5410 | 5410 | { |
5411 | 5411 | // Array size is less than expected. |
5412 | - if(count($list) < end($expected)) |
|
5412 | + if (count($list) < end($expected)) |
|
5413 | 5413 | return false; |
5414 | 5414 | |
5415 | 5415 | unset($list); |
5416 | - $list = &$stack[count($stack)-1]; |
|
5416 | + $list = &$stack[count($stack) - 1]; |
|
5417 | 5417 | array_pop($stack); |
5418 | 5418 | |
5419 | 5419 | // Go to terminal state if we're at the end of the root array. |
5420 | 5420 | array_pop($expected); |
5421 | 5421 | |
5422 | - if(count($expected) == 0) |
|
5422 | + if (count($expected) == 0) |
|
5423 | 5423 | $state = 1; |
5424 | 5424 | |
5425 | 5425 | break; |
5426 | 5426 | } |
5427 | 5427 | |
5428 | - if($type == 'i' || $type == 's') |
|
5428 | + if ($type == 'i' || $type == 's') |
|
5429 | 5429 | { |
5430 | 5430 | // Array size exceeds expected length. |
5431 | - if(count($list) >= end($expected)) |
|
5431 | + if (count($list) >= end($expected)) |
|
5432 | 5432 | return false; |
5433 | 5433 | |
5434 | 5434 | $key = $value; |
@@ -5441,7 +5441,7 @@ discard block |
||
5441 | 5441 | |
5442 | 5442 | // Expecting array or value. |
5443 | 5443 | case 0: |
5444 | - if($type == 'a') |
|
5444 | + if ($type == 'a') |
|
5445 | 5445 | { |
5446 | 5446 | $data = array(); |
5447 | 5447 | $list = &$data; |
@@ -5450,7 +5450,7 @@ discard block |
||
5450 | 5450 | break; |
5451 | 5451 | } |
5452 | 5452 | |
5453 | - if($type != '}') |
|
5453 | + if ($type != '}') |
|
5454 | 5454 | { |
5455 | 5455 | $data = $value; |
5456 | 5456 | $state = 1; |
@@ -5463,7 +5463,7 @@ discard block |
||
5463 | 5463 | } |
5464 | 5464 | |
5465 | 5465 | // Trailing data in input. |
5466 | - if(!empty($str)) |
|
5466 | + if (!empty($str)) |
|
5467 | 5467 | return false; |
5468 | 5468 | |
5469 | 5469 | return $data; |
@@ -5517,7 +5517,7 @@ discard block |
||
5517 | 5517 | // Set different modes. |
5518 | 5518 | $chmodValues = $isDir ? array(0750, 0755, 0775, 0777) : array(0644, 0664, 0666); |
5519 | 5519 | |
5520 | - foreach($chmodValues as $val) |
|
5520 | + foreach ($chmodValues as $val) |
|
5521 | 5521 | { |
5522 | 5522 | // If it's writable, break out of the loop. |
5523 | 5523 | if (is_writable($file)) |
@@ -5552,13 +5552,13 @@ discard block |
||
5552 | 5552 | $returnArray = @json_decode($json, $returnAsArray); |
5553 | 5553 | |
5554 | 5554 | // PHP 5.3 so no json_last_error_msg() |
5555 | - switch(json_last_error()) |
|
5555 | + switch (json_last_error()) |
|
5556 | 5556 | { |
5557 | 5557 | case JSON_ERROR_NONE: |
5558 | 5558 | $jsonError = false; |
5559 | 5559 | break; |
5560 | 5560 | case JSON_ERROR_DEPTH: |
5561 | - $jsonError = 'JSON_ERROR_DEPTH'; |
|
5561 | + $jsonError = 'JSON_ERROR_DEPTH'; |
|
5562 | 5562 | break; |
5563 | 5563 | case JSON_ERROR_STATE_MISMATCH: |
5564 | 5564 | $jsonError = 'JSON_ERROR_STATE_MISMATCH'; |
@@ -5586,10 +5586,10 @@ discard block |
||
5586 | 5586 | loadLanguage('Errors'); |
5587 | 5587 | |
5588 | 5588 | if (!empty($jsonDebug)) |
5589 | - log_error($txt['json_'. $jsonError], 'critical', $jsonDebug['file'], $jsonDebug['line']); |
|
5589 | + log_error($txt['json_' . $jsonError], 'critical', $jsonDebug['file'], $jsonDebug['line']); |
|
5590 | 5590 | |
5591 | 5591 | else |
5592 | - log_error($txt['json_'. $jsonError], 'critical'); |
|
5592 | + log_error($txt['json_' . $jsonError], 'critical'); |
|
5593 | 5593 | |
5594 | 5594 | // Everyone expects an array. |
5595 | 5595 | return array(); |
@@ -5701,7 +5701,7 @@ discard block |
||
5701 | 5701 | }); |
5702 | 5702 | |
5703 | 5703 | // Convert Punycode to Unicode |
5704 | - $tlds = array_map(function ($input) { |
|
5704 | + $tlds = array_map(function($input) { |
|
5705 | 5705 | $prefix = 'xn--'; |
5706 | 5706 | $safe_char = 0xFFFC; |
5707 | 5707 | $base = 36; |
@@ -5717,7 +5717,7 @@ discard block |
||
5717 | 5717 | |
5718 | 5718 | foreach ($enco_parts as $encoded) |
5719 | 5719 | { |
5720 | - if (strpos($encoded,$prefix) !== 0 || strlen(trim(str_replace($prefix,'',$encoded))) == 0) |
|
5720 | + if (strpos($encoded, $prefix) !== 0 || strlen(trim(str_replace($prefix, '', $encoded))) == 0) |
|
5721 | 5721 | { |
5722 | 5722 | $output_parts[] = $encoded; |
5723 | 5723 | continue; |
@@ -5728,7 +5728,7 @@ discard block |
||
5728 | 5728 | $idx = 0; |
5729 | 5729 | $char = 0x80; |
5730 | 5730 | $decoded = array(); |
5731 | - $output=''; |
|
5731 | + $output = ''; |
|
5732 | 5732 | $delim_pos = strrpos($encoded, '-'); |
5733 | 5733 | |
5734 | 5734 | if ($delim_pos > strlen($prefix)) |
@@ -5744,7 +5744,7 @@ discard block |
||
5744 | 5744 | |
5745 | 5745 | for ($enco_idx = $delim_pos ? ($delim_pos + 1) : 0; $enco_idx < $enco_len; ++$deco_len) |
5746 | 5746 | { |
5747 | - for ($old_idx = $idx, $w = 1, $k = $base; 1 ; $k += $base) |
|
5747 | + for ($old_idx = $idx, $w = 1, $k = $base; 1; $k += $base) |
|
5748 | 5748 | { |
5749 | 5749 | $cp = ord($encoded{$enco_idx++}); |
5750 | 5750 | $digit = ($cp - 48 < 10) ? $cp - 22 : (($cp - 65 < 26) ? $cp - 65 : (($cp - 97 < 26) ? $cp - 97 : $base)); |
@@ -5785,15 +5785,15 @@ discard block |
||
5785 | 5785 | |
5786 | 5786 | // 2 bytes |
5787 | 5787 | elseif ($v < (1 << 11)) |
5788 | - $output .= chr(192+($v >> 6)) . chr(128+($v & 63)); |
|
5788 | + $output .= chr(192 + ($v >> 6)) . chr(128 + ($v & 63)); |
|
5789 | 5789 | |
5790 | 5790 | // 3 bytes |
5791 | 5791 | elseif ($v < (1 << 16)) |
5792 | - $output .= chr(224+($v >> 12)) . chr(128+(($v >> 6) & 63)) . chr(128+($v & 63)); |
|
5792 | + $output .= chr(224 + ($v >> 12)) . chr(128 + (($v >> 6) & 63)) . chr(128 + ($v & 63)); |
|
5793 | 5793 | |
5794 | 5794 | // 4 bytes |
5795 | 5795 | elseif ($v < (1 << 21)) |
5796 | - $output .= chr(240+($v >> 18)) . chr(128+(($v >> 12) & 63)) . chr(128+(($v >> 6) & 63)) . chr(128+($v & 63)); |
|
5796 | + $output .= chr(240 + ($v >> 18)) . chr(128 + (($v >> 12) & 63)) . chr(128 + (($v >> 6) & 63)) . chr(128 + ($v & 63)); |
|
5797 | 5797 | |
5798 | 5798 | // 'Conversion from UCS-4 to UTF-8 failed: malformed input at byte '.$k |
5799 | 5799 | else |
@@ -5898,7 +5898,7 @@ discard block |
||
5898 | 5898 | } |
5899 | 5899 | |
5900 | 5900 | // This recursive function creates the index array from the strings |
5901 | - $add_string_to_index = function ($string, $index) use (&$strlen, &$substr, &$add_string_to_index) |
|
5901 | + $add_string_to_index = function($string, $index) use (&$strlen, &$substr, &$add_string_to_index) |
|
5902 | 5902 | { |
5903 | 5903 | static $depth = 0; |
5904 | 5904 | $depth++; |
@@ -5925,7 +5925,7 @@ discard block |
||
5925 | 5925 | }; |
5926 | 5926 | |
5927 | 5927 | // This recursive function turns the index array into a regular expression |
5928 | - $index_to_regex = function (&$index, $delim) use (&$strlen, &$index_to_regex) |
|
5928 | + $index_to_regex = function(&$index, $delim) use (&$strlen, &$index_to_regex) |
|
5929 | 5929 | { |
5930 | 5930 | static $depth = 0; |
5931 | 5931 | $depth++; |
@@ -5949,11 +5949,11 @@ discard block |
||
5949 | 5949 | |
5950 | 5950 | if (count(array_keys($value)) == 1) |
5951 | 5951 | { |
5952 | - $new_key_array = explode('(?'.'>', $sub_regex); |
|
5952 | + $new_key_array = explode('(?' . '>', $sub_regex); |
|
5953 | 5953 | $new_key .= $new_key_array[0]; |
5954 | 5954 | } |
5955 | 5955 | else |
5956 | - $sub_regex = '(?'.'>' . $sub_regex . ')'; |
|
5956 | + $sub_regex = '(?' . '>' . $sub_regex . ')'; |
|
5957 | 5957 | } |
5958 | 5958 | |
5959 | 5959 | if ($depth > 1) |
@@ -5996,10 +5996,10 @@ discard block |
||
5996 | 5996 | { |
5997 | 5997 | $regex = array(); |
5998 | 5998 | while (!empty($index)) |
5999 | - $regex[] = '(?'.'>' . $index_to_regex($index, $delim) . ')'; |
|
5999 | + $regex[] = '(?' . '>' . $index_to_regex($index, $delim) . ')'; |
|
6000 | 6000 | } |
6001 | 6001 | else |
6002 | - $regex = '(?'.'>' . $index_to_regex($index, $delim) . ')'; |
|
6002 | + $regex = '(?' . '>' . $index_to_regex($index, $delim) . ')'; |
|
6003 | 6003 | |
6004 | 6004 | // Restore PHP's internal character encoding to whatever it was originally |
6005 | 6005 | if (!empty($current_encoding)) |
@@ -6020,7 +6020,7 @@ discard block |
||
6020 | 6020 | $url = str_ireplace('http://', 'https://', $url) . '/'; |
6021 | 6021 | |
6022 | 6022 | $result = false; |
6023 | - $stream = stream_context_create (array("ssl" => array("capture_peer_cert" => true))); |
|
6023 | + $stream = stream_context_create(array("ssl" => array("capture_peer_cert" => true))); |
|
6024 | 6024 | $read = @fopen($url, "rb", false, $stream); |
6025 | 6025 | if ($read !== false) { |
6026 | 6026 | $cont = stream_context_get_params($read); |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | |
73 | 73 | echo ' |
74 | 74 | <div class="main_container"> |
75 | - <div class="cat_bar ', $category['is_collapsed'] ? 'collapsed' : '','" id="category_', $category['id'], '"> |
|
75 | + <div class="cat_bar ', $category['is_collapsed'] ? 'collapsed' : '', '" id="category_', $category['id'], '"> |
|
76 | 76 | <h3 class="catbg">'; |
77 | 77 | |
78 | 78 | // If this category even can collapse, show a link to collapse it. |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | foreach ($board['children'] as $child) |
248 | 248 | { |
249 | 249 | if (!$child['is_redirect']) |
250 | - $child['link'] = ''. ($child['new'] ? '<a href="' . $scripturl . '?action=unread;board=' . $child['id'] . '" title="' . $txt['new_posts'] . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')"><span class="new_posts">' . $txt['new'] . '</span></a>' : '') . '<a href="' . $child['href'] . '" ' . ($child['new'] ? 'class="board_new_posts" ' : '') . 'title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')">' . $child['name'] . '</a>'; |
|
250 | + $child['link'] = '' . ($child['new'] ? '<a href="' . $scripturl . '?action=unread;board=' . $child['id'] . '" title="' . $txt['new_posts'] . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')"><span class="new_posts">' . $txt['new'] . '</span></a>' : '') . '<a href="' . $child['href'] . '" ' . ($child['new'] ? 'class="board_new_posts" ' : '') . 'title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')">' . $child['name'] . '</a>'; |
|
251 | 251 | else |
252 | 252 | $child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . ' - ' . $child['short_description'] . '">' . $child['name'] . '</a>'; |
253 | 253 |
@@ -1719,7 +1719,7 @@ |
||
1719 | 1719 | $id_theme = $modSettings['theme_guests']; |
1720 | 1720 | |
1721 | 1721 | // We already load the basic stuff? |
1722 | - if (empty($settings['theme_id']) || $settings['theme_id'] != $id_theme ) |
|
1722 | + if (empty($settings['theme_id']) || $settings['theme_id'] != $id_theme) |
|
1723 | 1723 | { |
1724 | 1724 | // Verify the id_theme... no foul play. |
1725 | 1725 | // Always allow the board specific theme, if they are overriding. |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | |
92 | 92 | $table = str_replace('{db_prefix}', $db_prefix, $table); |
93 | 93 | |
94 | - $pg_tables = array('pg_catalog','information_schema'); |
|
94 | + $pg_tables = array('pg_catalog', 'information_schema'); |
|
95 | 95 | |
96 | 96 | $request = $smcFunc['db_query']('', ' |
97 | 97 | SELECT pg_relation_size(C.oid) AS "size" |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | global $db_connection; |
291 | 291 | static $ver; |
292 | 292 | |
293 | - if(!empty($ver)) |
|
293 | + if (!empty($ver)) |
|
294 | 294 | return $ver; |
295 | 295 | |
296 | 296 | $ver = pg_version($db_connection)['server']; |