Code Duplication    Length = 16-16 lines in 2 locations

Sources/Packages.php 2 locations

@@ 272-287 (lines=16) @@
269
			if ($id != 1 && !in_array($id, $old_themes))
270
				unset($theme_paths[$id]);
271
	}
272
	elseif (isset($old_version) && $old_version != $packageInfo['version'])
273
	{
274
		// Look for an upgrade...
275
		$actions = parsePackageInfo($packageInfo['xml'], true, 'upgrade', $old_version);
276
277
		// There was no upgrade....
278
		if (empty($actions))
279
			$context['is_installed'] = true;
280
		else
281
		{
282
			// Otherwise they can only upgrade themes from the first time around.
283
			foreach ($theme_paths as $id => $data)
284
				if ($id != 1 && !in_array($id, $old_themes))
285
					unset($theme_paths[$id]);
286
		}
287
	}
288
	elseif (isset($old_version) && $old_version == $packageInfo['version'])
289
		$context['is_installed'] = true;
290
@@ 949-964 (lines=16) @@
946
			if ($id != 1 && !in_array($id, $old_themes))
947
				unset($theme_paths[$id]);
948
	}
949
	elseif (isset($old_version) && $old_version != $packageInfo['version'])
950
	{
951
		// Look for an upgrade...
952
		$install_log = parsePackageInfo($packageInfo['xml'], false, 'upgrade', $old_version);
953
954
		// There was no upgrade....
955
		if (empty($install_log))
956
			$context['is_installed'] = true;
957
		else
958
		{
959
			// Upgrade previous themes only!
960
			foreach ($theme_paths as $id => $data)
961
				if ($id != 1 && !in_array($id, $old_themes))
962
					unset($theme_paths[$id]);
963
		}
964
	}
965
	elseif (isset($old_version) && $old_version == $packageInfo['version'])
966
		$context['is_installed'] = true;
967