Code Duplication    Length = 9-9 lines in 3 locations

controller/acp/cat.php 1 location

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

controller/acp/validation.php 1 location

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

core/link.php 1 location

@@ 233-241 (lines=9) @@
230
231
		while ($row = $this->db->sql_fetchrow($result))
232
		{
233
			if ($row['link_banner'] && !preg_match('/^(http:\/\/|https:\/\/|ftp:\/\/|ftps:\/\/|www\.).+/si', $row['link_banner']))
234
			{
235
				$banner_img = $this->dir_helper->get_banner_path(basename($row['link_banner']));
236
237
				if (file_exists($banner_img))
238
				{
239
					@unlink($banner_img);
240
				}
241
			}
242
		}
243
244
		foreach ($link_datas_ary as $table => $field)