mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-24 08:23:52 +00:00
Fix exception when trying to use non-existent 'typeof' attribute
Bug: T272090 Change-Id: I4d1e7457441f28d789dec8b7fd2dc3ba10fd995e
This commit is contained in:
parent
c42e86f0f6
commit
c20e7765ea
|
@ -52,7 +52,7 @@ class CommentUtils {
|
|||
// Empty inline templates, e.g. tracking templates
|
||||
(
|
||||
strtolower( $node->tagName ) === 'span' &&
|
||||
in_array( 'mw:Transclusion', explode( ' ', $node->getAttribute( 'typeof' ) ) ) &&
|
||||
in_array( 'mw:Transclusion', explode( ' ', $node->getAttribute( 'typeof' ) ?? '' ) ) &&
|
||||
!self::htmlTrim( DOMCompat::getInnerHTML( $node ) )
|
||||
)
|
||||
)
|
||||
|
|
|
@ -28,7 +28,7 @@ function isRenderingTransparentNode( node ) {
|
|||
// Empty inline templates, e.g. tracking templates
|
||||
(
|
||||
node.tagName.toLowerCase() === 'span' &&
|
||||
node.getAttribute( 'typeof' ).split( ' ' ).indexOf( 'mw:Transclusion' ) !== -1 &&
|
||||
( node.getAttribute( 'typeof' ) || '' ).split( ' ' ).indexOf( 'mw:Transclusion' ) !== -1 &&
|
||||
// eslint-disable-next-line no-use-before-define
|
||||
!htmlTrim( node.innerHTML )
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue