Hoo man has uploaded a new change for review.
https://gerrit.wikimedia.org/r/56632
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(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase
refs/changes/32/56632/1
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/56632
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3c9fa8314df050561927daf7aa9a3503c7916b13
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Hoo man <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits