Brian Wolff has uploaded a new change for review. https://gerrit.wikimedia.org/r/274013
Change subject: Revert "Add type hint against LinkTarget" ...................................................................... Revert "Add type hint against LinkTarget" Can cause fatal if your database has invalid titles stored in it (Title::makeTitleSafe is fed to $lb->addObj() without checking that the result is non-null) This reverts commit 0e5a1f8879b211b44416e3762bf2d76c28f3f569. Change-Id: I4174b2fdcc3d8e24ecf0bcc39cd0f0f2e8bfd6b2 --- M includes/cache/LinkBatch.php 1 file changed, 6 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/13/274013/1 diff --git a/includes/cache/LinkBatch.php b/includes/cache/LinkBatch.php index 987aa71..8f334cc 100644 --- a/includes/cache/LinkBatch.php +++ b/includes/cache/LinkBatch.php @@ -58,8 +58,12 @@ /** * @param LinkTarget $linkTarget */ - public function addObj( LinkTarget $linkTarget ) { - $this->add( $linkTarget->getNamespace(), $linkTarget->getDBkey() ); + public function addObj( $linkTarget ) { + if ( is_object( $linkTarget ) ) { + $this->add( $linkTarget->getNamespace(), $linkTarget->getDBkey() ); + } else { + wfDebug( "Warning: LinkBatch::addObj got invalid LinkTarget object\n" ); + } } /** -- To view, visit https://gerrit.wikimedia.org/r/274013 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4174b2fdcc3d8e24ecf0bcc39cd0f0f2e8bfd6b2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Brian Wolff <bawolff...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits