Completed
Pull Request — release-2.1 (#4446)
by Mathias
12:43
created
Themes/default/fonts/index.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,9 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 // Try to handle it with the upper level index.php. (it should know what to do.)
4
-if (file_exists(dirname(dirname(__FILE__)) . '/index.php'))
4
+if (file_exists(dirname(dirname(__FILE__)) . '/index.php')) {
5 5
 	include (dirname(dirname(__FILE__)) . '/index.php');
6
-else
6
+} else {
7 7
 	exit;
8
+}
8 9
 
9 10
 ?>
10 11
\ No newline at end of file
Please login to merge, or discard this patch.
Themes/default/css/index.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,9 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 // Try to handle it with the upper level index.php. (it should know what to do.)
4
-if (file_exists(dirname(dirname(__FILE__)) . '/index.php'))
4
+if (file_exists(dirname(dirname(__FILE__)) . '/index.php')) {
5 5
 	include (dirname(dirname(__FILE__)) . '/index.php');
6
-else
6
+} else {
7 7
 	exit;
8
+}
8 9
 
9 10
 ?>
10 11
\ No newline at end of file
Please login to merge, or discard this patch.
Themes/default/index.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,9 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 // Try to handle it with the upper level index.php. (it should know what to do.)
4
-if (file_exists(dirname(dirname(__FILE__)) . '/index.php'))
4
+if (file_exists(dirname(dirname(__FILE__)) . '/index.php')) {
5 5
 	include (dirname(dirname(__FILE__)) . '/index.php');
6
-else
6
+} else {
7 7
 	exit;
8
+}
8 9
 
9 10
 ?>
10 11
\ No newline at end of file
Please login to merge, or discard this patch.
cache/index.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,8 @@
 block discarded – undo
12 12
 	header('Location: ' . $boardurl);
13 13
 }
14 14
 // Can't find it... just forget it.
15
-else
15
+else {
16 16
 	exit;
17
+}
17 18
 
18 19
 ?>
19 20
\ No newline at end of file
Please login to merge, or discard this patch.
Sources/SplitTopics.php 1 patch
Braces   +260 added lines, -186 removed lines patch added patch discarded remove patch
@@ -15,8 +15,9 @@  discard block
 block discarded – undo
15 15
  * Original module by Mach8 - We'll never forget you.
16 16
  */
17 17
 
18
-if (!defined('SMF'))
18
+if (!defined('SMF')) {
19 19
 	die('No direct access...');
20
+}
20 21
 
