From 5e5e360ffd7aa4f57eff84d7ba5dea144fef963e Mon Sep 17 00:00:00 2001 From: sbailey Date: Wed, 5 Aug 2020 11:24:03 -0700 Subject: [PATCH] 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 --- src/Parsoid/References.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Parsoid/References.php b/src/Parsoid/References.php index 432069441..4cca6f17e 100644 --- a/src/Parsoid/References.php +++ b/src/Parsoid/References.php @@ -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