@@ -1259,7 +1259,7 @@ |
||
| 1259 | 1259 | // File Upload. |
| 1260 | 1260 | if ($context['can_post_attachment']) |
| 1261 | 1261 | { |
| 1262 | - $acceptedFiles = empty($context['allowed_extensions']) ? '' : implode(',', array_map(function ($val) use ($smcFunc) |
|
| 1262 | + $acceptedFiles = empty($context['allowed_extensions']) ? '' : implode(',', array_map(function($val) use ($smcFunc) |
|
| 1263 | 1263 | { |
| 1264 | 1264 | return !empty($val) ? ('.' . $smcFunc['htmltrim']($val)) : ''; |
| 1265 | 1265 | }, explode(',', $context['allowed_extensions']))); |
@@ -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; |
@@ -282,7 +282,7 @@ |
||
| 282 | 282 | '{db_prefix}log_notify', |
| 283 | 283 | array('id_member' => 'int', 'id_topic' => 'int', 'id_board' => 'int'), |
| 284 | 284 | array($user_info['id'], $log['id_topic'], 0), |
| 285 | - array('id_member','id_topic', 'id_board') |
|
| 285 | + array('id_member', 'id_topic', 'id_board') |
|
| 286 | 286 | ); |
| 287 | 287 | } |
| 288 | 288 | else |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | if ($type == 'edit') |
| 119 | 119 | { |
| 120 | 120 | // Filter out members who have already been notified about this post's topic |
| 121 | - $unnotified = array_filter($watched, function ($member) |
|
| 121 | + $unnotified = array_filter($watched, function($member) |
|
| 122 | 122 | { |
| 123 | 123 | return empty($member['sent']); |
| 124 | 124 | }); |
@@ -204,8 +204,7 @@ discard block |
||
| 204 | 204 | if (!empty($member_data['id_topic']) && $type != 'topic' && !empty($prefs[$member_id])) |
| 205 | 205 | { |
| 206 | 206 | $pref = !empty($prefs[$member_id]['topic_notify_' . $topicOptions['id']]) ? |
| 207 | - $prefs[$member_id]['topic_notify_' . $topicOptions['id']] : |
|
| 208 | - (!empty($prefs[$member_id]['topic_notify']) ? $prefs[$member_id]['topic_notify'] : 0); |
|
| 207 | + $prefs[$member_id]['topic_notify_' . $topicOptions['id']] : (!empty($prefs[$member_id]['topic_notify']) ? $prefs[$member_id]['topic_notify'] : 0); |
|
| 209 | 208 | |
| 210 | 209 | $message_type = 'notification_' . $type; |
| 211 | 210 | |
@@ -224,8 +223,7 @@ discard block |
||
| 224 | 223 | elseif ($type == 'topic') |
| 225 | 224 | { |
| 226 | 225 | $pref = !empty($prefs[$member_id]['board_notify_' . $topicOptions['board']]) ? |
| 227 | - $prefs[$member_id]['board_notify_' . $topicOptions['board']] : |
|
| 228 | - (!empty($prefs[$member_id]['board_notify']) ? $prefs[$member_id]['board_notify'] : 0); |
|
| 226 | + $prefs[$member_id]['board_notify_' . $topicOptions['board']] : (!empty($prefs[$member_id]['board_notify']) ? $prefs[$member_id]['board_notify'] : 0); |
|
| 229 | 227 | |
| 230 | 228 | $content_type = 'board'; |
| 231 | 229 | |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | ); |
| 92 | 92 | foreach (array('action', 'sa', 'type', 'board', 'boards', 'c', 'u', 'limit', 'offset') as $var) |
| 93 | 93 | if (isset($_GET[$var])) |
| 94 | - $feed_meta['self'] .= ($feed_meta['self'] === $scripturl ? '?' : ';' ) . $var . '=' . $_GET[$var]; |
|
| 94 | + $feed_meta['self'] .= ($feed_meta['self'] === $scripturl ? '?' : ';') . $var . '=' . $_GET[$var]; |
|
| 95 | 95 | |
| 96 | 96 | // Handle the cases where a board, boards, or category is asked for. |
| 97 | 97 | $query_this_board = 1; |
@@ -303,17 +303,17 @@ discard block |
||
| 303 | 303 | * namespaces, which could cause it to mangle the XML horrifically |
| 304 | 304 | * during processing. |
| 305 | 305 | */ |
| 306 | - $smf_ns = 'htt'.'p:/'.'/ww'.'w.simple'.'machines.o'.'rg/xml/' . $subaction; |
|
| 306 | + $smf_ns = 'htt' . 'p:/' . '/ww' . 'w.simple' . 'machines.o' . 'rg/xml/' . $subaction; |
|
| 307 | 307 | |
| 308 | 308 | // Allow mods to add extra namespaces and tags to the feed/channel |
| 309 | 309 | $namespaces = array( |
| 310 | 310 | 'rss' => array(), |
| 311 | - 'rss2' => array('atom' => 'htt'.'p:/'.'/ww'.'w.w3.o'.'rg/2005/Atom'), |
|
| 312 | - 'atom' => array('' => 'htt'.'p:/'.'/ww'.'w.w3.o'.'rg/2005/Atom'), |
|
| 311 | + 'rss2' => array('atom' => 'htt' . 'p:/' . '/ww' . 'w.w3.o' . 'rg/2005/Atom'), |
|
| 312 | + 'atom' => array('' => 'htt' . 'p:/' . '/ww' . 'w.w3.o' . 'rg/2005/Atom'), |
|
| 313 | 313 | 'rdf' => array( |
| 314 | - '' => 'htt'.'p:/'.'/purl.o'.'rg/rss/1.0/', |
|
| 315 | - 'rdf' => 'htt'.'p:/'.'/ww'.'w.w3.o'.'rg/1999/02/22-rdf-syntax-ns#', |
|
| 316 | - 'dc' => 'htt'.'p:/'.'/purl.o'.'rg/dc/elements/1.1/', |
|
| 314 | + '' => 'htt' . 'p:/' . '/purl.o' . 'rg/rss/1.0/', |
|
| 315 | + 'rdf' => 'htt' . 'p:/' . '/ww' . 'w.w3.o' . 'rg/1999/02/22-rdf-syntax-ns#', |
|
| 316 | + 'dc' => 'htt' . 'p:/' . '/purl.o' . 'rg/dc/elements/1.1/', |
|
| 317 | 317 | ), |
| 318 | 318 | 'smf' => array( |
| 319 | 319 | 'smf' => $smf_ns, |
@@ -468,7 +468,7 @@ discard block |
||
| 468 | 468 | |
| 469 | 469 | // Figure out the filename we'll tell the browser. |
| 470 | 470 | $datatypes = file_exists($progressfile) ? array_keys($smcFunc['json_decode'](file_get_contents($progressfile), true)) : array('profile'); |
| 471 | - $included_desc = array_map(function ($datatype) use ($txt) { return $txt[$datatype]; }, $datatypes); |
|
| 471 | + $included_desc = array_map(function($datatype) use ($txt) { return $txt[$datatype]; }, $datatypes); |
|
| 472 | 472 | |
| 473 | 473 | $dlfilename = array_merge(array($context['forum_name'], $context['member']['username']), $included_desc); |
| 474 | 474 | $dlfilename = preg_replace('/[^\p{L}\p{M}\p{N}_]+/u', '-', str_replace('"', '', un_htmlspecialchars(strip_tags(implode('_', $dlfilename))))); |
@@ -783,9 +783,9 @@ discard block |
||
| 783 | 783 | $xslt_variables = array(); |
| 784 | 784 | |
| 785 | 785 | // Do not change any of these to HTTPS URLs. For explanation, see comments in the buildXmlFeed() function. |
| 786 | - $smf_ns = 'htt'.'p:/'.'/ww'.'w.simple'.'machines.o'.'rg/xml/profile'; |
|
| 787 | - $xslt_ns = 'htt'.'p:/'.'/ww'.'w.w3.o'.'rg/1999/XSL/Transform'; |
|
| 788 | - $html_ns = 'htt'.'p:/'.'/ww'.'w.w3.o'.'rg/1999/xhtml'; |
|
| 786 | + $smf_ns = 'htt' . 'p:/' . '/ww' . 'w.simple' . 'machines.o' . 'rg/xml/profile'; |
|
| 787 | + $xslt_ns = 'htt' . 'p:/' . '/ww' . 'w.w3.o' . 'rg/1999/XSL/Transform'; |
|
| 788 | + $html_ns = 'htt' . 'p:/' . '/ww' . 'w.w3.o' . 'rg/1999/xhtml'; |
|
| 789 | 789 | |
| 790 | 790 | require_once($sourcedir . DIRECTORY_SEPARATOR . 'News.php'); |
| 791 | 791 | |
@@ -1690,14 +1690,14 @@ discard block |
||
| 1690 | 1690 | |
| 1691 | 1691 | if (!empty($context['export_css_header'])) |
| 1692 | 1692 | { |
| 1693 | - $stylesheet['css_js'] .= ' |
|
| 1693 | + $stylesheet['css_js'] .= ' |
|
| 1694 | 1694 | <style><![CDATA[' . "\n" . implode("\n", $context['export_css_header']) . "\n" . ']]> |
| 1695 | 1695 | </style>'; |
| 1696 | 1696 | } |
| 1697 | 1697 | |
| 1698 | 1698 | if (!empty($context['export_javascript_vars'])) |
| 1699 | 1699 | { |
| 1700 | - $stylesheet['css_js'] .= ' |
|
| 1700 | + $stylesheet['css_js'] .= ' |
|
| 1701 | 1701 | <script><![CDATA['; |
| 1702 | 1702 | |
| 1703 | 1703 | foreach ($context['export_javascript_vars'] as $var => $val) |
@@ -1733,7 +1733,7 @@ discard block |
||
| 1733 | 1733 | |
| 1734 | 1734 | if (!empty($context['export_javascript_inline']['standard'])) |
| 1735 | 1735 | { |
| 1736 | - $stylesheet['css_js'] .= ' |
|
| 1736 | + $stylesheet['css_js'] .= ' |
|
| 1737 | 1737 | <script><![CDATA[' . "\n" . implode("\n", $context['export_javascript_inline']['standard']) . "\n" . ']]> |
| 1738 | 1738 | </script>'; |
| 1739 | 1739 | } |
@@ -1745,7 +1745,7 @@ discard block |
||
| 1745 | 1745 | |
| 1746 | 1746 | $stylesheet['css_js'] .= "\n\t" . str_replace("\n", "\n\t", implode("\n", $context['export_javascript_inline']['defer'])); |
| 1747 | 1747 | |
| 1748 | - $stylesheet['css_js'] .= "\n" . '});'. "\n" . ']]> |
|
| 1748 | + $stylesheet['css_js'] .= "\n" . '});' . "\n" . ']]> |
|
| 1749 | 1749 | </script>'; |
| 1750 | 1750 | } |
| 1751 | 1751 | |
@@ -1826,7 +1826,7 @@ discard block |
||
| 1826 | 1826 | $css_to_minify = array(); |
| 1827 | 1827 | $normal_css_files = array(); |
| 1828 | 1828 | |
| 1829 | - usort($context['css_files'], function ($a, $b) |
|
| 1829 | + usort($context['css_files'], function($a, $b) |
|
| 1830 | 1830 | { |
| 1831 | 1831 | return $a['options']['order_pos'] < $b['options']['order_pos'] ? -1 : ($a['options']['order_pos'] > $b['options']['order_pos'] ? 1 : 0); |
| 1832 | 1832 | }); |
@@ -644,13 +644,13 @@ discard block |
||
| 644 | 644 | 'quickbuttons' => array( |
| 645 | 645 | 'edit' => array( |
| 646 | 646 | 'label' => $txt['draft_edit'], |
| 647 | - 'href' => $scripturl.'?action=post;'.(empty($row['id_topic']) ? 'board='.$row['id_board'] : 'topic='.$row['id_topic']).'.0;id_draft='.$row['id_draft'], |
|
| 647 | + 'href' => $scripturl . '?action=post;' . (empty($row['id_topic']) ? 'board=' . $row['id_board'] : 'topic=' . $row['id_topic']) . '.0;id_draft=' . $row['id_draft'], |
|
| 648 | 648 | 'icon' => 'modify_button' |
| 649 | 649 | ), |
| 650 | 650 | 'delete' => array( |
| 651 | 651 | 'label' => $txt['draft_delete'], |
| 652 | - 'href' => $scripturl.'?action=profile;u='.$context['member']['id'].';area=showdrafts;delete='.$row['id_draft'].';'.$context['session_var'].'='.$context['session_id'], |
|
| 653 | - 'javascript' => 'data-confirm="'.$txt['draft_remove'].'"', |
|
| 652 | + 'href' => $scripturl . '?action=profile;u=' . $context['member']['id'] . ';area=showdrafts;delete=' . $row['id_draft'] . ';' . $context['session_var'] . '=' . $context['session_id'], |
|
| 653 | + 'javascript' => 'data-confirm="' . $txt['draft_remove'] . '"', |
|
| 654 | 654 | 'class' => 'you_sure', |
| 655 | 655 | 'icon' => 'remove_button' |
| 656 | 656 | ), |
@@ -837,13 +837,13 @@ discard block |
||
| 837 | 837 | 'quickbuttons' => array( |
| 838 | 838 | 'edit' => array( |
| 839 | 839 | 'label' => $txt['draft_edit'], |
| 840 | - 'href' => $scripturl.'?action=pm;sa=showpmdrafts;id_draft='.$row['id_draft'].';'.$context['session_var'].'='.$context['session_id'], |
|
| 840 | + 'href' => $scripturl . '?action=pm;sa=showpmdrafts;id_draft=' . $row['id_draft'] . ';' . $context['session_var'] . '=' . $context['session_id'], |
|
| 841 | 841 | 'icon' => 'modify_button' |
| 842 | 842 | ), |
| 843 | 843 | 'delete' => array( |
| 844 | 844 | 'label' => $txt['draft_delete'], |
| 845 | - 'href' => $scripturl.'?action=pm;sa=showpmdrafts;delete='.$row['id_draft'].';'.$context['session_var'].'='.$context['session_id'], |
|
| 846 | - 'javascript' => 'data-confirm="'.$txt['draft_remove'].'?"', |
|
| 845 | + 'href' => $scripturl . '?action=pm;sa=showpmdrafts;delete=' . $row['id_draft'] . ';' . $context['session_var'] . '=' . $context['session_id'], |
|
| 846 | + 'javascript' => 'data-confirm="' . $txt['draft_remove'] . '?"', |
|
| 847 | 847 | 'class' => 'you_sure', |
| 848 | 848 | 'icon' => 'remove_button' |
| 849 | 849 | ), |
@@ -355,8 +355,8 @@ |
||
| 355 | 355 | elseif (isset($_POST['delall']) && isset($filter)) |
| 356 | 356 | { |
| 357 | 357 | // ip need a different placeholder type |
| 358 | - $filter_type = $filter['variable'] == 'ip'? 'inet' : 'string'; |
|
| 359 | - $filter_op = $filter['variable'] == 'ip'? '=' : 'LIKE'; |
|
| 358 | + $filter_type = $filter['variable'] == 'ip' ? 'inet' : 'string'; |
|
| 359 | + $filter_op = $filter['variable'] == 'ip' ? '=' : 'LIKE'; |
|
| 360 | 360 | $smcFunc['db_query']('', ' |
| 361 | 361 | DELETE FROM {db_prefix}log_errors |
| 362 | 362 | WHERE ' . $filter['variable'] . ' ' . $filter_op . ' {' . $filter_type . ':filter}', |
@@ -467,20 +467,20 @@ |
||
| 467 | 467 | $context['posts'][$key]['quickbuttons'] = array( |
| 468 | 468 | 'reply' => array( |
| 469 | 469 | 'label' => $txt['reply'], |
| 470 | - 'href' => $scripturl.'?action=post;topic='.$post['topic'].'.'.$post['start'], |
|
| 470 | + 'href' => $scripturl . '?action=post;topic=' . $post['topic'] . '.' . $post['start'], |
|
| 471 | 471 | 'icon' => 'reply_button', |
| 472 | 472 | 'show' => $post['can_reply'] |
| 473 | 473 | ), |
| 474 | 474 | 'quote' => array( |
| 475 | 475 | 'label' => $txt['quote_action'], |
| 476 | - 'href' => $scripturl.'?action=post;topic='.$post['topic'].'.'.$post['start'].';quote='.$post['id'], |
|
| 476 | + 'href' => $scripturl . '?action=post;topic=' . $post['topic'] . '.' . $post['start'] . ';quote=' . $post['id'], |
|
| 477 | 477 | 'icon' => 'quote', |
| 478 | 478 | 'show' => $post['can_quote'] |
| 479 | 479 | ), |
| 480 | 480 | 'delete' => array( |
| 481 | 481 | 'label' => $txt['remove'], |
| 482 | - 'href' => $scripturl.'?action=deletemsg;msg='.$post['id'].';topic='.$post['topic'].';recent;'.$context['session_var'].'='.$context['session_id'], |
|
| 483 | - 'javascript' => 'data-confirm="'.$txt['remove_message'].'"', |
|
| 482 | + 'href' => $scripturl . '?action=deletemsg;msg=' . $post['id'] . ';topic=' . $post['topic'] . ';recent;' . $context['session_var'] . '=' . $context['session_id'], |
|
| 483 | + 'javascript' => 'data-confirm="' . $txt['remove_message'] . '"', |
|
| 484 | 484 | 'class' => 'you_sure', |
| 485 | 485 | 'icon' => 'remove_button', |
| 486 | 486 | 'show' => $post['can_delete'] |