jenkins-bot has submitted this change and it was merged.
Change subject: Don't pass empty message text to strpos
......................................................................
Don't pass empty message text to strpos
Bug: T97050
Change-Id: I2cb6ddb306ca1b0029fc452b7caf0587246b4fb5
(cherry picked from commit 6b5a381dd4accb38cfa0ac7d8a8a4254d83a4a68)
---
M includes/skins/SkinMinerva.php
1 file changed, 7 insertions(+), 1 deletion(-)
Approvals:
Robmoen: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php
index 705250e..ce5b576 100644
--- a/includes/skins/SkinMinerva.php
+++ b/includes/skins/SkinMinerva.php
@@ -1166,7 +1166,13 @@
// for plural support we need the info, if there is one or more
licenses used in the license text
// this check if very simple and works on the base, that more
than one license will
// use "and" as a connective
- $isPlural = ( strpos( $rightsText, wfMessage( 'and' )->text() )
=== false ? 1 : 2 );
+ // 1 - no plural
+ // 2 - plural
+ $delimiterMsg = wfMessage( 'and' );
+ // check, if "and" isn't disabled and exists in site language
+ $isPlural = (
+ !$delimiterMsg->isDisabled() && strpos( $rightsText,
$delimiterMsg->text() ) === false ? 1 : 2
+ );
return array(
'link' => $link,
--
To view, visit https://gerrit.wikimedia.org/r/206194
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I2cb6ddb306ca1b0029fc452b7caf0587246b4fb5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: wmf/1.26wmf2
Gerrit-Owner: Florianschmidtwelzow <[email protected]>
Gerrit-Reviewer: Robmoen <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits