Aude has submitted this change and it was merged.

Change subject: Handle invalid entity IDs in SetReference::getEntityContent
......................................................................


Handle invalid entity IDs in SetReference::getEntityContent

Bug: 46701
Change-Id: I3c9fa8314df050561927daf7aa9a3503c7916b13
---
M repo/includes/api/SetReference.php
1 file changed, 5 insertions(+), 0 deletions(-)

Approvals:
  Aude: Verified; Looks good to me, approved
  jenkins-bot: Checked



diff --git a/repo/includes/api/SetReference.php 
b/repo/includes/api/SetReference.php
index f13bb25..37af48d 100644
--- a/repo/includes/api/SetReference.php
+++ b/repo/includes/api/SetReference.php
@@ -82,6 +82,11 @@
                $params = $this->extractRequestParams();
 
                $entityId = EntityId::newFromPrefixedId( 
Entity::getIdFromClaimGuid( $params['statement'] ) );
+
+               if ( $entityId === null ) {
+                       $this->dieUsage( 'No such entity', 
'setreference-entity-not-found' );
+               }
+
                $entityTitle = 
EntityContentFactory::singleton()->getTitleForId( $entityId );
 
                if ( $entityTitle === null ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/56699
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I3c9fa8314df050561927daf7aa9a3503c7916b13
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: mw1.21-wmf12b
Gerrit-Owner: Aude <[email protected]>
Gerrit-Reviewer: Aude <[email protected]>
Gerrit-Reviewer: Hoo man <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to