Conversation
added 2 commits
July 1, 2026 19:20
| $siteNotice .= '<div class="wikitable" style="text-align: center; width: 90%; margin-left: auto; margin-right:auto; padding: 15px; border: 4px solid black; background-color: #EEE;"> <span class="plainlinks"> <img src="https://static.miraheze.org/metawiki/0/02/Wiki_lock.png" align="left" style="width:80px;height:90px;">' . $skin->msg( 'sitenotice-wiki-closed' )->parse() . '</span></div>'; | ||
| } | ||
| } elseif ( $cwConfig->get( 'Inactive' ) && $cwConfig->get( 'Inactive' ) !== 'exempt' ) { | ||
| $siteNotice .= '<div class="wikitable" style="text-align: center; width: 90%; margin-left: auto; margin-right:auto; padding: 15px; border: 4px solid black; background-color: #EEE;"> <span class="plainlinks"> <img src="https://static.miraheze.org/metawiki/5/5f/Out_of_date_clock_icon.png" align="left" style="width:80px;height:90px;">' . $skin->msg( 'wiki-sitenotice-inactive' )->parse() . '</span></div>'; |
Contributor
There was a problem hiding this comment.
Bug: The i18n message key wiki-sitenotice-inactive is incorrect and does not match the sitenotice-wiki-inactive key in the localization file, causing a broken message to be displayed.
Severity: MEDIUM
Suggested Fix
In includes/HookHandlers/Main.php, change the message key from wiki-sitenotice-inactive to sitenotice-wiki-inactive to match the key defined in the i18n/wikioasis/en.json file.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: includes/HookHandlers/Main.php#L451
Potential issue: There is a mismatch between the internationalization (i18n) message key
used in the PHP code and the key defined in the localization file. The code in
`includes/HookHandlers/Main.php` calls for the message key `wiki-sitenotice-inactive`.
However, the corresponding definition in `i18n/wikioasis/en.json` is
`sitenotice-wiki-inactive`. When a wiki is marked as 'Inactive', the message system will
fail to find the correct key and will fall back to displaying the raw key identifier
`⧼wiki-sitenotice-inactive⧽` to users instead of the intended human-readable notice.
Also affects:
i18n/wikioasis/en.json:120~120
Did we get this right? 👍 / 👎 to inform future reviews.
Zippybonzo
requested changes
Jul 1, 2026
| MessageCacheFetchOverridesHook, | ||
| MimeMagicInitHook, | ||
| SiteNoticeAfterHook, | ||
| AfterHook, |
|
|
||
| if ( $cwConfig->get( 'Closed' ) ) { | ||
| if ( $cwConfig->get( 'Private' ) ) { | ||
| $siteNotice .= '<div class="wikitable" style="text-align: center; width: 90%; margin-left: auto; margin-right:auto; padding: 15px; border: 4px solid black; background-color: #EEE;"> <span class="plainlinks"> <img src="https://static.miraheze.org/metawiki/0/02/Wiki_lock.png" align="left" style="width:80px;height:90px;">' . $skin->msg( 'sitenotice-wiki-closed-private' )->parse() . '</span></div>'; |
| }*/ | ||
| $cwConfig = new GlobalVarConfig( 'cw' ); | ||
|
|
||
| if ( $cwConfig->get( 'Closed' ) ) { |
Member
There was a problem hiding this comment.
Can we not just use a switch case here instead of some weird if elif stuff?
Author
There was a problem hiding this comment.
I don't think that's going to be possible, or at minimum easier than the current solution.
Brings in the MediaWiki CI workflow and code fixes from #10 (tab reformatting, dead-code/config cleanup, sentry dependency, etc.), carrying the dormancy sitenotice feature forward onto the reformatted Main.php and adding the missing GlobalVarConfig use import it needed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.