mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
ENHANCEMENT Ensure that broken File links receive an "ss-broken" class, just like broken SiteTree links
This commit is contained in:
parent
898c8f5497
commit
f5c4bc0802
@ -69,8 +69,15 @@ class HtmlEditorField extends TextareaField {
|
||||
$link->setAttribute('class', ($class ? "$class ss-broken" : 'ss-broken'));
|
||||
}
|
||||
}
|
||||
|
||||
if(preg_match('/\[file_link id=([0-9]+)\]/i', $link->getAttribute('href'), $matches)) {
|
||||
if(!DataObject::get_by_id('File', $matches[1])) {
|
||||
$class = $link->getAttribute('class');
|
||||
$link->setAttribute('class', ($class ? "$class ss-broken" : 'ss-broken'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $this->createTag (
|
||||
'textarea',
|
||||
$this->getAttributes(),
|
||||
|
Loading…
Reference in New Issue
Block a user