jenkins-bot has submitted this change and it was merged. Change subject: Don't be too strict when resolving the DB data ......................................................................
Don't be too strict when resolving the DB data We could just use makeTitle() since the data is coming from the database, we can assume it's valid title WikiReference::fromStorageRow() was using MakeTitleSafe. If for some reason some invalid title made it in, this would case PHP errors (constructing WikiReference object a couple lines down typehints for Title objects but would receive null). So switch to MakeTitle(). Bug: 65802 Change-Id: I3878c653b7b04857c16ec278aed2d7345f999720 --- M includes/Model/Reference.php 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: Matthias Mullie: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/Model/Reference.php b/includes/Model/Reference.php index 68d6e27..daa8dd7 100644 --- a/includes/Model/Reference.php +++ b/includes/Model/Reference.php @@ -156,8 +156,8 @@ $workflow = UUID::create( $row['ref_src_workflow_id'] ); $objectType = $row['ref_src_object_type']; $objectId = UUID::create( $row['ref_src_object_id'] ); - $srcTitle = Title::makeTitleSafe( $row['ref_src_namespace'], $row['ref_src_title'] ); - $targetTitle = Title::makeTitleSafe( $row['ref_target_namespace'], $row['ref_target_title'] ); + $srcTitle = Title::makeTitle( $row['ref_src_namespace'], $row['ref_src_title'] ); + $targetTitle = Title::makeTitle( $row['ref_target_namespace'], $row['ref_target_title'] ); $type = $row['ref_type']; return new WikiReference( $workflow, $srcTitle, $objectType, $objectId, $type, $targetTitle ); @@ -238,7 +238,7 @@ $objectId = UUID::create( $row['ref_src_object_id'] ); $url = $row['ref_target']; $type = $row['ref_type']; - $srcTitle = Title::makeTitleSafe( $row['ref_src_namespace'], $row['ref_src_title'] ); + $srcTitle = Title::makeTitle( $row['ref_src_namespace'], $row['ref_src_title'] ); return new URLReference( $workflow, $srcTitle, $objectType, $objectId, $type, $url ); } -- To view, visit https://gerrit.wikimedia.org/r/135572 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3878c653b7b04857c16ec278aed2d7345f999720 Gerrit-PatchSet: 7 Gerrit-Project: mediawiki/extensions/Flow Gerrit-Branch: master Gerrit-Owner: Matthias Mullie <mmul...@wikimedia.org> Gerrit-Reviewer: Bsitu <bs...@wikimedia.org> Gerrit-Reviewer: Jdlrobson <jrob...@wikimedia.org> Gerrit-Reviewer: Matthias Mullie <mmul...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits