Code Duplication    Length = 8-10 lines in 2 locations

other/upgrade.php 2 locations

@@ 833-842 (lines=10) @@
830
		return false;
831
832
	// Check agreement.txt. (it may not exist, in which case $boarddir must be writable.)
833
	if (isset($modSettings['agreement']) && (!is_writable($boarddir) || file_exists($boarddir . '/agreement.txt')) && !is_writable($boarddir . '/agreement.txt'))
834
		return throw_error('The upgrader was unable to obtain write access to agreement.txt.<br><br>If you are using a linux or unix based server, please ensure that the file is chmod\'d to 777, or if it does not exist that the directory this upgrader is in is 777.<br>If your server is running Windows, please ensure that the internet guest account has the proper permissions on it or its folder.');
835
836
	// Upgrade the agreement.
837
	elseif (isset($modSettings['agreement']))
838
	{
839
		$fp = fopen($boarddir . '/agreement.txt', 'w');
840
		fwrite($fp, $modSettings['agreement']);
841
		fclose($fp);
842
	}
843
844
	// We're going to check that their board dir setting is right in case they've been moving stuff around.
845
	if (strtr($boarddir, array('/' => '', '\\' => '')) != strtr(dirname(__FILE__), array('/' => '', '\\' => '')))
@@ 2530-2537 (lines=8) @@
2527
	if (!is_writable($boarddir . '/Settings_bak.php'))
2528
		print_error('Error: Unable to obtain write access to "Settings_bak.php".');
2529
2530
	if (isset($modSettings['agreement']) && (!is_writable($boarddir) || file_exists($boarddir . '/agreement.txt')) && !is_writable($boarddir . '/agreement.txt'))
2531
		print_error('Error: Unable to obtain write access to "agreement.txt".');
2532
	elseif (isset($modSettings['agreement']))
2533
	{
2534
		$fp = fopen($boarddir . '/agreement.txt', 'w');
2535
		fwrite($fp, $modSettings['agreement']);
2536
		fclose($fp);
2537
	}
2538
2539
	// Make sure Themes is writable.
2540
	quickFileWritable($modSettings['theme_dir']);