mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-27 17:51:09 +00:00
Use strict comparison with array_search
Change-Id: Id920d49701bd9436a6247763ed40df052877ad2f
This commit is contained in:
parent
9482ec0841
commit
1bb29faa58
|
@ -330,7 +330,7 @@ class CommentParser {
|
|||
return preg_replace_callback(
|
||||
'/[' . implode( '', $digits ) . ']/u',
|
||||
static function ( array $m ) use ( $digits ) {
|
||||
return (string)array_search( $m[0], $digits );
|
||||
return (string)array_search( $m[0], $digits, true );
|
||||
},
|
||||
$text
|
||||
);
|
||||
|
@ -409,7 +409,8 @@ class CommentParser {
|
|||
case 'xg':
|
||||
$monthIdx = array_search(
|
||||
$text,
|
||||
$this->getMessages( $contLangVariant, Language::MONTH_GENITIVE_MESSAGES )
|
||||
$this->getMessages( $contLangVariant, Language::MONTH_GENITIVE_MESSAGES ),
|
||||
true
|
||||
);
|
||||
break;
|
||||
case 'd':
|
||||
|
@ -423,13 +424,15 @@ class CommentParser {
|
|||
case 'F':
|
||||
$monthIdx = array_search(
|
||||
$text,
|
||||
$this->getMessages( $contLangVariant, Language::MONTH_MESSAGES )
|
||||
$this->getMessages( $contLangVariant, Language::MONTH_MESSAGES ),
|
||||
true
|
||||
);
|
||||
break;
|
||||
case 'M':
|
||||
$monthIdx = array_search(
|
||||
$text,
|
||||
$this->getMessages( $contLangVariant, Language::MONTH_ABBREVIATED_MESSAGES )
|
||||
$this->getMessages( $contLangVariant, Language::MONTH_ABBREVIATED_MESSAGES ),
|
||||
true
|
||||
);
|
||||
break;
|
||||
case 'm':
|
||||
|
|
|
@ -188,7 +188,7 @@ class HookUtils {
|
|||
$extensionRegistry = ExtensionRegistry::getInstance();
|
||||
if ( $extensionRegistry->isLoaded( 'Gadgets' ) ) {
|
||||
$gadgetsRepo = GadgetRepo::singleton();
|
||||
$match = array_search( $gadgetName, $gadgetsRepo->getGadgetIds() );
|
||||
$match = array_search( $gadgetName, $gadgetsRepo->getGadgetIds(), true );
|
||||
if ( $match !== false ) {
|
||||
try {
|
||||
return $gadgetsRepo->getGadget( $gadgetName )
|
||||
|
|
Loading…
Reference in a new issue