Code Duplication    Length = 15-19 lines in 2 locations

Sources/Subs.php 1 location

@@ 111-129 (lines=19) @@
108
					}
109
110
					// What about unapproved COPPA registrations?
111
					if (!empty($modSettings['coppaType']) && $modSettings['coppaType'] != 1)
112
					{
113
						$result = $smcFunc['db_query']('', '
114
						SELECT COUNT(*)
115
						FROM {db_prefix}members
116
						WHERE is_activated = {int:coppa_approval}',
117
							array(
118
								'coppa_approval' => 5,
119
							)
120
						);
121
						list ($coppa_approvals) = $smcFunc['db_fetch_row']($result);
122
						$smcFunc['db_free_result']($result);
123
124
						// Add this to the number of unapproved members
125
						if (!empty($changes['unapprovedMembers']))
126
							$changes['unapprovedMembers'] += $coppa_approvals;
127
						else
128
							$changes['unapprovedMembers'] = $coppa_approvals;
129
					}
130
				}
131
			}
132
			updateSettings($changes);

Sources/Post.php 1 location

@@ 72-86 (lines=15) @@
69
	}
70
71
	// No message is complete without a topic.
72
	if (empty($topic) && !empty($_REQUEST['msg']))
73
	{
74
		$request = $smcFunc['db_query']('', '
75
			SELECT id_topic
76
			FROM {db_prefix}messages
77
			WHERE id_msg = {int:msg}',
78
			array(
79
				'msg' => (int) $_REQUEST['msg'],
80
		));
81
		if ($smcFunc['db_num_rows']($request) != 1)
82
			unset($_REQUEST['msg'], $_POST['msg'], $_GET['msg']);
83
		else
84
			list ($topic) = $smcFunc['db_fetch_row']($request);
85
		$smcFunc['db_free_result']($request);
86
	}
87
88
	// Check if it's locked. It isn't locked if no topic is specified.
89
	if (!empty($topic))