Code Duplication    Length = 8-10 lines in 2 locations

other/upgrade.php 2 locations

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