Code Duplication    Length = 9-9 lines in 3 locations

controller/acp/cat.php 1 location

@@ 976-984 (lines=9) @@
973
		{
974
			$link_ids[] = $row['link_id'];
975
976
			if ($row['link_banner'] && !preg_match('/^(http:\/\/|https:\/\/|ftp:\/\/|ftps:\/\/|www\.).+/si', $row['link_banner']))
977
			{
978
				$banner_img = $this->dir_helper->get_banner_path(basename($row['link_banner']));
979
980
				if (file_exists($banner_img))
981
				{
982
					@unlink($banner_img);
983
				}
984
			}
985
		}
986
		$this->db->sql_freeresult($result);
987

controller/acp/validation.php 1 location

@@ 355-363 (lines=9) @@
352
	{
353
		foreach ($this->links_data as $row)
354
		{
355
			if ($row['link_banner'] && !preg_match('/^(http:\/\/|https:\/\/|ftp:\/\/|ftps:\/\/|www\.).+/si', $row['link_banner']))
356
			{
357
				$banner_img = $this->dir_helper->get_banner_path(basename($row['link_banner']));
358
359
				if (file_exists($banner_img))
360
				{
361
					@unlink($banner_img);
362
				}
363
			}
364
365
			$sql = 'DELETE FROM ' . DIR_LINK_TABLE . ' WHERE link_id = ' . (int) $row['link_id'];
366
			$this->db->sql_query($sql);

core/link.php 1 location

@@ 213-221 (lines=9) @@
210
211
		while ($row = $this->db->sql_fetchrow($result))
212
		{
213
			if ($row['link_banner'] && !preg_match('/^(http:\/\/|https:\/\/|ftp:\/\/|ftps:\/\/|www\.).+/si', $row['link_banner']))
214
			{
215
				$banner_img = $this->dir_helper->get_banner_path(basename($row['link_banner']));
216
217
				if (file_exists($banner_img))
218
				{
219
					@unlink($banner_img);
220
				}
221
			}
222
		}
223
224
		foreach ($link_datas_ary as $table => $field)