mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
bcbeb6d626
Currently, the SiteTreeLinkTracking_Parser only checks the page's content for anchors. As a result, any anchors that have been added or modified by the updateAnchorsOnPage extension in the getAnchorsOnPage method are marked ss-broken. This change updates SiteTreeLinkTracking_Parser to get the anchors from the getAnchorsOnPage function on SiteTree. This will allow for more consistent RegEx matching and allow the updateAnchorsOnPage extension to be used when checking for broken links.
19 lines
380 B
PHP
19 lines
380 B
PHP
<?php
|
|
|
|
namespace SilverStripe\CMS\Tests\Model;
|
|
|
|
use SilverStripe\Dev\TestOnly;
|
|
use SilverStripe\ORM\DataExtension;
|
|
|
|
class SiteTreeLinkTracking_Extension extends DataExtension implements TestOnly
|
|
{
|
|
public function updateAnchorsOnPage(&$anchors)
|
|
{
|
|
array_push(
|
|
$anchors,
|
|
'extension-anchor',
|
|
'extension-anchor-1'
|
|
);
|
|
}
|
|
}
|