Code Duplication    Length = 8-10 lines in 2 locations

other/upgrade.php 2 locations

@@ 714-723 (lines=10) @@
711
		return false;
712
713
	// Check agreement.txt. (it may not exist, in which case $boarddir must be writable.)
714
	if (isset($modSettings['agreement']) && (!is_writable($boarddir) || file_exists($boarddir . '/agreement.txt')) && !is_writable($boarddir . '/agreement.txt'))
715
		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.');
716
717
	// Upgrade the agreement.
718
	elseif (isset($modSettings['agreement']))
719
	{
720
		$fp = fopen($boarddir . '/agreement.txt', 'w');
721
		fwrite($fp, $modSettings['agreement']);
722
		fclose($fp);
723
	}
724
725
	// We're going to check that their board dir setting is right in case they've been moving stuff around.
726
	if (strtr($boarddir, array('/' => '', '\\' => '')) != strtr(dirname(__FILE__), array('/' => '', '\\' => '')))
@@ 2395-2402 (lines=8) @@
2392
	if (!is_writable($boarddir . '/db_last_error.php'))
2393
		print_error('Error: Unable to obtain write access to "db_last_error.php".');
2394
2395
	if (isset($modSettings['agreement']) && (!is_writable($boarddir) || file_exists($boarddir . '/agreement.txt')) && !is_writable($boarddir . '/agreement.txt'))
2396
		print_error('Error: Unable to obtain write access to "agreement.txt".');
2397
	elseif (isset($modSettings['agreement']))
2398
	{
2399
		$fp = fopen($boarddir . '/agreement.txt', 'w');
2400
		fwrite($fp, $modSettings['agreement']);
2401
		fclose($fp);
2402
	}
2403
2404
	// Make sure Themes is writable.
2405
	quickFileWritable($modSettings['theme_dir']);