Allow setting anonnotice to "" to prevent fallback to sitenotice
authorKevin Israel <pleasestand@live.com>
Tue, 31 Mar 2015 17:42:32 +0000 (13:42 -0400)
committerKrinkle <krinklemail@gmail.com>
Tue, 7 Apr 2015 02:30:12 +0000 (02:30 +0000)
commit251b345151a1ce517d9f06f9bfa18d520a6c7e5a
tree321f1485b18ef3e4559b0d8b27b5df2335f7b6cb
parentd24a1bb1ef29f4cca7ebc4f2c07b204f0ad0271f
Allow setting anonnotice to "" to prevent fallback to sitenotice

Previously we only used Message::isDisabled (non-existent, empty string,
or "-") to decide whether to show a notice. If 'anonnotice' was disabled
'sitenotice' was shown instead.

When addressing logged-in users only, wikis typically use 'sitenotice'
and then put invisible content in 'anonnotice' (so that it shadows the
'sitenotice'). Now that the DismissableSiteNotice extension supports
closing of the notice for anonymous users (as of I87df3301c), this
becomes problematic as it has no way of knowing the notice was meant to
be invisible (and thus renders bogus "[close]" to all users).

This supersedes hacks such as <p></p> or <span></span>. Instead, the
empty string can now be used to have no anonnotice content, but also
don't show the 'sitenotice'.

Disabling with '-' (default) can still used to fallback to 'sitenotice'.

Also changed the code to, for consistency, allow hiding $wgSiteNotice
for all users by setting the sitenotice message to "-".

Bug: T94536
Change-Id: I11b8b883d480d0e07d8b395dd92360cb15de7c5b
RELEASE-NOTES-1.25
includes/skins/Skin.php