Code Duplication    Length = 8-10 lines in 2 locations

other/upgrade.php 2 locations

@@ 826-835 (lines=10) @@
823
		return false;
824
825
	// Check agreement.txt. (it may not exist, in which case $boarddir must be writable.)
826
	if (isset($modSettings['agreement']) && (!is_writable($boarddir) || file_exists($boarddir . '/agreement.txt')) && !is_writable($boarddir . '/agreement.txt'))
827
		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.');
828
829
	// Upgrade the agreement.
830
	elseif (isset($modSettings['agreement']))
831
	{
832
		$fp = fopen($boarddir . '/agreement.txt', 'w');
833
		fwrite($fp, $modSettings['agreement']);
834
		fclose($fp);
835
	}
836
837
	// We're going to check that their board dir setting is right in case they've been moving stuff around.
838
	if (strtr($boarddir, array('/' => '', '\\' => '')) != strtr(dirname(__FILE__), array('/' => '', '\\' => '')))
@@ 2523-2530 (lines=8) @@
2520
	if (!is_writable($boarddir . '/Settings_bak.php'))
2521
		print_error('Error: Unable to obtain write access to "Settings_bak.php".');
2522
2523
	if (isset($modSettings['agreement']) && (!is_writable($boarddir) || file_exists($boarddir . '/agreement.txt')) && !is_writable($boarddir . '/agreement.txt'))
2524
		print_error('Error: Unable to obtain write access to "agreement.txt".');
2525
	elseif (isset($modSettings['agreement']))
2526
	{
2527
		$fp = fopen($boarddir . '/agreement.txt', 'w');
2528
		fwrite($fp, $modSettings['agreement']);
2529
		fclose($fp);
2530
	}
2531
2532
	// Make sure Themes is writable.
2533
	quickFileWritable($modSettings['theme_dir']);