Fix for missing content check where ..body->extsrc is undefined

* Bug fix for accessing undefined extsrc member variable in edge
  case. See T260082 for deeper explanation of the WT that caused a
  case where empty flag is not set and extsrc is also missing, but
  since either case including extsrc being unset indicates no
  content, this additional check is safe for now.

Bug: T259676
Change-Id: I20750c6977883668c83bdae78fbeb171f899e1ab
This commit is contained in:
sbailey 2020-08-05 11:24:03 -07:00 committed by jenkins-bot
parent 542bd7fb99
commit 5e5e360ffd

View file

@ -159,8 +159,9 @@ class References extends ExtensionTagHandler {
$errs = [];
// Check for missing content
$missingContent = ( !empty( $cDp->empty ) || trim( $refDmw->body->extsrc ) === '' );
// Check for missing content, added ?? '' to fix T259676 crasher
// FIXME: See T260082 for a more complete description of cause and deeper fix
$missingContent = ( !empty( $cDp->empty ) || trim( $refDmw->body->extsrc ?? '' ) === '' );
if ( $missingContent ) {
// Check for missing name and content to generate error code