HomePhorge

Message: Improve validation for fallback keys

This commit no longer exists in the repository. It may have been part of a branch which was deleted.

Description

Message: Improve validation for fallback keys

It's an easy mistake to write:

$msgSpec = [ $key, $param1, $param2 ];
wfMessage( $msgSpec );                    // WRONG

instead of

wfMessage( ...$msgSpec );                 // correct
Message::newFromSpecifier( $msgSpec );    // correct

If you use the wrong form, your intended message parameters are used
as fallback message keys, and usually ignored (assuming your intended
message key exists).

It's not possible to catch this mistake in all cases, since it's all
arrays of strings most of the time. But we can try.

Change-Id: I0b40ad90a352dc640e64090cac4224219752dc01

Details

Provenance
Bartosz DziewońskiAuthored on Aug 16 2024, 7:14 PM

Event Timeline

Bartosz Dziewoński <dziewonski@fastmail.fm> committed rMW9c5d5d595dec: Message: Improve validation for fallback keys (authored by Bartosz Dziewoński <dziewonski@fastmail.fm>).Aug 16 2024, 9:42 PM

Commit No Longer Exists

This commit no longer exists in the repository.