Code Duplication    Length = 11-13 lines in 2 locations

other/upgrade.php 1 location

@@ 5301-5311 (lines=11) @@
5298
		$cachedir = $boarddir . '/cache';
5299
5300
	$test_fp = @fopen($cachedir . '/settings_update.tmp', "w+");
5301
	if ($test_fp)
5302
	{
5303
		fclose($test_fp);
5304
		$written_bytes = file_put_contents($cachedir . '/settings_update.tmp', 'test', LOCK_EX);
5305
		@unlink($cachedir . '/settings_update.tmp');
5306
5307
		// Oops. Low disk space, perhaps. Don't mess with Settings.php then.
5308
		// No means no. :P
5309
		if ($written_bytes !== 4)
5310
			return throw_error('The upgrader could not write a test file, perhaps not enough storage?  Unable to migrate your Settings file to a new version.');
5311
	}
5312
5313
	// Protect me from what I want! :P
5314
	clearstatcache();

Sources/Subs-Admin.php 1 location

@@ 390-402 (lines=13) @@
387
		$cachedir = $boarddir . '/cache';
388
389
	$test_fp = @fopen($cachedir . '/settings_update.tmp', "w+");
390
	if ($test_fp)
391
	{
392
		fclose($test_fp);
393
		$written_bytes = file_put_contents($cachedir . '/settings_update.tmp', 'test', LOCK_EX);
394
		@unlink($cachedir . '/settings_update.tmp');
395
396
		if ($written_bytes !== 4)
397
		{
398
			// Oops. Low disk space, perhaps. Don't mess with Settings.php then.
399
			// No means no. :P
400
			return;
401
		}
402
	}
403
404
	// Protect me from what I want! :P
405
	clearstatcache();