Code Duplication    Length = 11-11 lines in 2 locations

code/model/SiteTreeLinkTracking.php 2 locations

@@ 294-304 (lines=11) @@
291
292
			// Link to a file on this site.
293
			$matches = array();
294
			if(preg_match('/\[file_link(?:\s*|%20|,)?id=(?<id>[0-9]+)/i', $href, $matches)) {
295
				$results[] = array(
296
					'Type' => 'file',
297
					'Target' => $matches['id'],
298
					'Anchor' => null,
299
					'DOMReference' => $link,
300
					'Broken' => !DataObject::get_by_id('File', $matches['id'])
301
				);
302
303
				continue;
304
			}
305
306
			// Local anchor.
307
			$matches = array();
@@ 308-318 (lines=11) @@
305
306
			// Local anchor.
307
			$matches = array();
308
			if(preg_match('/^#(.*)/i', $href, $matches)) {
309
				$results[] = array(
310
					'Type' => 'localanchor',
311
					'Target' => null,
312
					'Anchor' => $matches[1],
313
					'DOMReference' => $link,
314
					'Broken' => !preg_match("#(name|id)=\"{$matches[1]}\"#", $htmlValue->getContent())
315
				);
316
317
				continue;
318
			}
319
320
		}
321