Uses new PHP 5.6 syntax like ...parameter unpacking and
calling anything looking like a callback to make the code more readable.
There are much more occurrences but this commit is intentionally limited
to an easily reviewable size.
In one occurrence, a simple conditional instead of trickery was much more readable.
This patch finishes all the easy stuf in the core, the remainder is either unobvious
or would result in smaller readability gains. It will be carefully dealt with in
further commits.
Change-Id: I79a16c48bfb98b75e5b99f2f6f4fa07b3ae02c5b
Special:Block needs a date time selector for easier selection of expiry. To
accommodate this cleanly, a new Expiry Widget is created that handles this
logic.
Bug: T132220
Change-Id: I2853a2ca0ae6ccead3978f4bb50a77c2baa3a150
This updates the deletion forms, Special:Block, Special:EditTags,
Special:MovePage, Special:RevisionDelete, Special:Undelete, and
Special:UserRights to limit by code point count rather than by byte (or,
in some cases, by UTF-16 code unit).
Bug: T185948
Change-Id: I20d11d7cc4f58902cbcb6dda70af533bce6dd170
* Expand both the dropdown and textfield of "Reason" field to the
usual maximum width and display them on separate lines.
* Fix autohiding of form fields where applicable (checkboxes that only
apply when blocking a user or an IP address).
* Fix bolding of the "Confirm block" label when blocking yourself.
Follow-up to d56758e134.
Bug: T107036
Change-Id: Ia5c54e518de99a79f5319c42ccf1a9a0e31ad471
* Remove additional wrapper, and the 'blockip-legend' message.
* Replace autocompletion using 'mediawiki.userSuggest' with OOUI,
by using 'type' => 'user' for the username field
Bug: T107036
Change-Id: Ib8f7e03388073450ecff28ad2c0d3f9161f259d8
Since the caller doesn't (and shouldn't) know whether CommentStore is
using the old or the new schema, it should leave truncation of comments
to CommentStore.
Change-Id: I92954c922514271d774518d6a6c28a01f33c88c2
It's unreasonable to expect newbies to know that "bug 12345" means "Task T14345"
except where it doesn't, so let's just standardise on the real numbers.
Change-Id: Ic878feaea72893a1c47ea79ac284e581209e1731
Currently, a PHP error is thrown when tags are not set
in Special:Block on line 832. This patch fixes this
by adding an extra isset() check to see if the tags
variable is set.
Bug: T156486
Change-Id: Ib8722bffbcac5953263ded41eceb3d389d0932f0
See the task, this was probably entirely my fault not having
looked at this more carefully. Technically the change is ok,
however, it seems to doesn't make much sense in combination
with the Reason dropdown box.
This reverts commit faab2411c2.
Task: T34950
Change-Id: I1eeb9c68ff0db20d29e7d5f0fb18f0bfa3224416
Adds support for tagging log entries for the block, import,
managetags, and move API modules, using a 'tags' parameter.
Bug: T97720
Change-Id: I9d75d2cece317a7704c4bc6d734ad3cafe24544e
This also removes assumptions that when a page
in one Namespace should be watched / removed
that the page in the talk / subject ns for the
page should have the same action applied
This should maintain all backward compatability
for the WatchedItem class
This also includes tests written by:
- WMDE-leszek
- Addshore
Bug: T127956
Change-Id: Iad9abafe4417bb479151a3bfbee6e1c78a3afe3c
Like the protect action, adding a block with an expiry time in the
past doesn't make any sense and should throw an error message, instead of
creating a useless block.
Bug: T123069
Change-Id: Ib168ace80ada248f0209af896ab8b8ecfac3ef29
The autocomplete search allows special pages to define the list of
subpages to be excepted. Use user names on the following special pages,
because these special pages can be called with a user name as subpage.
Special:Block
Special:Contributions
Special:DeletedContributions
Special:Emailuser
Special:Listfiles
Special:Unblock
Special:Userrights
This makes it easier to navigate to this special pages with a prefilled
user name field.
Hidden user names are always not shown, because the suggestion is cached
between priviliged user and non-priviliged user.
Change-Id: I7db575bf66caaa5136489ed99f1655673b55adaf
Moved the style of convenience links for special pages to the
mediawiki.special module to keep it out of shared.css
Change-Id: I57ba598c48f8c1ea4bca978b6bf83d157d9dad1c
We can just use onSubmit() instead of our own custom stuff.
The comment stating that we can't is wrong; perhaps it used
to be correct, back when it was written.
Change-Id: Ib18fb7292a67b471e9ad13cf38038287b9bd2bd2
The title used for Linker::link in all places are mediawiki pages, which
are known to be exists (and blue), because there are definied in en.json
Change-Id: Ib3b6e4f4f6cef059a502aaabfcfc17730b4445a6
Some special pages or actions have a link for users with editinterface
rights to edit the message used in scroll down menu.
When the message is parsed for the scroll down menu the config
$wgForceUIMsgAsContentMsg is used, but that was not used for the edit
link.
Add a new function Message::getTitle and use it in all places in core.
Most benefit will have the edit link for MediaWiki:Licenses on
Special:Upload, because commons.wikimedia.org has that message in
$wgForceUIMsgAsContentMsg.
Change-Id: Ib800b9adcc9ae88ef53228b66838bf61d2065f0f
Method similar to SpecialPage::outputHeader() to avoid registering
tons of system messages and to have -summary and -helppage tidily
listed together in Special:AllMessages by default.
Bug: T45591
Change-Id: Ic849dde00be7379c1909a8486cf20f48c5aea5cf
There's a bunch of stuff that probably only works because the database
representation of infinity is actually 'infinity' on all databases
besides Oracle, and Oracle in general isn't maintained.
Generally, we should probably use 'infinity' everywhere except where
directly dealing with the database.
* Many extension callers of Language::formatExpiry() with $format !==
true are assuming it'll return 'infinity', none are checking for
$db->getInfinity().
* And Language::formatExpiry() would choke if passed 'infinity', despite
callers doing this.
* And Language::formatExpiry() could be more useful for the API if we
can override the string returned for infinity.
* As for core, Title is using Language::formatExpiry() with TS_MW which
is going to be changing anyway. Extension callers mostly don't exist.
* Block already normalizes its mExpiry field (and ->getExpiry()),
but some stuff is comparing it with $db->getInfinity() anyway. A few
external users set mExpiry to $db->getInfinity(), but this is mostly
because SpecialBlock::parseExpiryInput() returns $db->getInfinity()
while most callers (including all extensions) are assuming 'infinity'.
* And for that matter, Block should use $db->decodeExpiry() instead of
manually doing it, once we make that safe to call with 'infinity' for
all the extensions passing $db->getInfinity() to Block's contructor.
* WikiPage::doUpdateRestrictions() and some of its callers are using
$db->getInfinity(), when all the inserts using that value are using
$db->encodeExpiry() which will convert 'infinity'.
This also cleans up a slave-lag issue I noticed in ApiBlock while
testing.
Bug: T92550
Change-Id: I5eb68c1fb6029da8289276ecf7c81330575029ef
Refactor out 'infinity' vartiant values which used in blocking and
protecting actions. This patchset adds GlobalFunction wfIsInfinity.
Bug: T68646
Change-Id: I60cc55a5bbd43c72916a1c2ea3807457d4e33765
All the chosen targets are translatable public domain help pages
on MediaWiki.org. Mostly special pages and actions for privileged
users for now.
Adapted from the Translate extension, credit to Niklas Laxström
(TranslateUtils::addSpecialHelpLink).
Depends on 6f5b29ff4e, whose commit
message has a typo addIndicator() instead of setIndicator().
Bug: T45591
Change-Id: I2934b1708a0d207dcf3d940264f140613646f203
Now, Special:Block/Some_User and Special:Block/No_Such_User act the
same. So show warning when user opened 'Special:Block/No_such_user'
page.
Bug: T37687
Change-Id: I60292e1016b64224a6146add58106c9028e7914c
This allows use of gender on Special:Log.
Old messages are kept for use in IRC.
A test was added to ensure an unchanged IRC message.
Bug: T57402
Change-Id: Ibc7fcaa5a952ff90d42a6477da4baa429f3de64b
One call in core already called it non-static
Avoid:
[GlobalTitleFail] MessageCache::parse called by
Message::toString/Message::parseText/MessageCache::parse with no title
set
Change-Id: Ic91e715177c0a4578825640a31ec68ecba3176e0
This function is used in two extensions, which also pass it to
HtmlForm, so no underescaping there either.
Change-Id: I93325051b3a6ef8fc242437a736b5c84bda56b7d
A reason on a SelectAndOtherField can have two parts, one of the scroll
down box and a free text field. The free text field is actually
unlimited.
This patch allows the maxlength on that field. To respect the concat of
the two parts, also javascript code is added, which adds a dynamic
maxlength to respect also the text from the scroll down box.
The HTMLSelectAndOtherField is only used on Special:Block,
where the maxlength attribute is now set to 255 (length of the database
field ipb_reason).
Change-Id: I5c164b41ab047e7ecf9d92db6eddcc980e2db048
This applies to Special:BlockList, or to the block message shown to the
user, or API results. Log is not effected, because it already truncates
on its own.
Change-Id: I0a8bae5f43fd1604034d65e96c9461a9f83c0b0a
- Swap "$variable type" to "type $variable"
- Added missing types
- Fixed spacing inside docs
- Makes beginning of @param/@return/@var/@throws in capital
- Changed some types to match the more common spelling
Change-Id: Ie419638e909a47aa72a274043604247830ee1a81
There is a autofocus on the Target field, which sets the start of
tabbing and than all the other fields are tabbed in the correct native
order. No need for extra tabindex order.
Tested with IE11 and FF28
Bug: 61257
Change-Id: Ic0d7365447733a23fa87c1d9b91c0f4f0f61bb39