+ $links = [];
+ // if the page is editable, add an edit link
+ if (
+ // check user permissions
+ $this->getUser()->isAllowed( 'edit' ) &&
+ // check, if the content model is editable through action=edit
+ ContentHandler::getForTitle( $fromObj )->supportsDirectEditing()
+ ) {
+ $links[] = Linker::linkKnown(
+ $fromObj,
+ $this->msg( 'brokenredirects-edit' )->escaped(),
+ [],
+ [ 'action' => 'edit' ]
+ );
+ }