@@ -384,7 +384,7 @@ |
||
| 384 | 384 | clean_cache(); |
| 385 | 385 | |
| 386 | 386 | // If warning decrement is enabled and we have people who have not had a new warning in 24 hours, lower their warning level. |
| 387 | - list (, , $modSettings['warning_decrement']) = explode(',', $modSettings['warning_settings']); |
|
| 387 | + list (,, $modSettings['warning_decrement']) = explode(',', $modSettings['warning_settings']); |
|
| 388 | 388 | if ($modSettings['warning_decrement']) |
| 389 | 389 | { |
| 390 | 390 | // Find every member who has a warning level... |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | display_db_error(); |
| 74 | 74 | |
| 75 | 75 | // We need to escape ' and \ |
| 76 | - $db_passwd = str_replace(array('\\','\''), array('\\\\','\\\''), $db_passwd); |
|
| 76 | + $db_passwd = str_replace(array('\\', '\''), array('\\\\', '\\\''), $db_passwd); |
|
| 77 | 77 | |
| 78 | 78 | if (!empty($db_options['persist'])) |
| 79 | 79 | $connection = @pg_pconnect((empty($db_server) ? '' : 'host=' . $db_server . ' ') . 'dbname=' . $db_name . ' user=\'' . $db_user . '\' password=\'' . $db_passwd . '\'' . (empty($db_options['port']) ? '' : ' port=\'' . $db_options['port'] . '\'')); |
@@ -925,7 +925,7 @@ discard block |
||
| 925 | 925 | if (filter_var($error_array[2], FILTER_VALIDATE_IP) === false) |
| 926 | 926 | $error_array[2] = null; |
| 927 | 927 | |
| 928 | - if(empty($db_persist)) |
|
| 928 | + if (empty($db_persist)) |
|
| 929 | 929 | { // without pooling |
| 930 | 930 | if (empty($pg_error_data_prep)) |
| 931 | 931 | $pg_error_data_prep = pg_prepare($db_connection, 'smf_log_errors', |
@@ -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', |
@@ -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'] |
@@ -93,14 +93,14 @@ discard block |
||
| 93 | 93 | ), |
| 94 | 94 | 'ignore' => array( |
| 95 | 95 | 'label' => $report['ignore'] ? $txt['mc_reportedp_unignore'] : $txt['mc_reportedp_ignore'], |
| 96 | - 'href' => $scripturl.'?action=moderate;area=reported'.$context['report_type'].';sa=handle;ignore='.(int)!$report['ignore'].';rid='.$report['id'].';start='.$context['start'].';'.$context['session_var'].'='.$context['session_id'].';'.$context['mod-report-ignore_token_var'].'='.$context['mod-report-ignore_token'], |
|
| 96 | + 'href' => $scripturl . '?action=moderate;area=reported' . $context['report_type'] . ';sa=handle;ignore=' . (int) !$report['ignore'] . ';rid=' . $report['id'] . ';start=' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'] . ';' . $context['mod-report-ignore_token_var'] . '=' . $context['mod-report-ignore_token'], |
|
| 97 | 97 | 'javascript' => !$report['ignore'] ? ' data-confirm="' . $txt['mc_reportedp_ignore_confirm'] . '"' : '', |
| 98 | 98 | 'class' => 'you_sure', |
| 99 | 99 | 'icon' => 'ignore' |
| 100 | 100 | ), |
| 101 | 101 | 'close' => array( |
| 102 | 102 | 'label' => $context['view_closed'] ? $txt['mc_reportedp_open'] : $txt['mc_reportedp_close'], |
| 103 | - 'href' => $scripturl.'?action=moderate;area=reported'.$context['report_type'].';sa=handle;closed='.(int)!$report['closed'].';rid='.$report['id'].';start='.$context['start'].';'.$context['session_var'].'='.$context['session_id'].';'.$context['mod-report-closed_token_var'].'='.$context['mod-report-closed_token'], |
|
| 103 | + 'href' => $scripturl . '?action=moderate;area=reported' . $context['report_type'] . ';sa=handle;closed=' . (int) !$report['closed'] . ';rid=' . $report['id'] . ';start=' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'] . ';' . $context['mod-report-closed_token_var'] . '=' . $context['mod-report-closed_token'], |
|
| 104 | 104 | 'icon' => $context['view_closed'] ? 'folder' : 'close', |
| 105 | 105 | ), |
| 106 | 106 | ); |
@@ -109,8 +109,8 @@ discard block |
||
| 109 | 109 | if ($context['report_type'] == 'posts') |
| 110 | 110 | $context['reports'][$key]['quickbuttons']['delete'] = array( |
| 111 | 111 | 'label' => $txt['mc_reportedp_delete'], |
| 112 | - 'href' => $scripturl.'?action=deletemsg;topic='.$report['topic']['id'].'.0;msg='.$report['topic']['id_msg'].';modcenter;'.$context['session_var'].'='.$context['session_id'], |
|
| 113 | - 'javascript' => 'data-confirm="'.$txt['mc_reportedp_delete_confirm'].'"', |
|
| 112 | + 'href' => $scripturl . '?action=deletemsg;topic=' . $report['topic']['id'] . '.0;msg=' . $report['topic']['id_msg'] . ';modcenter;' . $context['session_var'] . '=' . $context['session_id'], |
|
| 113 | + 'javascript' => 'data-confirm="' . $txt['mc_reportedp_delete_confirm'] . '"', |
|
| 114 | 114 | 'class' => 'you_sure', |
| 115 | 115 | 'icon' => 'delete', |
| 116 | 116 | 'show' => !$report['closed'] && (is_array($context['report_remove_any_boards']) && in_array($report['topic']['id_board'], $context['report_remove_any_boards'])) |
@@ -118,9 +118,9 @@ discard block |
||
| 118 | 118 | |
| 119 | 119 | // Ban reported member/post author link |
| 120 | 120 | if ($context['report_type'] == 'members') |
| 121 | - $ban_link = $scripturl.'?action=admin;area=ban;sa=add;u='.$report['user']['id'].';'.$context['session_var'].'='.$context['session_id']; |
|
| 121 | + $ban_link = $scripturl . '?action=admin;area=ban;sa=add;u=' . $report['user']['id'] . ';' . $context['session_var'] . '=' . $context['session_id']; |
|
| 122 | 122 | else |
| 123 | - $ban_link = $scripturl.'?action=admin;area=ban;sa=add'.(!empty($report['author']['id']) ? ';u='.$report['author']['id'] : ';msg='.$report['topic']['id_msg']).';'.$context['session_var'].'='.$context['session_id']; |
|
| 123 | + $ban_link = $scripturl . '?action=admin;area=ban;sa=add' . (!empty($report['author']['id']) ? ';u=' . $report['author']['id'] : ';msg=' . $report['topic']['id_msg']) . ';' . $context['session_var'] . '=' . $context['session_id']; |
|
| 124 | 124 | |
| 125 | 125 | $context['reports'][$key]['quickbuttons'] += array( |
| 126 | 126 | 'ban' => array( |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | 'show' => !$report['closed'] && !empty($context['report_manage_bans']) && ($context['report_type'] == 'posts' || $context['report_type'] == 'members' && !empty($report['user']['id'])) |
| 131 | 131 | ), |
| 132 | 132 | 'quickmod' => array( |
| 133 | - 'content' => '<input type="checkbox" name="close[]" value="'.$report['id'].'">', |
|
| 133 | + 'content' => '<input type="checkbox" name="close[]" value="' . $report['id'] . '">', |
|
| 134 | 134 | 'show' => !$context['view_closed'] |
| 135 | 135 | ) |
| 136 | 136 | ); |
@@ -1655,14 +1655,14 @@ discard block |
||
| 1655 | 1655 | $output['quickbuttons'] = array( |
| 1656 | 1656 | 'quote' => array( |
| 1657 | 1657 | 'label' => $txt['quote_action'], |
| 1658 | - 'href' => $scripturl.'?action=post;quote='.$output['id'].';topic='.$context['current_topic'], '.'.$context['start'].';last_msg='.$context['topic_last_message'], |
|
| 1659 | - 'javascript' => 'onclick="return oQuickReply.quote('.$output['id'].');"', |
|
| 1658 | + 'href' => $scripturl . '?action=post;quote=' . $output['id'] . ';topic=' . $context['current_topic'], '.' . $context['start'] . ';last_msg=' . $context['topic_last_message'], |
|
| 1659 | + 'javascript' => 'onclick="return oQuickReply.quote(' . $output['id'] . ');"', |
|
| 1660 | 1660 | 'icon' => 'quote', |
| 1661 | 1661 | 'show' => $context['can_quote'] |
| 1662 | 1662 | ), |
| 1663 | 1663 | 'quote_selected' => array( |
| 1664 | 1664 | 'label' => $txt['quote_selected_action'], |
| 1665 | - 'id' => 'quoteSelected_'. $output['id'], |
|
| 1665 | + 'id' => 'quoteSelected_' . $output['id'], |
|
| 1666 | 1666 | 'href' => 'javascript:void(0)', |
| 1667 | 1667 | 'custom' => 'style="display:none"', |
| 1668 | 1668 | 'icon' => 'quote_selected', |
@@ -1671,73 +1671,73 @@ discard block |
||
| 1671 | 1671 | 'quick_edit' => array( |
| 1672 | 1672 | 'label' => $txt['quick_edit'], |
| 1673 | 1673 | 'class' => 'quick_edit', |
| 1674 | - 'id' =>' modify_button_'. $output['id'], |
|
| 1675 | - 'custom' => 'onclick="oQuickModify.modifyMsg(\''.$output['id'].'\', \''.!empty($modSettings['toggle_subject']).'\')"', |
|
| 1674 | + 'id' =>' modify_button_' . $output['id'], |
|
| 1675 | + 'custom' => 'onclick="oQuickModify.modifyMsg(\'' . $output['id'] . '\', \'' . !empty($modSettings['toggle_subject']) . '\')"', |
|
| 1676 | 1676 | 'icon' => 'quick_edit_button', |
| 1677 | 1677 | 'show' => $output['can_modify'] |
| 1678 | 1678 | ), |
| 1679 | 1679 | 'more' => array( |
| 1680 | 1680 | 'modify' => array( |
| 1681 | 1681 | 'label' => $txt['modify'], |
| 1682 | - 'href' => $scripturl.'?action=post;msg='.$output['id'].';topic='.$context['current_topic'].'.'.$context['start'], |
|
| 1682 | + 'href' => $scripturl . '?action=post;msg=' . $output['id'] . ';topic=' . $context['current_topic'] . '.' . $context['start'], |
|
| 1683 | 1683 | 'icon' => 'modify_button', |
| 1684 | 1684 | 'show' => $output['can_modify'] |
| 1685 | 1685 | ), |
| 1686 | 1686 | 'remove_topic' => array( |
| 1687 | 1687 | 'label' => $txt['remove_topic'], |
| 1688 | - 'href' => $scripturl.'?action=removetopic2;topic='.$context['current_topic'].'.'.$context['start'].';'.$context['session_var'].'='.$context['session_id'], |
|
| 1689 | - 'javascript' => 'data-confirm="'.$txt['are_sure_remove_topic'].'"', |
|
| 1688 | + 'href' => $scripturl . '?action=removetopic2;topic=' . $context['current_topic'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'], |
|
| 1689 | + 'javascript' => 'data-confirm="' . $txt['are_sure_remove_topic'] . '"', |
|
| 1690 | 1690 | 'class' => 'you_sure', |
| 1691 | 1691 | 'icon' => 'remove_button', |
| 1692 | 1692 | 'show' => $context['can_delete'] && ($context['topic_first_message'] == $output['id']) |
| 1693 | 1693 | ), |
| 1694 | 1694 | 'remove' => array( |
| 1695 | 1695 | 'label' => $txt['remove'], |
| 1696 | - 'href' => $scripturl.'?action=deletemsg;topic='.$context['current_topic'].'.'.$context['start'].';msg='.$output['id'].';'.$context['session_var'].'='.$context['session_id'], |
|
| 1697 | - 'javascript' => 'data-confirm="'.$txt['remove_message_question'].'"', |
|
| 1696 | + 'href' => $scripturl . '?action=deletemsg;topic=' . $context['current_topic'] . '.' . $context['start'] . ';msg=' . $output['id'] . ';' . $context['session_var'] . '=' . $context['session_id'], |
|
| 1697 | + 'javascript' => 'data-confirm="' . $txt['remove_message_question'] . '"', |
|
| 1698 | 1698 | 'class' => 'you_sure', |
| 1699 | 1699 | 'icon' => 'remove_button', |
| 1700 | 1700 | 'show' => $output['can_remove'] && ($context['topic_first_message'] != $output['id']) |
| 1701 | 1701 | ), |
| 1702 | 1702 | 'split' => array( |
| 1703 | 1703 | 'label' => $txt['split'], |
| 1704 | - 'href' => $scripturl.'?action=splittopics;topic='.$context['current_topic'].'.0;at='.$output['id'], |
|
| 1704 | + 'href' => $scripturl . '?action=splittopics;topic=' . $context['current_topic'] . '.0;at=' . $output['id'], |
|
| 1705 | 1705 | 'icon' => 'split_button', |
| 1706 | 1706 | 'show' => $context['can_split'] && !empty($context['real_num_replies']) |
| 1707 | 1707 | ), |
| 1708 | 1708 | 'report' => array( |
| 1709 | 1709 | 'label' => $txt['report_to_mod'], |
| 1710 | - 'href' => $scripturl.'?action=reporttm;topic='.$context['current_topic'].'.'.$output['counter'].';msg='.$output['id'], |
|
| 1710 | + 'href' => $scripturl . '?action=reporttm;topic=' . $context['current_topic'] . '.' . $output['counter'] . ';msg=' . $output['id'], |
|
| 1711 | 1711 | 'icon' => 'error', |
| 1712 | 1712 | 'show' => $context['can_report_moderator'] |
| 1713 | 1713 | ), |
| 1714 | 1714 | 'warn' => array( |
| 1715 | 1715 | 'label' => $txt['issue_warning'], |
| 1716 | - 'href' => $scripturl.'?action=profile;area=issuewarning;u='.$output['member']['id'].';msg='.$output['id'], |
|
| 1716 | + 'href' => $scripturl . '?action=profile;area=issuewarning;u=' . $output['member']['id'] . ';msg=' . $output['id'], |
|
| 1717 | 1717 | 'icon' => 'warn_button', |
| 1718 | 1718 | 'show' => $context['can_issue_warning'] && !$output['is_message_author'] && !$output['member']['is_guest'] |
| 1719 | 1719 | ), |
| 1720 | 1720 | 'restore' => array( |
| 1721 | 1721 | 'label' => $txt['restore_message'], |
| 1722 | - 'href' => $scripturl.'?action=restoretopic;msgs='.$output['id'].';'.$context['session_var'].'='.$context['session_id'], |
|
| 1722 | + 'href' => $scripturl . '?action=restoretopic;msgs=' . $output['id'] . ';' . $context['session_var'] . '=' . $context['session_id'], |
|
| 1723 | 1723 | 'icon' => 'restore_button', |
| 1724 | 1724 | 'show' => $context['can_restore_msg'] |
| 1725 | 1725 | ), |
| 1726 | 1726 | 'approve' => array( |
| 1727 | 1727 | 'label' => $txt['approve'], |
| 1728 | - 'href' => $scripturl.'?action=moderate;area=postmod;sa=approve;topic='.$context['current_topic'].'.'.$context['start'].';msg='.$output['id'].';'.$context['session_var'].'='.$context['session_id'], |
|
| 1728 | + 'href' => $scripturl . '?action=moderate;area=postmod;sa=approve;topic=' . $context['current_topic'] . '.' . $context['start'] . ';msg=' . $output['id'] . ';' . $context['session_var'] . '=' . $context['session_id'], |
|
| 1729 | 1729 | 'icon' => 'approve_button', |
| 1730 | 1730 | 'show' => $output['can_approve'] |
| 1731 | 1731 | ), |
| 1732 | 1732 | 'unapprove' => array( |
| 1733 | 1733 | 'label' => $txt['unapprove'], |
| 1734 | - 'href' => $scripturl.'?action=moderate;area=postmod;sa=approve;topic='.$context['current_topic'].'.'.$context['start'].';msg='.$output['id'].';'.$context['session_var'].'='.$context['session_id'], |
|
| 1734 | + 'href' => $scripturl . '?action=moderate;area=postmod;sa=approve;topic=' . $context['current_topic'] . '.' . $context['start'] . ';msg=' . $output['id'] . ';' . $context['session_var'] . '=' . $context['session_id'], |
|
| 1735 | 1735 | 'icon' => 'unapprove_button', |
| 1736 | 1736 | 'show' => $output['can_unapprove'] |
| 1737 | 1737 | ), |
| 1738 | 1738 | ), |
| 1739 | 1739 | 'quickmod' => array( |
| 1740 | - 'id' => 'in_topic_mod_check_'. $output['id'], |
|
| 1740 | + 'id' => 'in_topic_mod_check_' . $output['id'], |
|
| 1741 | 1741 | 'custom' => 'style="display: none;"', |
| 1742 | 1742 | 'content' => '', |
| 1743 | 1743 | 'show' => !empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && $output['can_remove'], |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | { |
| 378 | 378 | $val = 'CASE '; |
| 379 | 379 | foreach ($members as $k => $v) |
| 380 | - $val .= 'WHEN id_member = ' . $v . ' THEN '. alert_count($v, true) . ' '; |
|
| 380 | + $val .= 'WHEN id_member = ' . $v . ' THEN ' . alert_count($v, true) . ' '; |
|
| 381 | 381 | |
| 382 | 382 | $val = $val . ' END'; |
| 383 | 383 | $type = 'raw'; |
@@ -1041,11 +1041,11 @@ discard block |
||
| 1041 | 1041 | // Anything that isn't a specification, punctuation mark, or whitespace. |
| 1042 | 1042 | '~(?<!%)\p{L}|[^\p{L}\p{P}\s]~u', |
| 1043 | 1043 | // A series of punctuation marks (except %), possibly separated by whitespace. |
| 1044 | - '~([^%\P{P}])(\s*)(?'.'>(\1|[^%\P{Po}])\s*(?!$))*~u', |
|
| 1044 | + '~([^%\P{P}])(\s*)(?' . '>(\1|[^%\P{Po}])\s*(?!$))*~u', |
|
| 1045 | 1045 | // Unwanted trailing punctuation and whitespace. |
| 1046 | - '~(?'.'>([\p{Pd}\p{Ps}\p{Pi}\p{Pc}]|[^%\P{Po}])\s*)*$~u', |
|
| 1046 | + '~(?' . '>([\p{Pd}\p{Ps}\p{Pi}\p{Pc}]|[^%\P{Po}])\s*)*$~u', |
|
| 1047 | 1047 | // Unwanted opening punctuation and whitespace. |
| 1048 | - '~^\s*(?'.'>([\p{Pd}\p{Pe}\p{Pf}\p{Pc}]|[^%\P{Po}])\s*)*~u', |
|
| 1048 | + '~^\s*(?' . '>([\p{Pd}\p{Pe}\p{Pf}\p{Pc}]|[^%\P{Po}])\s*)*~u', |
|
| 1049 | 1049 | ), |
| 1050 | 1050 | array( |
| 1051 | 1051 | '', |
@@ -1460,7 +1460,7 @@ discard block |
||
| 1460 | 1460 | $width = !empty($width) ? ' width="' . $width . '"' : ''; |
| 1461 | 1461 | $height = !empty($height) ? ' height="' . $height . '"' : ''; |
| 1462 | 1462 | |
| 1463 | - $returnContext .= '<div class="videocontainer"><video controls preload="metadata" src="'. $currentAttachment['href'] . '" playsinline' . $width . $height . '><a href="' . $currentAttachment['href'] . '" class="bbc_link">' . $smcFunc['htmlspecialchars'](!empty($data) ? $data : $currentAttachment['name']) . '</a></video></div>' . (!empty($data) && $data != $currentAttachment['name'] ? '<div class="smalltext">' . $data . '</div>' : ''); |
|
| 1463 | + $returnContext .= '<div class="videocontainer"><video controls preload="metadata" src="' . $currentAttachment['href'] . '" playsinline' . $width . $height . '><a href="' . $currentAttachment['href'] . '" class="bbc_link">' . $smcFunc['htmlspecialchars'](!empty($data) ? $data : $currentAttachment['name']) . '</a></video></div>' . (!empty($data) && $data != $currentAttachment['name'] ? '<div class="smalltext">' . $data . '</div>' : ''); |
|
| 1464 | 1464 | } |
| 1465 | 1465 | // Audio. |
| 1466 | 1466 | elseif (strpos($currentAttachment['mime_type'], 'audio/') === 0) |
@@ -1468,7 +1468,7 @@ discard block |
||
| 1468 | 1468 | $width = 'max-width:100%; width: ' . (!empty($width) ? $width : '400') . 'px;'; |
| 1469 | 1469 | $height = !empty($height) ? 'height: ' . $height . 'px;' : ''; |
| 1470 | 1470 | |
| 1471 | - $returnContext .= (!empty($data) && $data != $currentAttachment['name'] ? $data . ' ' : '') . '<audio controls preload="none" src="'. $currentAttachment['href'] . '" class="bbc_audio" style="vertical-align:middle;' . $width . $height . '"><a href="' . $currentAttachment['href'] . '" class="bbc_link">' . $smcFunc['htmlspecialchars'](!empty($data) ? $data : $currentAttachment['name']) . '</a></audio>'; |
|
| 1471 | + $returnContext .= (!empty($data) && $data != $currentAttachment['name'] ? $data . ' ' : '') . '<audio controls preload="none" src="' . $currentAttachment['href'] . '" class="bbc_audio" style="vertical-align:middle;' . $width . $height . '"><a href="' . $currentAttachment['href'] . '" class="bbc_link">' . $smcFunc['htmlspecialchars'](!empty($data) ? $data : $currentAttachment['name']) . '</a></audio>'; |
|
| 1472 | 1472 | } |
| 1473 | 1473 | // Anything else. |
| 1474 | 1474 | else |
@@ -1637,7 +1637,7 @@ discard block |
||
| 1637 | 1637 | 'type' => 'unparsed_commas_content', |
| 1638 | 1638 | 'test' => '\d+,\d+\]', |
| 1639 | 1639 | 'content' => '<a href="$1" target="_blank" rel="noopener">$1</a>', |
| 1640 | - 'validate' => function (&$tag, &$data, $disabled) |
|
| 1640 | + 'validate' => function(&$tag, &$data, $disabled) |
|
| 1641 | 1641 | { |
| 1642 | 1642 | $scheme = parse_url($data[0], PHP_URL_SCHEME); |
| 1643 | 1643 | if (empty($scheme)) |
@@ -2175,12 +2175,12 @@ discard block |
||
| 2175 | 2175 | $codes[] = array( |
| 2176 | 2176 | 'tag' => 'cowsay', |
| 2177 | 2177 | 'parameters' => array( |
| 2178 | - 'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function ($eyes) use ($smcFunc) |
|
| 2178 | + 'e' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => 'oo', 'validate' => function($eyes) use ($smcFunc) |
|
| 2179 | 2179 | { |
| 2180 | 2180 | return $smcFunc['substr']($eyes . 'oo', 0, 2); |
| 2181 | 2181 | }, |
| 2182 | 2182 | ), |
| 2183 | - 't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => ' ', 'validate' => function ($tongue) use ($smcFunc) |
|
| 2183 | + 't' => array('optional' => true, 'quoted' => true, 'match' => '(.*?)', 'default' => ' ', 'validate' => function($tongue) use ($smcFunc) |
|
| 2184 | 2184 | { |
| 2185 | 2185 | return $smcFunc['substr']($tongue . ' ', 0, 2); |
| 2186 | 2186 | }, |
@@ -3552,7 +3552,7 @@ discard block |
||
| 3552 | 3552 | if ($fp != false) |
| 3553 | 3553 | { |
| 3554 | 3554 | // Send the HEAD request (since we don't have to worry about chunked, HTTP/1.1 is fine here.) |
| 3555 | - fwrite($fp, 'HEAD /' . $match[2] . ' HTTP/1.1' . "\r\n" . 'Host: ' . $match[1] . "\r\n" . 'user-agent: '. SMF_USER_AGENT . "\r\n" . 'Connection: close' . "\r\n\r\n"); |
|
| 3555 | + fwrite($fp, 'HEAD /' . $match[2] . ' HTTP/1.1' . "\r\n" . 'Host: ' . $match[1] . "\r\n" . 'user-agent: ' . SMF_USER_AGENT . "\r\n" . 'Connection: close' . "\r\n\r\n"); |
|
| 3556 | 3556 | |
| 3557 | 3557 | // Read in the HTTP/1.1 or whatever. |
| 3558 | 3558 | $test = substr(fgets($fp, 11), -1); |
@@ -4156,7 +4156,7 @@ discard block |
||
| 4156 | 4156 | $toMinify = array(); |
| 4157 | 4157 | $normal = array(); |
| 4158 | 4158 | |
| 4159 | - uasort($context['css_files'], function ($a, $b) |
|
| 4159 | + uasort($context['css_files'], function($a, $b) |
|
| 4160 | 4160 | { |
| 4161 | 4161 | return $a['options']['order_pos'] < $b['options']['order_pos'] ? -1 : ($a['options']['order_pos'] > $b['options']['order_pos'] ? 1 : 0); |
| 4162 | 4162 | }); |
@@ -5452,7 +5452,7 @@ discard block |
||
| 5452 | 5452 | { |
| 5453 | 5453 | fwrite($fp, 'GET ' . ($match[6] !== '/' ? str_replace(' ', '%20', $match[6]) : '') . ' HTTP/1.0' . "\r\n"); |
| 5454 | 5454 | fwrite($fp, 'Host: ' . $match[3] . (empty($match[5]) ? ($match[2] ? ':443' : '') : ':' . $match[5]) . "\r\n"); |
| 5455 | - fwrite($fp, 'user-agent: '. SMF_USER_AGENT . "\r\n"); |
|
| 5455 | + fwrite($fp, 'user-agent: ' . SMF_USER_AGENT . "\r\n"); |
|
| 5456 | 5456 | if ($keep_alive) |
| 5457 | 5457 | fwrite($fp, 'connection: Keep-Alive' . "\r\n\r\n"); |
| 5458 | 5458 | else |
@@ -5462,7 +5462,7 @@ discard block |
||
| 5462 | 5462 | { |
| 5463 | 5463 | fwrite($fp, 'POST ' . ($match[6] !== '/' ? $match[6] : '') . ' HTTP/1.0' . "\r\n"); |
| 5464 | 5464 | fwrite($fp, 'Host: ' . $match[3] . (empty($match[5]) ? ($match[2] ? ':443' : '') : ':' . $match[5]) . "\r\n"); |
| 5465 | - fwrite($fp, 'user-agent: '. SMF_USER_AGENT . "\r\n"); |
|
| 5465 | + fwrite($fp, 'user-agent: ' . SMF_USER_AGENT . "\r\n"); |
|
| 5466 | 5466 | if ($keep_alive) |
| 5467 | 5467 | fwrite($fp, 'connection: Keep-Alive' . "\r\n"); |
| 5468 | 5468 | else |
@@ -5710,13 +5710,13 @@ discard block |
||
| 5710 | 5710 | |
| 5711 | 5711 | // UTF-8 occurences of MS special characters |
| 5712 | 5712 | $findchars_utf8 = array( |
| 5713 | - "\xe2\x80\x9a", // single low-9 quotation mark |
|
| 5714 | - "\xe2\x80\x9e", // double low-9 quotation mark |
|
| 5715 | - "\xe2\x80\xa6", // horizontal ellipsis |
|
| 5716 | - "\xe2\x80\x98", // left single curly quote |
|
| 5717 | - "\xe2\x80\x99", // right single curly quote |
|
| 5718 | - "\xe2\x80\x9c", // left double curly quote |
|
| 5719 | - "\xe2\x80\x9d", // right double curly quote |
|
| 5713 | + "\xe2\x80\x9a", // single low-9 quotation mark |
|
| 5714 | + "\xe2\x80\x9e", // double low-9 quotation mark |
|
| 5715 | + "\xe2\x80\xa6", // horizontal ellipsis |
|
| 5716 | + "\xe2\x80\x98", // left single curly quote |
|
| 5717 | + "\xe2\x80\x99", // right single curly quote |
|
| 5718 | + "\xe2\x80\x9c", // left double curly quote |
|
| 5719 | + "\xe2\x80\x9d", // right double curly quote |
|
| 5720 | 5720 | ); |
| 5721 | 5721 | |
| 5722 | 5722 | // windows 1252 / iso equivalents |
@@ -5732,13 +5732,13 @@ discard block |
||
| 5732 | 5732 | |
| 5733 | 5733 | // safe replacements |
| 5734 | 5734 | $replacechars = array( |
| 5735 | - ',', // ‚ |
|
| 5736 | - ',,', // „ |
|
| 5737 | - '...', // … |
|
| 5738 | - "'", // ‘ |
|
| 5739 | - "'", // ’ |
|
| 5740 | - '"', // “ |
|
| 5741 | - '"', // ” |
|
| 5735 | + ',', // ‚ |
|
| 5736 | + ',,', // „ |
|
| 5737 | + '...', // … |
|
| 5738 | + "'", // ‘ |
|
| 5739 | + "'", // ’ |
|
| 5740 | + '"', // “ |
|
| 5741 | + '"', // ” |
|
| 5742 | 5742 | ); |
| 5743 | 5743 | |
| 5744 | 5744 | if ($context['utf8']) |
@@ -6923,7 +6923,7 @@ discard block |
||
| 6923 | 6923 | EXISTS ( |
| 6924 | 6924 | SELECT bpv.id_board |
| 6925 | 6925 | FROM ' . $db_prefix . 'board_permissions_view AS bpv |
| 6926 | - WHERE bpv.id_group IN ('. implode(',', $groups) .') |
|
| 6926 | + WHERE bpv.id_group IN ('. implode(',', $groups) . ') |
|
| 6927 | 6927 | AND bpv.deny = 0 |
| 6928 | 6928 | AND bpv.id_board = b.id_board |
| 6929 | 6929 | )'; |
@@ -6933,7 +6933,7 @@ discard block |
||
| 6933 | 6933 | AND NOT EXISTS ( |
| 6934 | 6934 | SELECT bpv.id_board |
| 6935 | 6935 | FROM ' . $db_prefix . 'board_permissions_view AS bpv |
| 6936 | - WHERE bpv.id_group IN ( '. implode(',', $groups) .') |
|
| 6936 | + WHERE bpv.id_group IN ( '. implode(',', $groups) . ') |
|
| 6937 | 6937 | AND bpv.deny = 1 |
| 6938 | 6938 | AND bpv.id_board = b.id_board |
| 6939 | 6939 | )'; |
@@ -7204,8 +7204,8 @@ discard block |
||
| 7204 | 7204 | $i = 0; |
| 7205 | 7205 | while (empty($done)) |
| 7206 | 7206 | { |
| 7207 | - if (strpos($format, '{'. --$i . '}') !== false) |
|
| 7208 | - $replacements['{'. $i . '}'] = array_pop($list); |
|
| 7207 | + if (strpos($format, '{' . --$i . '}') !== false) |
|
| 7208 | + $replacements['{' . $i . '}'] = array_pop($list); |
|
| 7209 | 7209 | else |
| 7210 | 7210 | $done = true; |
| 7211 | 7211 | } |
@@ -7215,8 +7215,8 @@ discard block |
||
| 7215 | 7215 | $i = 0; |
| 7216 | 7216 | while (empty($done)) |
| 7217 | 7217 | { |
| 7218 | - if (strpos($format, '{'. ++$i . '}') !== false) |
|
| 7219 | - $replacements['{'. $i . '}'] = array_shift($list); |
|
| 7218 | + if (strpos($format, '{' . ++$i . '}') !== false) |
|
| 7219 | + $replacements['{' . $i . '}'] = array_shift($list); |
|
| 7220 | 7220 | else |
| 7221 | 7221 | $done = true; |
| 7222 | 7222 | } |
@@ -846,7 +846,7 @@ discard block |
||
| 846 | 846 | 'if (!is_dir(realpath($cachedir)) && is_dir($boarddir . \'/cache\'))', |
| 847 | 847 | ' $cachedir = $boarddir . \'/cache\';', |
| 848 | 848 | )), |
| 849 | - 'search_pattern' => '~\n?(#[^\n]+)?(?:\n\h*if\s*\((?:\!file_exists\(\$(?'.'>boarddir|sourcedir|tasksdir|packagesdir|cachedir)\)|\!is_dir\(realpath\(\$(?'.'>boarddir|sourcedir|tasksdir|packagesdir|cachedir)\)\))[^;]+\n\h*\$(?'.'>boarddir|sourcedir|tasksdir|packagesdir|cachedir)[^\n]+;)+~sm', |
|
| 849 | + 'search_pattern' => '~\n?(#[^\n]+)?(?:\n\h*if\s*\((?:\!file_exists\(\$(?' . '>boarddir|sourcedir|tasksdir|packagesdir|cachedir)\)|\!is_dir\(realpath\(\$(?' . '>boarddir|sourcedir|tasksdir|packagesdir|cachedir)\)\))[^;]+\n\h*\$(?' . '>boarddir|sourcedir|tasksdir|packagesdir|cachedir)[^\n]+;)+~sm', |
|
| 850 | 850 | ), |
| 851 | 851 | 'db_character_set' => array( |
| 852 | 852 | 'text' => implode("\n", array( |
@@ -945,8 +945,8 @@ discard block |
||
| 945 | 945 | 'boolean' => '(?i:TRUE|FALSE|(["\']?)[01]\b\\1)', |
| 946 | 946 | 'NULL' => '(?i:NULL)', |
| 947 | 947 | // These use a PCRE subroutine to match nested arrays. |
| 948 | - 'array' => 'array\s*(\((?'.'>[^()]|(?1))*\))', |
|
| 949 | - 'object' => '\w+::__set_state\(array\s*(\((?'.'>[^()]|(?1))*\))\)', |
|
| 948 | + 'array' => 'array\s*(\((?' . '>[^()]|(?1))*\))', |
|
| 949 | + 'object' => '\w+::__set_state\(array\s*(\((?' . '>[^()]|(?1))*\))\)', |
|
| 950 | 950 | ); |
| 951 | 951 | |
| 952 | 952 | /* |
@@ -979,7 +979,7 @@ discard block |
||
| 979 | 979 | ), |
| 980 | 980 | // Remove the code that redirects to the installer. |
| 981 | 981 | $neg_index-- => array( |
| 982 | - 'search_pattern' => '~^if\s*\(file_exists\(dirname\(__FILE__\)\s*\.\s*\'/install\.php\'\)\)\s*(?:({(?'.'>[^{}]|(?1))*})\h*|header(\((?' . '>[^()]|(?2))*\));\n)~m', |
|
| 982 | + 'search_pattern' => '~^if\s*\(file_exists\(dirname\(__FILE__\)\s*\.\s*\'/install\.php\'\)\)\s*(?:({(?' . '>[^{}]|(?1))*})\h*|header(\((?' . '>[^()]|(?2))*\));\n)~m', |
|
| 983 | 983 | 'placeholder' => '', |
| 984 | 984 | ), |
| 985 | 985 | ); |
@@ -1742,7 +1742,7 @@ discard block |
||
| 1742 | 1742 | // Prevents warnings about constants that are already defined. |
| 1743 | 1743 | $settingsText = preg_replace_callback( |
| 1744 | 1744 | '~\bdefine\s*\(\s*(["\'])(\w+)\1~', |
| 1745 | - function ($matches) |
|
| 1745 | + function($matches) |
|
| 1746 | 1746 | { |
| 1747 | 1747 | return 'define(\'' . md5(mt_rand()) . '\''; |
| 1748 | 1748 | }, |
@@ -1752,7 +1752,7 @@ discard block |
||
| 1752 | 1752 | // Handle eval errors gracefully in both PHP 5 and PHP 7 |
| 1753 | 1753 | try |
| 1754 | 1754 | { |
| 1755 | - if($settingsText !== '' && @eval($settingsText) === false) |
|
| 1755 | + if ($settingsText !== '' && @eval($settingsText) === false) |
|
| 1756 | 1756 | throw new ErrorException('eval error'); |
| 1757 | 1757 | |
| 1758 | 1758 | unset($mtime, $settingsFile, $settingsText); |
@@ -1955,7 +1955,7 @@ discard block |
||
| 1955 | 1955 | } |
| 1956 | 1956 | |
| 1957 | 1957 | // Everything is simpler if we convert heredocs to normal strings first. |
| 1958 | - if (preg_match_all('/<<<(\'?)(\w+)\'?'. $line_ending . '(.*?)'. $line_ending . '\2;$/m', $code_str, $matches)) |
|
| 1958 | + if (preg_match_all('/<<<(\'?)(\w+)\'?' . $line_ending . '(.*?)' . $line_ending . '\2;$/m', $code_str, $matches)) |
|
| 1959 | 1959 | { |
| 1960 | 1960 | foreach ($matches[0] as $mkey => $heredoc) |
| 1961 | 1961 | { |
@@ -1969,7 +1969,7 @@ discard block |
||
| 1969 | 1969 | } |
| 1970 | 1970 | |
| 1971 | 1971 | // Split before everything that could possibly delimit a comment or a string. |
| 1972 | - $parts = preg_split('~(?=#+|/(?=/|\*)|\*/|'. $line_ending . '|(?<!\\\)[\'"])~m', $code_str); |
|
| 1972 | + $parts = preg_split('~(?=#+|/(?=/|\*)|\*/|' . $line_ending . '|(?<!\\\)[\'"])~m', $code_str); |
|
| 1973 | 1973 | |
| 1974 | 1974 | $in_string = 0; |
| 1975 | 1975 | $in_comment = 0; |
@@ -3862,7 +3862,7 @@ |
||
| 3862 | 3862 | $auth_secret = hash_file('sha256', $boarddir . '/Settings.php'); |
| 3863 | 3863 | |
| 3864 | 3864 | // Set the last error to now, but only every 15 minutes. Don't need to flood the logs. |
| 3865 | - if (empty($db_last_error) || ($db_last_error + 60*15) <= time()) |
|
| 3865 | + if (empty($db_last_error) || ($db_last_error + 60 * 15) <= time()) |
|
| 3866 | 3866 | { |
| 3867 | 3867 | updateDbLastError(time()); |
| 3868 | 3868 | loadLanguage('Errors'); |