Code Duplication    Length = 16-16 lines in 2 locations

factory/idea.php 2 locations

@@ 119-134 (lines=16) @@
116
	 *
117
	 * @return bool True if set, false if invalid.
118
	 */
119
	public function set_rfc($idea_id, $rfc)
120
	{
121
		$match = '/^https?:\/\/area51\.phpbb\.com\/phpBB\/viewtopic\.php/';
122
		if ($rfc && !preg_match($match, $rfc))
123
		{
124
			return false;
125
		}
126
127
		$sql_ary = array(
128
			'rfc_link'	=> $rfc, // string is escaped by build_array()
129
		);
130
131
		$this->update_idea_data($sql_ary, $idea_id, $this->table_ideas);
132
133
		return true;
134
	}
135
136
	/**
137
	 * Sets the ticket ID of an idea.
@@ 168-183 (lines=16) @@
165
	 *
166
	 * @return bool True if set, false if invalid.
167
	 */
168
	public function set_implemented($idea_id, $version)
169
	{
170
		$match = '/^\d\.\d\.\d+(\-\w+)?$/';
171
		if ($version && !preg_match($match, $version))
172
		{
173
			return false;
174
		}
175
176
		$sql_ary = array(
177
			'implemented_version'	=> $version, // string is escaped by build_array()
178
		);
179
180
		$this->update_idea_data($sql_ary, $idea_id, $this->table_ideas);
181
182
		return true;
183
	}
184
185
	/**
186
	 * Sets the title of an idea.