21 22
 /**
22 23
  * splits a topic into two topics.
@@ -30,15 +31,17 @@  discard block
 block discarded – undo
30 31
 	global $topic, $sourcedir;
31 32
 
32 33
 	// And... which topic were you splitting, again?
33
-	if (empty($topic))
34
-		fatal_lang_error('numbers_one_to_nine', false);
34
+	if (empty($topic)) {
35
+			fatal_lang_error('numbers_one_to_nine', false);
36
+	}
35 37
 
36 38
 	// Are you allowed to split topics?
37 39
 	isAllowedTo('split_any');
38 40
 
39 41
 	// Load up the "dependencies" - the template, getMsgMemberID(), and sendNotifications().
40
-	if (!isset($_REQUEST['xml']))
41
-		loadTemplate('SplitTopics');
42
+	if (!isset($_REQUEST['xml'])) {
43
+			loadTemplate('SplitTopics');
44
+	}
42 45
 	require_once($sourcedir . '/Subs-Boards.php');
43 46
 	require_once($sourcedir . '/Subs-Post.php');
44 47
 
@@ -50,12 +53,12 @@  discard block
 block discarded – undo
50 53
 	);
51 54
 
52 55
 	// ?action=splittopics;sa=LETSBREAKIT won't work, sorry.
53
-	if (empty($_REQUEST['sa']) || !isset($subActions[$_REQUEST['sa']]))
54
-		SplitIndex();
55
-
56
-	else
57
-		call_helper($subActions[$_REQUEST['sa']]);
58
-}
56
+	if (empty($_REQUEST['sa']) || !isset($subActions[$_REQUEST['sa']])) {
57
+			SplitIndex();
58
+	} else {
59
+			call_helper($subActions[$_REQUEST['sa']]);
60
+	}
61
+	}
59 62
 
60 63
 /**
61 64
  * screen shown before the actual split.
@@ -71,8 +74,9 @@  discard block
 block discarded – undo
71 74
 	global $txt, $topic, $context, $smcFunc, $modSettings;
72 75
 
73 76
 	// Validate "at".
74
-	if (empty($_GET['at']))
75
-		fatal_lang_error('numbers_one_to_nine', false);
77
+	if (empty($_GET['at'])) {
78
+			fatal_lang_error('numbers_one_to_nine', false);
79
+	}
76 80
 	$_GET['at'] = (int) $_GET['at'];
77 81
 
78 82
 	// Retrieve the subject and stuff of the specific topic/message.
@@ -89,26 +93,31 @@  discard block
 block discarded – undo
89 93
 			'split_at' => $_GET['at'],
90 94
 		)
91 95
 	);
92
-	if ($smcFunc['db_num_rows']($request) == 0)
93
-		fatal_lang_error('cant_find_messages');
96
+	if ($smcFunc['db_num_rows']($request) == 0) {
97
+			fatal_lang_error('cant_find_messages');
98
+	}
94 99
 	list ($_REQUEST['subname'], $num_replies, $unapproved_posts, $id_first_msg, $approved) = $smcFunc['db_fetch_row']($request);
95 100
 	$smcFunc['db_free_result']($request);
96 101
 
97 102
 	// If not approved validate they can see it.
98
-	if ($modSettings['postmod_active'] && !$approved)
99
-		isAllowedTo('approve_posts');
103
+	if ($modSettings['postmod_active'] && !$approved) {
104
+			isAllowedTo('approve_posts');
105
+	}
100 106
 
101 107
 	// If this topic has unapproved posts, we need to count them too...
102
-	if ($modSettings['postmod_active'] && allowedTo('approve_posts'))
103
-		$num_replies += $unapproved_posts - ($approved ? 0 : 1);
108
+	if ($modSettings['postmod_active'] && allowedTo('approve_posts')) {
109
+			$num_replies += $unapproved_posts - ($approved ? 0 : 1);
110
+	}
104 111
 
105 112
 	// Check if there is more than one message in the topic.  (there should be.)
106
-	if ($num_replies < 1)
107
-		fatal_lang_error('topic_one_post', false);
113
+	if ($num_replies < 1) {
114
+			fatal_lang_error('topic_one_post', false);
115
+	}
108 116
 
109 117
 	// Check if this is the first message in the topic (if so, the first and second option won't be available)
110
-	if ($id_first_msg == $_GET['at'])
111
-		return SplitSelectTopics();
118
+	if ($id_first_msg == $_GET['at']) {
119
+			return SplitSelectTopics();
120
+	}
112 121
 
113 122
 	// Basic template information....
114 123
 	$context['message'] = array(
@@ -137,8 +146,9 @@  discard block
 block discarded – undo
137 146
 	checkSession();
138 147
 
139 148
 	// Clean up the subject.
140
-	if (!isset($_POST['subname']) || $_POST['subname'] == '')
141
-		$_POST['subname'] = $txt['new_topic'];
149
+	if (!isset($_POST['subname']) || $_POST['subname'] == '') {
150
+			$_POST['subname'] = $txt['new_topic'];
151
+	}
142 152
 
143 153
 	// Redirect to the selector if they chose selective.
144 154
 	if ($_POST['step2'] == 'selective')
@@ -163,16 +173,19 @@  discard block
 block discarded – undo
163 173
 				'split_at' => $_POST['at'],
164 174
 			)
165 175
 		);
166
-		while ($row = $smcFunc['db_fetch_assoc']($request))
167
-			$messagesToBeSplit[] = $row['id_msg'];
176
+		while ($row = $smcFunc['db_fetch_assoc']($request)) {
177
+					$messagesToBeSplit[] = $row['id_msg'];
178
+		}
168 179
 		$smcFunc['db_free_result']($request);
169 180
 	}
170 181
 	// Only the selected message has to be split. That should be easy.
171
-	elseif ($_POST['step2'] == 'onlythis')
172
-		$messagesToBeSplit[] = $_POST['at'];
182
+	elseif ($_POST['step2'] == 'onlythis') {
183
+			$messagesToBeSplit[] = $_POST['at'];
184
+	}
173 185
 	// There's another action?!
174
-	else
175
-		fatal_lang_error('no_access', false);
186
+	else {
187
+			fatal_lang_error('no_access', false);
188
+	}
176 189
 
177 190
 	$context['old_topic'] = $topic;
178 191
 	$context['new_topic'] = splitTopic($topic, $messagesToBeSplit, $_POST['subname']);
@@ -199,8 +212,9 @@  discard block
 block discarded – undo
199 212
 	$_SESSION['split_selection'][$topic] = empty($_SESSION['split_selection'][$topic]) ? array() : $_SESSION['split_selection'][$topic];
200 213
 
201 214
 	// This is a special case for split topics from quick-moderation checkboxes
202
-	if (isset($_REQUEST['subname_enc']))
203
-		$_REQUEST['subname'] = urldecode($_REQUEST['subname_enc']);
215
+	if (isset($_REQUEST['subname_enc'])) {
216
+			$_REQUEST['subname'] = urldecode($_REQUEST['subname_enc']);
217
+	}
204 218
 
205 219
 	$context['not_selected'] = array(
206 220
 		'num_messages' => 0,
@@ -252,10 +266,12 @@  discard block
 block discarded – undo
252 266
 			)
253 267
 		);
254 268
 		// You can't split the last message off.
255
-		if (empty($context['not_selected']['start']) && $smcFunc['db_num_rows']($request) <= 1 && $_REQUEST['move'] == 'down')
256
-			$_REQUEST['move'] = '';
257
-		while ($row = $smcFunc['db_fetch_assoc']($request))
258
-			$original_msgs['not_selected'][] = $row['id_msg'];
269
+		if (empty($context['not_selected']['start']) && $smcFunc['db_num_rows']($request) <= 1 && $_REQUEST['move'] == 'down') {
270
+					$_REQUEST['move'] = '';
271
+		}
272
+		while ($row = $smcFunc['db_fetch_assoc']($request)) {
273
+					$original_msgs['not_selected'][] = $row['id_msg'];
274
+		}
259 275
 		$smcFunc['db_free_result']($request);
260 276
 		if (!empty($_SESSION['split_selection'][$topic]))
261 277
 		{
@@ -275,8 +291,9 @@  discard block
 block discarded – undo
275 291
 					'messages_per_page' => $context['messages_per_page'],
276 292
 				)
277 293
 			);
278
-			while ($row = $smcFunc['db_fetch_assoc']($request))
279
-				$original_msgs['selected'][] = $row['id_msg'];
294
+			while ($row = $smcFunc['db_fetch_assoc']($request)) {
295
+							$original_msgs['selected'][] = $row['id_msg'];
296
+			}
280 297
 			$smcFunc['db_free_result']($request);
281 298
 		}
282 299
 	}
@@ -286,12 +303,13 @@  discard block
 block discarded – undo
286 303
 	{
287 304
 		$_REQUEST['msg'] = (int) $_REQUEST['msg'];
288 305
 
289
-		if ($_REQUEST['move'] == 'reset')
290
-			$_SESSION['split_selection'][$topic] = array();
291
-		elseif ($_REQUEST['move'] == 'up')
292
-			$_SESSION['split_selection'][$topic] = array_diff($_SESSION['split_selection'][$topic], array($_REQUEST['msg']));
293
-		else
294
-			$_SESSION['split_selection'][$topic][] = $_REQUEST['msg'];
306
+		if ($_REQUEST['move'] == 'reset') {
307
+					$_SESSION['split_selection'][$topic] = array();
308
+		} elseif ($_REQUEST['move'] == 'up') {
309
+					$_SESSION['split_selection'][$topic] = array_diff($_SESSION['split_selection'][$topic], array($_REQUEST['msg']));
310
+		} else {
311
+					$_SESSION['split_selection'][$topic][] = $_REQUEST['msg'];
312
+		}
295 313
 	}
296 314
 
297 315
 	// Make sure the selection is still accurate.
@@ -310,8 +328,9 @@  discard block
 block discarded – undo
310 328
 			)
311 329
 		);
312 330
 		$_SESSION['split_selection'][$topic] = array();
313
-		while ($row = $smcFunc['db_fetch_assoc']($request))
314
-			$_SESSION['split_selection'][$topic][] = $row['id_msg'];
331
+		while ($row = $smcFunc['db_fetch_assoc']($request)) {
332
+					$_SESSION['split_selection'][$topic][] = $row['id_msg'];
333
+		}
315 334
 		$smcFunc['db_free_result']($request);
316 335
 	}
317 336
 
@@ -328,13 +347,15 @@  discard block
 block discarded – undo
328 347
 			'is_approved' => 1,
329 348
 		)
330 349
 	);
331
-	while ($row = $smcFunc['db_fetch_assoc']($request))
332
-		$context[empty($row['is_selected']) || $row['is_selected'] == 'f' ? 'not_selected' : 'selected']['num_messages'] = $row['num_messages'];
350
+	while ($row = $smcFunc['db_fetch_assoc']($request)) {
351
+			$context[empty($row['is_selected']) || $row['is_selected'] == 'f' ? 'not_selected' : 'selected']['num_messages'] = $row['num_messages'];
352
+	}
333 353
 	$smcFunc['db_free_result']($request);
334 354
 
335 355
 	// Fix an oversized starting page (to make sure both pageindexes are properly set).
336
-	if ($context['selected']['start'] >= $context['selected']['num_messages'])
337
-		$context['selected']['start'] = $context['selected']['num_messages'] <= $context['messages_per_page'] ? 0 : ($context['selected']['num_messages'] - (($context['selected']['num_messages'] % $context['messages_per_page']) == 0 ? $context['messages_per_page'] : ($context['selected']['num_messages'] % $context['messages_per_page'])));
356
+	if ($context['selected']['start'] >= $context['selected']['num_messages']) {
357
+			$context['selected']['start'] = $context['selected']['num_messages'] <= $context['messages_per_page'] ? 0 : ($context['selected']['num_messages'] - (($context['selected']['num_messages'] % $context['messages_per_page']) == 0 ? $context['messages_per_page'] : ($context['selected']['num_messages'] % $context['messages_per_page'])));
358
+	}
338 359
 
339 360
 	// Build a page list of the not-selected topics...
340 361
 	$context['not_selected']['page_index'] = constructPageIndex($scripturl . '?action=splittopics;sa=selectTopics;subname=' . strtr(urlencode($_REQUEST['subname']), array('%' => '%%')) . ';topic=' . $topic . '.%1$d;start2=' . $context['selected']['start'], $context['not_selected']['start'], $context['not_selected']['num_messages'], $context['messages_per_page'], true);
@@ -434,11 +455,12 @@  discard block
 block discarded – undo
434 455
 		);
435 456
 
436 457
 		$context['changes'] = array();
437
-		foreach ($changes as $change_type => $change_array)
438
-			foreach ($change_array as $section => $msg_array)
458
+		foreach ($changes as $change_type => $change_array) {
459
+					foreach ($change_array as $section => $msg_array)
439 460
 			{
440 461
 				if (empty($msg_array))
441 462
 					continue;
463
+		}
442 464
 
443 465
 				foreach ($msg_array as $id_msg)
444 466
 				{
@@ -447,8 +469,9 @@  discard block
 block discarded – undo
447 469
 						'type' => $change_type,
448 470
 						'section' => $section,
449 471
 					);
450
-					if ($change_type == 'insert')
451
-						$context['changes']['insert' . $id_msg]['insert_value'] = $context[$section]['messages'][$id_msg];
472
+					if ($change_type == 'insert') {
473
+											$context['changes']['insert' . $id_msg]['insert_value'] = $context[$section]['messages'][$id_msg];
474
+					}
452 475
 				}
453 476
 			}
454 477
 	}
@@ -468,12 +491,14 @@  discard block
 block discarded – undo
468 491
 	checkSession();
469 492
 
470 493
 	// Default the subject in case it's blank.
471
-	if (!isset($_POST['subname']) || $_POST['subname'] == '')
472
-		$_POST['subname'] = $txt['new_topic'];
494
+	if (!isset($_POST['subname']) || $_POST['subname'] == '') {
495
+			$_POST['subname'] = $txt['new_topic'];
496
+	}
473 497
 
474 498
 	// You must've selected some messages!  Can't split out none!
475
-	if (empty($_SESSION['split_selection'][$topic]))
476
-		fatal_lang_error('no_posts_selected', false);
499
+	if (empty($_SESSION['split_selection'][$topic])) {
500
+			fatal_lang_error('no_posts_selected', false);
501
+	}
477 502
 
478 503
 	$context['old_topic'] = $topic;
479 504
 	$context['new_topic'] = splitTopic($topic, $_SESSION['split_selection'][$topic], $_POST['subname']);
@@ -499,8 +524,9 @@  discard block
 block discarded – undo
499 524
 	global $smcFunc, $txt, $sourcedir;
500 525
 
501 526
 	// Nothing to split?
502
-	if (empty($splitMessages))
503
-		fatal_lang_error('no_posts_selected', false);
527
+	if (empty($splitMessages)) {
528
+			fatal_lang_error('no_posts_selected', false);
529
+	}
504 530
 
505 531
 	// Get some board info.
506 532
 	$request = $smcFunc['db_query']('', '
@@ -532,8 +558,9 @@  discard block
 block discarded – undo
532 558
 		)
533 559
 	);
534 560
 	// You can't select ALL the messages!
535
-	if ($smcFunc['db_num_rows']($request) == 0)
536
-		fatal_lang_error('selected_all_posts', false);
561
+	if ($smcFunc['db_num_rows']($request) == 0) {
562
+			fatal_lang_error('selected_all_posts', false);
563
+	}
537 564
 
538 565
 	$split1_first_msg = null;
539 566
 	$split1_last_msg = null;
@@ -541,24 +568,27 @@  discard block
 block discarded – undo
541 568
 	while ($row = $smcFunc['db_fetch_assoc']($request))
542 569
 	{
543 570
 		// Get the right first and last message dependant on approved state...
544
-		if (empty($split1_first_msg) || $row['myid_first_msg'] < $split1_first_msg)
545
-			$split1_first_msg = $row['myid_first_msg'];
546
-		if (empty($split1_last_msg) || $row['approved'])
547
-			$split1_last_msg = $row['myid_last_msg'];
571
+		if (empty($split1_first_msg) || $row['myid_first_msg'] < $split1_first_msg) {
572
+					$split1_first_msg = $row['myid_first_msg'];
573
+		}
574
+		if (empty($split1_last_msg) || $row['approved']) {
575
+					$split1_last_msg = $row['myid_last_msg'];
576
+		}
548 577
 
549 578
 		// Get the counts correct...
550 579
 		if ($row['approved'])
551 580
 		{
552 581
 			$split1_replies = $row['message_count'] - 1;
553 582
 			$split1_unapprovedposts = 0;
554
-		}
555
-		else
583
+		} else
556 584
 		{
557
-			if (!isset($split1_replies))
558
-				$split1_replies = 0;
585
+			if (!isset($split1_replies)) {
586
+							$split1_replies = 0;
587
+			}
559 588
 			// If the topic isn't approved then num replies must go up by one... as first post wouldn't be counted.
560
-			elseif (!$split1_approved)
561
-				$split1_replies++;
589
+			elseif (!$split1_approved) {
590
+							$split1_replies++;
591
+			}
562 592
 
563 593
 			$split1_unapprovedposts = $row['message_count'];
564 594
 		}
@@ -584,10 +614,12 @@  discard block
 block discarded – undo
584 614
 	while ($row = $smcFunc['db_fetch_assoc']($request))
585 615
 	{
586 616
 		// As before get the right first and last message dependant on approved state...
587
-		if (empty($split2_first_msg) || $row['myid_first_msg'] < $split2_first_msg)
588
-			$split2_first_msg = $row['myid_first_msg'];
589
-		if (empty($split2_last_msg) || $row['approved'])
590
-			$split2_last_msg = $row['myid_last_msg'];
617
+		if (empty($split2_first_msg) || $row['myid_first_msg'] < $split2_first_msg) {
618
+					$split2_first_msg = $row['myid_first_msg'];
619
+		}
620
+		if (empty($split2_last_msg) || $row['approved']) {
621
+					$split2_last_msg = $row['myid_last_msg'];
622
+		}
591 623
 
592 624
 		// Then do the counts again...
593 625
 		if ($row['approved'])
@@ -595,18 +627,20 @@  discard block
 block discarded – undo
595 627
 			$split2_approved = true;
596 628
 			$split2_replies = $row['message_count'] - 1;
597 629
 			$split2_unapprovedposts = 0;
598
-		}
599
-		else
630
+		} else
600 631
 		{
601 632
 			// Should this one be approved??
602
-			if ($split2_first_msg == $row['myid_first_msg'])
603
-				$split2_approved = false;
633
+			if ($split2_first_msg == $row['myid_first_msg']) {
634
+							$split2_approved = false;
635
+			}
604 636
 
605
-			if (!isset($split2_replies))
606
-				$split2_replies = 0;
637
+			if (!isset($split2_replies)) {
638
+							$split2_replies = 0;
639
+			}
607 640
 			// As before, fix number of replies.
608
-			elseif (!$split2_approved)
609
-				$split2_replies++;
641
+			elseif (!$split2_approved) {
642
+							$split2_replies++;
643
+			}
610 644
 
611 645
 			$split2_unapprovedposts = $row['message_count'];
612 646
 		}
@@ -616,12 +650,14 @@  discard block
 block discarded – undo
616 650
 	$split2_lastMem = getMsgMemberID($split2_last_msg);
617 651
 
618 652
 	// No database changes yet, so let's double check to see if everything makes at least a little sense.
619
-	if ($split1_first_msg <= 0 || $split1_last_msg <= 0 || $split2_first_msg <= 0 || $split2_last_msg <= 0 || $split1_replies < 0 || $split2_replies < 0 || $split1_unapprovedposts < 0 || $split2_unapprovedposts < 0 || !isset($split1_approved) || !isset($split2_approved))
620
-		fatal_lang_error('cant_find_messages');
653
+	if ($split1_first_msg <= 0 || $split1_last_msg <= 0 || $split2_first_msg <= 0 || $split2_last_msg <= 0 || $split1_replies < 0 || $split2_replies < 0 || $split1_unapprovedposts < 0 || $split2_unapprovedposts < 0 || !isset($split1_approved) || !isset($split2_approved)) {
654
+			fatal_lang_error('cant_find_messages');
655
+	}
621 656
 
622 657
 	// You cannot split off the first message of a topic.
623
-	if ($split1_first_msg > $split2_first_msg)
624
-		fatal_lang_error('split_first_post', false);
658
+	if ($split1_first_msg > $split2_first_msg) {
659
+			fatal_lang_error('split_first_post', false);
660
+	}
625 661
 
626 662
 	// We're off to insert the new topic!  Use 0 for now to avoid UNIQUE errors.
627 663
 	$split2_ID_TOPIC = $smcFunc['db_insert']('',
@@ -644,14 +680,16 @@  discard block
 block discarded – undo
644 680
 			array('id_topic'),
645 681
 			1
646 682
 		);
647
-	if ($split2_ID_TOPIC <= 0)
648
-		fatal_lang_error('cant_insert_topic');
683
+	if ($split2_ID_TOPIC <= 0) {
684
+			fatal_lang_error('cant_insert_topic');
685
+	}
649 686
 
650 687
 	// Move the messages over to the other topic.
651 688
 	$new_subject = strtr($smcFunc['htmltrim']($smcFunc['htmlspecialchars']($new_subject)), array("\r" => '', "\n" => '', "\t" => ''));
652 689
 	// Check the subject length.
653
-	if ($smcFunc['strlen']($new_subject) > 100)
654
-		$new_subject = $smcFunc['substr']($new_subject, 0, 100);
690
+	if ($smcFunc['strlen']($new_subject) > 100) {
691
+			$new_subject = $smcFunc['substr']($new_subject, 0, 100);
692
+	}
655 693
 	// Valid subject?
656 694
 	if ($new_subject != '')
657 695
 	{
@@ -722,8 +760,8 @@  discard block
 block discarded – undo
722 760
 	);
723 761
 
724 762
 	// If the new topic isn't approved ensure the first message flags this just in case.
725
-	if (!$split2_approved)
726
-		$smcFunc['db_query']('', '
763
+	if (!$split2_approved) {
764
+			$smcFunc['db_query']('', '
727 765
 			UPDATE {db_prefix}messages
728 766
 			SET approved = {int:approved}
729 767
 			WHERE id_msg = {int:id_msg}
@@ -734,6 +772,7 @@  discard block
 block discarded – undo
734 772
 				'id_topic' => $split2_ID_TOPIC,
735 773
 			)
736 774
 		);
775
+	}
737 776
 
738 777
 	// The board has more topics now (Or more unapproved ones!).
739 778
 	$smcFunc['db_query']('', '
@@ -760,8 +799,9 @@  discard block
 block discarded – undo
760 799
 	if ($smcFunc['db_num_rows']($request) > 0)
761 800
 	{
762 801
 		$replaceEntries = array();
763
-		while ($row = $smcFunc['db_fetch_assoc']($request))
764
-			$replaceEntries[] = array($row['id_member'], $split2_ID_TOPIC, $row['id_msg'], $row['unwatched']);
802
+		while ($row = $smcFunc['db_fetch_assoc']($request)) {
803
+					$replaceEntries[] = array($row['id_member'], $split2_ID_TOPIC, $row['id_msg'], $row['unwatched']);
804
+		}
765 805
 
766 806
 		$smcFunc['db_insert']('ignore',
767 807
 			'{db_prefix}log_topics',
@@ -785,8 +825,9 @@  discard block
 block discarded – undo
785 825
 	// If there's a search index that needs updating, update it...
786 826
 	require_once($sourcedir . '/Search.php');
787 827
 	$searchAPI = findSearchAPI();
788
-	if (is_callable(array($searchAPI, 'topicSplit')))
789
-		$searchAPI->topicSplit($split2_ID_TOPIC, $splitMessages);
828
+	if (is_callable(array($searchAPI, 'topicSplit'))) {
829
+			$searchAPI->topicSplit($split2_ID_TOPIC, $splitMessages);
830
+	}
790 831
 
791 832
 	// Maybe we want to let an external CMS know about this split
792 833
 	$split1 = array(
@@ -833,12 +874,12 @@  discard block
 block discarded – undo
833 874
 	);
834 875
 
835 876
 	// ?action=mergetopics;sa=LETSBREAKIT won't work, sorry.
836
-	if (empty($_REQUEST['sa']) || !isset($subActions[$_REQUEST['sa']]))
837
-		MergeIndex();
838
-
839
-	else
840
-		call_helper($subActions[$_REQUEST['sa']]);
841
-}
877
+	if (empty($_REQUEST['sa']) || !isset($subActions[$_REQUEST['sa']])) {
878
+			MergeIndex();
879
+	} else {
880
+			call_helper($subActions[$_REQUEST['sa']]);
881
+	}
882
+	}
842 883
 
843 884
 /**
844 885
  * allows to pick a topic to merge the current topic with.
@@ -852,8 +893,9 @@  discard block
 block discarded – undo
852 893
 	global $txt, $board, $context, $smcFunc, $sourcedir;
853 894
 	global $scripturl, $modSettings;
854 895
 
855
-	if (!isset($_GET['from']))
856
-		fatal_lang_error('no_access', false);
896
+	if (!isset($_GET['from'])) {
897
+			fatal_lang_error('no_access', false);
898
+	}
857 899
 	$_GET['from'] = (int) $_GET['from'];
858 900
 
859 901
 	$_REQUEST['targetboard'] = isset($_REQUEST['targetboard']) ? (int) $_REQUEST['targetboard'] : $board;
@@ -864,9 +906,9 @@  discard block
 block discarded – undo
864 906
 	{
865 907
 		$can_approve_boards = boardsAllowedTo('approve_posts');
866 908
 		$onlyApproved = $can_approve_boards !== array(0) && !in_array($_REQUEST['targetboard'], $can_approve_boards);
909
+	} else {
910
+			$onlyApproved = false;
867 911
 	}
868
-	else
869
-		$onlyApproved = false;
870 912
 
871 913
 	// How many topics are on this board?  (used for paging.)
872 914
 	$request = $smcFunc['db_query']('', '
@@ -900,8 +942,9 @@  discard block
 block discarded – undo
900 942
 			'is_approved' => 1,
901 943
 		)
902 944
 	);
903
-	if ($smcFunc['db_num_rows']($request) == 0)
904
-		fatal_lang_error('no_board');
945
+	if ($smcFunc['db_num_rows']($request) == 0) {
946
+			fatal_lang_error('no_board');
947
+	}
905 948
 	list ($subject) = $smcFunc['db_fetch_row']($request);
906 949
 	$smcFunc['db_free_result']($request);
907 950
 
@@ -914,8 +957,9 @@  discard block
 block discarded – undo
914 957
 	// Check which boards you have merge permissions on.
915 958
 	$merge_boards = boardsAllowedTo('merge_any');
916 959
 
917
-	if (empty($merge_boards))
918
-		fatal_lang_error('cannot_merge_any', 'user');
960
+	if (empty($merge_boards)) {
961
+			fatal_lang_error('cannot_merge_any', 'user');
962
+	}
919 963
 
920 964
 	// No sense in loading this if you can only merge on this board
921 965
 	if (count($merge_boards) > 1 || in_array(0, $merge_boards))
@@ -929,8 +973,9 @@  discard block
 block discarded – undo
929 973
 		);
930 974
 
931 975
 		// Only include these boards in the list (0 means you're an admin')
932
-		if (!in_array(0, $merge_boards))
933
-			$options['included_boards'] = $merge_boards;
976
+		if (!in_array(0, $merge_boards)) {
977
+					$options['included_boards'] = $merge_boards;
978
+		}
934 979
 
935 980
 		$context['merge_categories'] = getBoardList($options);
936 981
 	}
@@ -976,8 +1021,9 @@  discard block
 block discarded – undo
976 1021
 	}
977 1022
 	$smcFunc['db_free_result']($request);
978 1023
 
979
-	if (empty($context['topics']) && count($merge_boards) <= 1 && !in_array(0, $merge_boards))
980
-		fatal_lang_error('merge_need_more_topics');
1024
+	if (empty($context['topics']) && count($merge_boards) <= 1 && !in_array(0, $merge_boards)) {
1025
+			fatal_lang_error('merge_need_more_topics');
1026
+	}
981 1027
 
982 1028
 	$context['sub_template'] = 'merge';
983 1029
 }
@@ -1007,24 +1053,29 @@  discard block
 block discarded – undo
1007 1053
 	checkSession('request');
1008 1054
 
1009 1055
 	// Handle URLs from MergeIndex.
1010
-	if (!empty($_GET['from']) && !empty($_GET['to']))
1011
-		$topics = array((int) $_GET['from'], (int) $_GET['to']);
1056
+	if (!empty($_GET['from']) && !empty($_GET['to'])) {
1057
+			$topics = array((int) $_GET['from'], (int) $_GET['to']);
1058
+	}
1012 1059
 
1013 1060
 	// If we came from a form, the topic IDs came by post.
1014
-	if (!empty($_POST['topics']) && is_array($_POST['topics']))
1015
-		$topics = $_POST['topics'];
1061
+	if (!empty($_POST['topics']) && is_array($_POST['topics'])) {
1062
+			$topics = $_POST['topics'];
1063
+	}
1016 1064
 
1017 1065
 	// There's nothing to merge with just one topic...
1018
-	if (empty($topics) || !is_array($topics) || count($topics) == 1)
1019
-		fatal_lang_error('merge_need_more_topics');
1066
+	if (empty($topics) || !is_array($topics) || count($topics) == 1) {
1067
+			fatal_lang_error('merge_need_more_topics');
1068
+	}
1020 1069
 
1021 1070
 	// Make sure every topic is numeric, or some nasty things could be done with the DB.
1022
-	foreach ($topics as $id => $topic)
1023
-		$topics[$id] = (int) $topic;
1071
+	foreach ($topics as $id => $topic) {
1072
+			$topics[$id] = (int) $topic;
1073
+	}
1024 1074
 
1025 1075
 	// Joy of all joys, make sure they're not messing about with unapproved topics they can't see :P
1026
-	if ($modSettings['postmod_active'])
1027
-		$can_approve_boards = boardsAllowedTo('approve_posts');
1076
+	if ($modSettings['postmod_active']) {
1077
+			$can_approve_boards = boardsAllowedTo('approve_posts');
1078
+	}
1028 1079
 
1029 1080
 	// Get info about the topics and polls that will be merged.
1030 1081
 	$request = $smcFunc['db_query']('', '
@@ -1045,8 +1096,9 @@  discard block
 block discarded – undo
1045 1096
 			'limit' => count($topics),
1046 1097
 		)
1047 1098
 	);
1048
-	if ($smcFunc['db_num_rows']($request) < 2)
1049
-		fatal_lang_error('no_topic_id');
1099
+	if ($smcFunc['db_num_rows']($request) < 2) {
1100
+			fatal_lang_error('no_topic_id');
1101
+	}
1050 1102
 	$num_views = 0;
1051 1103
 	$is_sticky = 0;
1052 1104
 	$boardTotals = array();
@@ -1059,34 +1111,38 @@  discard block
 block discarded – undo
1059 1111
 	while ($row = $smcFunc['db_fetch_assoc']($request))
1060 1112
 	{
1061 1113
 		// Sorry, redirection topics can't be merged
1062
-		if (!empty($row['id_redirect_topic']))
1063
-			fatal_lang_error('cannot_merge_redirect', false);
1114
+		if (!empty($row['id_redirect_topic'])) {
1115
+					fatal_lang_error('cannot_merge_redirect', false);
1116
+		}
1064 1117
 
1065 1118
 		// Make a note for the board counts...
1066
-		if (!isset($boardTotals[$row['id_board']]))
1067
-			$boardTotals[$row['id_board']] = array(
1119
+		if (!isset($boardTotals[$row['id_board']])) {
1120
+					$boardTotals[$row['id_board']] = array(
1068 1121
 				'posts' => 0,
1069 1122
 				'topics' => 0,
1070 1123
 				'unapproved_posts' => 0,
1071 1124
 				'unapproved_topics' => 0
1072 1125
 			);
1126
+		}
1073 1127
 
1074 1128
 		// We can't see unapproved topics here?
1075 1129
 		if ($modSettings['postmod_active'] && !$row['approved'] && $can_approve_boards != array(0) && in_array($row['id_board'], $can_approve_boards))
1076 1130
 		{
1077 1131
 			unset($topics[$row['id_topic']]); // If we can't see it, we should not merge it and not adjust counts! Instead skip it.
1078 1132
 			continue;
1079
-		}elseif (!$row['approved'])
1080
-			$boardTotals[$row['id_board']]['unapproved_topics']++;
1081
-		else
1082
-			$boardTotals[$row['id_board']]['topics']++;
1133
+		} elseif (!$row['approved']) {
1134
+					$boardTotals[$row['id_board']]['unapproved_topics']++;
1135
+		} else {
1136
+					$boardTotals[$row['id_board']]['topics']++;
1137
+		}
1083 1138
 
1084 1139
 		$boardTotals[$row['id_board']]['unapproved_posts'] += $row['unapproved_posts'];
1085 1140
 		$boardTotals[$row['id_board']]['posts'] += $row['num_replies'] + ($row['approved'] ? 1 : 0);
1086 1141
 
1087 1142
 		// In the case of making a redirect, the topic count goes up by one due to the redirect topic.
1088
-		if (isset($_POST['postRedirect']))
1089
-			$boardTotals[$row['id_board']]['topics']--;
1143
+		if (isset($_POST['postRedirect'])) {
1144
+					$boardTotals[$row['id_board']]['topics']--;
1145
+		}
1090 1146
 
1091 1147
 		$topic_data[$row['id_topic']] = array(
1092 1148
 			'id' => $row['id_topic'],
@@ -1112,11 +1168,13 @@  discard block
 block discarded – undo
1112 1168
 		$boards[] = $row['id_board'];
1113 1169
 
1114 1170
 		// If there's no poll, id_poll == 0...
1115
-		if ($row['id_poll'] > 0)
1116
-			$polls[] = $row['id_poll'];
1171
+		if ($row['id_poll'] > 0) {
1172
+					$polls[] = $row['id_poll'];
1173
+		}
1117 1174
 		// Store the id_topic with the lowest id_first_msg.
1118
-		if (empty($firstTopic))
1119
-			$firstTopic = $row['id_topic'];
1175
+		if (empty($firstTopic)) {
1176
+					$firstTopic = $row['id_topic'];
1177
+		}
1120 1178
 
1121 1179
 		// Lowest topic id gets selected as surviving topic id. We need to store this board so we can adjust the topic count (This one will not have a redirect topic)
1122 1180
 		if ($row['id_topic'] < $lowestTopicId || empty($lowestTopicId))
@@ -1130,11 +1188,13 @@  discard block
 block discarded – undo
1130 1188
 	$smcFunc['db_free_result']($request);
1131 1189
 
1132 1190
 	// If we didn't get any topics then they've been messing with unapproved stuff.
1133
-	if (empty($topic_data))
1134
-		fatal_lang_error('no_topic_id');
1191
+	if (empty($topic_data)) {
1192
+			fatal_lang_error('no_topic_id');
1193
+	}
1135 1194
 
1136
-	if (isset($_POST['postRedirect']) && !empty($lowestTopicBoard))
1137
-		$boardTotals[$lowestTopicBoard]['topics']++;
1195
+	if (isset($_POST['postRedirect']) && !empty($lowestTopicBoard)) {
1196
+			$boardTotals[$lowestTopicBoard]['topics']++;
1197
+	}
1138 1198
 
1139 1199
 	// Will this be approved?
1140 1200
 	$context['is_approved'] = $topic_data[$firstTopic]['approved'];
@@ -1150,8 +1210,9 @@  discard block
 block discarded – undo
1150 1210
 
1151 1211
 	// Get the boards a user is allowed to merge in.
1152 1212
 	$merge_boards = boardsAllowedTo('merge_any');
1153
-	if (empty($merge_boards))
1154
-		fatal_lang_error('cannot_merge_any', 'user');
1213
+	if (empty($merge_boards)) {
1214
+			fatal_lang_error('cannot_merge_any', 'user');
1215
+	}
1155 1216
 
1156 1217
 	// Make sure they can see all boards....
1157 1218
 	$request = $smcFunc['db_query']('', '
@@ -1168,8 +1229,9 @@  discard block
 block discarded – undo
1168 1229
 		)
1169 1230
 	);
1170 1231
 	// If the number of boards that's in the output isn't exactly the same as we've put in there, you're in trouble.
1171
-	if ($smcFunc['db_num_rows']($request) != count($boards))
1172
-		fatal_lang_error('no_board');
1232
+	if ($smcFunc['db_num_rows']($request) != count($boards)) {
1233
+			fatal_lang_error('no_board');
1234
+	}
1173 1235
 	$smcFunc['db_free_result']($request);
1174 1236
 
1175 1237
 	if (empty($_REQUEST['sa']) || $_REQUEST['sa'] == 'options')
@@ -1188,8 +1250,8 @@  discard block
 block discarded – undo
1188 1250
 					'limit' => count($polls),
1189 1251
 				)
1190 1252
 			);
1191
-			while ($row = $smcFunc['db_fetch_assoc']($request))
1192
-				$context['polls'][] = array(
1253
+			while ($row = $smcFunc['db_fetch_assoc']($request)) {
1254
+							$context['polls'][] = array(
1193 1255
 					'id' => $row['id_poll'],
1194 1256
 					'topic' => array(
1195 1257
 						'id' => $row['id_topic'],
@@ -1198,6 +1260,7 @@  discard block
 block discarded – undo
1198 1260
 					'question' => $row['question'],
1199 1261
 					'selected' => $row['id_topic'] == $firstTopic
1200 1262
 				);
1263
+			}
1201 1264
 			$smcFunc['db_free_result']($request);
1202 1265
 		}
1203 1266
 		if (count($boards) > 1)
@@ -1213,18 +1276,20 @@  discard block
 block discarded – undo
1213 1276
 					'limit' => count($boards),
1214 1277
 				)
1215 1278
 			);
1216
-			while ($row = $smcFunc['db_fetch_assoc']($request))
1217
-				$context['boards'][] = array(
1279
+			while ($row = $smcFunc['db_fetch_assoc']($request)) {
1280
+							$context['boards'][] = array(
1218 1281
 					'id' => $row['id_board'],
1219 1282
 					'name' => $row['name'],
1220 1283
 					'selected' => $row['id_board'] == $topic_data[$firstTopic]['board']
1221 1284
 				);
1285
+			}
1222 1286
 			$smcFunc['db_free_result']($request);
1223 1287
 		}
1224 1288
 
1225 1289
 		$context['topics'] = $topic_data;
1226
-		foreach ($topic_data as $id => $topic)
1227
-			$context['topics'][$id]['selected'] = $topic['id'] == $firstTopic;
1290
+		foreach ($topic_data as $id => $topic) {
1291
+					$context['topics'][$id]['selected'] = $topic['id'] == $firstTopic;
1292
+		}
1228 1293
 
1229 1294
 		$context['page_title'] = $txt['merge'];
1230 1295
 		$context['sub_template'] = 'merge_extra_options';
@@ -1233,13 +1298,15 @@  discard block
 block discarded – undo
1233 1298
 
1234 1299
 	// Determine target board.
1235 1300
 	$target_board = count($boards) > 1 ? (int) $_REQUEST['board'] : $boards[0];
1236
-	if (!in_array($target_board, $boards))
1237
-		fatal_lang_error('no_board');
1301
+	if (!in_array($target_board, $boards)) {
1302
+			fatal_lang_error('no_board');
1303
+	}
1238 1304
 
1239 1305
 	// Determine which poll will survive and which polls won't.
1240 1306
 	$target_poll = count($polls) > 1 ? (int) $_POST['poll'] : (count($polls) == 1 ? $polls[0] : 0);
1241
-	if ($target_poll > 0 && !in_array($target_poll, $polls))
1242
-		fatal_lang_error('no_access', false);
1307
+	if ($target_poll > 0 && !in_array($target_poll, $polls)) {
1308
+			fatal_lang_error('no_access', false);
1309
+	}
1243 1310
 	$deleted_polls = empty($target_poll) ? $polls : array_diff($polls, array($target_poll));
1244 1311
 
1245 1312
 	// Determine the subject of the newly merged topic - was a custom subject specified?
@@ -1247,19 +1314,23 @@  discard block
 block discarded – undo
1247 1314
 	{
1248 1315
 		$target_subject = strtr($smcFunc['htmltrim']($smcFunc['htmlspecialchars']($_POST['custom_subject'])), array("\r" => '', "\n" => '', "\t" => ''));
1249 1316
 		// Keep checking the length.
1250
-		if ($smcFunc['strlen']($target_subject) > 100)
1251
-			$target_subject = $smcFunc['substr']($target_subject, 0, 100);
1317
+		if ($smcFunc['strlen']($target_subject) > 100) {
1318
+					$target_subject = $smcFunc['substr']($target_subject, 0, 100);
1319
+		}
1252 1320
 
1253 1321
 		// Nothing left - odd but pick the first topics subject.
1254
-		if ($target_subject == '')
1255
-			$target_subject = $topic_data[$firstTopic]['subject'];
1322
+		if ($target_subject == '') {
1323
+					$target_subject = $topic_data[$firstTopic]['subject'];
1324
+		}
1256 1325
 	}
1257 1326
 	// A subject was selected from the list.
1258
-	elseif (!empty($topic_data[(int) $_POST['subject']]['subject']))
1259
-		$target_subject = $topic_data[(int) $_POST['subject']]['subject'];
1327
+	elseif (!empty($topic_data[(int) $_POST['subject']]['subject'])) {
1328
+			$target_subject = $topic_data[(int) $_POST['subject']]['subject'];
1329
+	}
1260 1330
 	// Nothing worked? Just take the subject of the first message.
1261
-	else
1262
-		$target_subject = $topic_data[$firstTopic]['subject'];
1331
+	else {
1332
+			$target_subject = $topic_data[$firstTopic]['subject'];
1333
+	}
1263 1334
 
1264 1335
 	// Get the first and last message and the number of messages....
1265 1336
 	$request = $smcFunc['db_query']('', '
@@ -1285,15 +1356,13 @@  discard block
 block discarded – undo
1285 1356
 			{
1286 1357
 				$num_replies = $row['message_count'] - 1;
1287 1358
 				$num_unapproved = 0;
1288
-			}
1289
-			else
1359
+			} else
1290 1360
 			{
1291 1361
 				$topic_approved = 0;
1292 1362
 				$num_replies = 0;
1293 1363
 				$num_unapproved = $row['message_count'];
1294 1364
 			}
1295
-		}
1296
-		else
1365
+		} else
1297 1366
 		{
1298 1367
 			// If this has a lower first_msg then the first post is not approved and hence the number of replies was wrong!
1299 1368
 			if ($first_msg > $row['first_msg'])
@@ -1339,8 +1408,9 @@  discard block
 block discarded – undo
1339 1408
 	list ($member_started) = $smcFunc['db_fetch_row']($request);
1340 1409
 	list ($member_updated) = $smcFunc['db_fetch_row']($request);
1341 1410
 	// First and last message are the same, so only row was returned.
1342
-	if ($member_updated === NULL)
1343
-		$member_updated = $member_started;
1411
+	if ($member_updated === NULL) {
1412
+			$member_updated = $member_started;
1413
+	}
1344 1414
 
1345 1415
 	$smcFunc['db_free_result']($request);
1346 1416
 
@@ -1353,8 +1423,9 @@  discard block
 block discarded – undo
1353 1423
 		array(
1354 1424
 			'topic_list' => $topics,
1355 1425
 	));
1356
-	while ($row = $smcFunc['db_fetch_row']($request))
1357
-		$affected_msgs[] = $row[0];
1426
+	while ($row = $smcFunc['db_fetch_row']($request)) {
1427
+			$affected_msgs[] = $row[0];
1428
+	}
1358 1429
 	$smcFunc['db_free_result']($request);
1359 1430
 
1360 1431
 	// Assign the first topic ID to be the merged topic.
@@ -1432,9 +1503,9 @@  discard block
 block discarded – undo
1432 1503
 	// Grab the response prefix (like 'Re: ') in the default forum language.
1433 1504
 	if (!isset($context['response_prefix']) && !($context['response_prefix'] = cache_get_data('response_prefix')))
1434 1505
 	{
1435
-		if ($language === $user_info['language'])
1436
-			$context['response_prefix'] = $txt['response_prefix'];
1437
-		else
1506
+		if ($language === $user_info['language']) {
1507
+					$context['response_prefix'] = $txt['response_prefix'];
1508
+		} else
1438 1509
 		{
1439 1510
 			loadLanguage('index', $language, false);
1440 1511
 			$context['response_prefix'] = $txt['response_prefix'];
@@ -1514,8 +1585,9 @@  discard block
 block discarded – undo
1514 1585
 	if ($smcFunc['db_num_rows']($request) > 0)
1515 1586
 	{
1516 1587
 		$replaceEntries = array();
1517
-		while ($row = $smcFunc['db_fetch_assoc']($request))
1518
-			$replaceEntries[] = array($row['id_member'], $id_topic, $row['new_id_msg'], $row['unwatched']);
1588
+		while ($row = $smcFunc['db_fetch_assoc']($request)) {
1589
+					$replaceEntries[] = array($row['id_member'], $id_topic, $row['new_id_msg'], $row['unwatched']);
1590
+		}
1519 1591
 
1520 1592
 		$smcFunc['db_insert']('replace',
1521 1593
 			'{db_prefix}log_topics',
@@ -1552,8 +1624,9 @@  discard block
 block discarded – undo
1552 1624
 		if ($smcFunc['db_num_rows']($request) > 0)
1553 1625
 		{
1554 1626
 			$replaceEntries = array();
1555
-			while ($row = $smcFunc['db_fetch_assoc']($request))
1556
-				$replaceEntries[] = array($row['id_member'], $id_topic, 0, $row['sent']);
1627
+			while ($row = $smcFunc['db_fetch_assoc']($request)) {
1628
+							$replaceEntries[] = array($row['id_member'], $id_topic, 0, $row['sent']);
1629
+			}
1557 1630
 
1558 1631
 			$smcFunc['db_insert']('replace',
1559 1632
 					'{db_prefix}log_notify',
@@ -1728,8 +1801,9 @@  discard block
 block discarded – undo
1728 1801
 	// If there's a search index that needs updating, update it...
1729 1802
 	require_once($sourcedir . '/Search.php');
1730 1803
 	$searchAPI = findSearchAPI();
1731
-	if (is_callable(array($searchAPI, 'topicMerge')))
1732
-		$searchAPI->topicMerge($id_topic, $topics, $affected_msgs, empty($_POST['enforce_subject']) ? null : array($context['response_prefix'], $target_subject));
1804
+	if (is_callable(array($searchAPI, 'topicMerge'))) {
1805
+			$searchAPI->topicMerge($id_topic, $topics, $affected_msgs, empty($_POST['enforce_subject']) ? null : array($context['response_prefix'], $target_subject));
1806
+	}
1733 1807
 
1734 1808
 	// Merging is the sort of thing an external CMS might want to know about
1735 1809
 	$merged_topic = array(
Please login to merge, or discard this patch.
Sources/index.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,8 @@
 block discarded – undo
12 12
 	header('Location: ' . $boardurl);
13 13
 }
14 14
 // Can't find it... just forget it.
15
-else
15
+else {
16 16
 	exit;
17
+}
17 18
 
18 19
 ?>
19 20
\ No newline at end of file
Please login to merge, or discard this patch.
Sources/tasks/index.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,9 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 // Try to handle it with the upper level index.php. (it should know what to do.)
4
-if (file_exists(dirname(dirname(__FILE__)) . '/index.php'))
4
+if (file_exists(dirname(dirname(__FILE__)) . '/index.php')) {
5 5
 	include (dirname(dirname(__FILE__)) . '/index.php');
6
-else
6
+} else {
7 7
 	exit;
8
+}
8 9
 
9 10
 ?>
10 11
\ No newline at end of file
Please login to merge, or discard this patch.
avatars/Oxygen/index.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,9 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 // Try to handle it with the upper level index.php. (it should know what to do.)
4
-if (file_exists(dirname(dirname(__FILE__)) . '/index.php'))
4
+if (file_exists(dirname(dirname(__FILE__)) . '/index.php')) {
5 5
 	include (dirname(dirname(__FILE__)) . '/index.php');
6
-else
6
+} else {
7 7
 	exit;
8
+}
8 9
 
9 10
 ?>
10 11
\ No newline at end of file
Please login to merge, or discard this patch.
avatars/index.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,8 @@
 block discarded – undo
12 12
 	header('Location: ' . $boardurl);
13 13
 }
14 14
 // Can't find it... just forget it.
15
-else
15
+else {
16 16
 	exit;
17
+}
17 18
 
18 19
 ?>
19 20
\ No newline at end of file
Please login to merge, or discard this patch.