mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-09-23 10:29:11 +00:00
Add null check for str_starts_with
Only needed for phan, under php8.1 this internal function is deprecated about null. The property $subscriptionName is not null when $subscriptionTitle is not null and current code is safe, but phan cannot see the dependency between both properties Change-Id: I9e67309ec25a70c5de91d7f3e8f18447f205a4e4
This commit is contained in:
parent
893846be65
commit
3aadcace2b
|
@ -33,7 +33,9 @@ class SubscribeAction extends FormAction {
|
|||
* @inheritDoc
|
||||
*/
|
||||
protected function getPageTitle() {
|
||||
if ( $this->subscriptionTitle && !str_starts_with( $this->subscriptionName, 'p-topics-' ) ) {
|
||||
if ( $this->subscriptionTitle &&
|
||||
$this->subscriptionName !== null && !str_starts_with( $this->subscriptionName, 'p-topics-' )
|
||||
) {
|
||||
$title = $this->subscriptionTitle;
|
||||
return $this->msg( 'discussiontools-topicsubscription-action-title' )
|
||||
->plaintextParams( $title->getPrefixedText(), $title->getFragment() );
|
||||
|
|
Loading…
Reference in a new issue