Code Duplication    Length = 16-16 lines in 2 locations

factory/ideas.php 2 locations

@@ 426-441 (lines=16) @@
423
	 *
424
	 * @return bool True if set, false if invalid.
425
	 */
426
	public function set_rfc($idea_id, $rfc)
427
	{
428
		$match = '/^https?:\/\/area51\.phpbb\.com\/phpBB\/viewtopic\.php/';
429
		if ($rfc && !preg_match($match, $rfc))
430
		{
431
			return false;
432
		}
433
434
		$sql_ary = array(
435
			'rfc_link'	=> $rfc, // string is escaped by build_array()
436
		);
437
438
		$this->update_idea_data($sql_ary, $idea_id, $this->table_ideas);
439
440
		return true;
441
	}
442
443
	/**
444
	 * Sets the ticket ID of an idea.
@@ 475-490 (lines=16) @@
472
	 *
473
	 * @return bool True if set, false if invalid.
474
	 */
475
	public function set_implemented($idea_id, $version)
476
	{
477
		$match = '/^\d\.\d\.\d+(\-\w+)?$/';
478
		if ($version && !preg_match($match, $version))
479
		{
480
			return false;
481
		}
482
483
		$sql_ary = array(
484
			'implemented_version'	=> $version, // string is escaped by build_array()
485
		);
486
487
		$this->update_idea_data($sql_ary, $idea_id, $this->table_ideas);
488
489
		return true;
490
	}
491
492
	/**
493
	 * Sets the title of an idea.