Lucie Kaffee has uploaded a new change for review. https://gerrit.wikimedia.org/r/290476
Change subject: Fix undefined index error ...................................................................... Fix undefined index error Bug: T136093 Change-Id: I72f1f634c8e339285a5e9864a2b9709b044ffd55 --- M includes/SearchHookHandler.php 1 file changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ArticlePlaceholder refs/changes/76/290476/1 diff --git a/includes/SearchHookHandler.php b/includes/SearchHookHandler.php index 453d70f..14cb36d 100644 --- a/includes/SearchHookHandler.php +++ b/includes/SearchHookHandler.php @@ -153,6 +153,10 @@ $notableEntityIds = $this->getNotableEntityIds( array_keys( $entityIdSearchResult ) ); + if ( $notableEntityIds === null ) { + return ''; + } + foreach ( $notableEntityIds as $entityId ) { $result = $this->createResult( $entityIdSearchResult[ $entityId ] ); @@ -239,7 +243,7 @@ // $json will be false if the request fails, json_decode can handle that. $data = json_decode( $json, true ); - if ( is_array( $data ) ) { + if ( is_array( $data ) && array_key_exists( 'entities', $data ) ) { return $data[ 'entities' ]; } else { return null; -- To view, visit https://gerrit.wikimedia.org/r/290476 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I72f1f634c8e339285a5e9864a2b9709b044ffd55 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ArticlePlaceholder Gerrit-Branch: master Gerrit-Owner: Lucie Kaffee <lucie.kaf...@wikimedia.de> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits