… including PHPDoc tags like `@return <type> $variableName`.
A return value doesn't have a variable name. I can see that
some people do this intentionally, repeating the variable
name that was used in the final `return $var;` at the end
of a method. This can indeed be helpful. I leave a lot of
these untouched and removed them only when it's obviously
wrong, or does not provide any additional information in
addition to what the code already says.
Change-Id: Ia18cd9f25ef658b08ad25b97a744897e2a8deffc
This feature was added to provide a custom error message
if the edit token was present, but trailing slashes were
stripped from it by some ASCII mangling proxy. According
to metrics this has happened 5 times last month, which
IMHO doesn't justify having special handling. Giving a
regular token mismatch error message should be good enough.
Depends-On: Ieb4f6e25a74ecaa1110c59a8d8eed3ca792f2d41
Change-Id: I85759e315581f891721dfac246daaafe956ab201
This patch adds and updates documentation. The most significant
changes are:
* getOrig() and getClosing() can return false. However, this is
only possible for add and remove operations. These have only
one side.
* The constructors of the subclasses are not meant to accept
false, and are in fact never called with false. For the same
reason. Only add and remove operations are allowed to miss
one of the two sides.
Change-Id: I9f45f34945e0297e1ea8d3e8ff9e9c53e60e7706
Inject a UserOptionsManager instead of UserOptionsLookup, and
update deprecated calls to user options methods
Bug: T277600
Bug: T277818
Change-Id: Ifdf491c3fd6b5b16246f33012f1db21f2cbc1f3e
UserEditTracker now returns null for anonymous users
instead of throwing an exception.
Added new UserEditTracker::setCachedUserEditCount()
method (internal) to handle the user_editcount field
in User::loadFromRow()'s row. This now means that
the creation of one User object can set the cached
value for any other object for the same underlying user
- the alternative (just ignoring the value) would mean
that an extra database read might be needed. This is
only used for users created with a row that includes
the user id - we silently discard the value if
the row doesn't have a user id (or the user id is 0)
to avoid issues with UserEditTracker trying to fetch
the user id and potentially triggering another load.
A follow-up will simplify the UserEditCountUpdate class
to remove storing full UserIdentity objects now that
only the id is needed.
Follow-up: Ibf1482bcbcbf4d56fc06531bb3e17e2a6e3e2e6f
Change-Id: Ie3fb4887d9f2d96b32598865030351bf3bf20ce5
As of now, an input like "[" that contains nothing but invalid
characters behaves odd: The prefixsearch API returns the entire
database, alphabetically ordered.
This behavior exists ever since this code was introduced in
Iaffe30a (2014).
While this might be used as a "feature", I really don't think it
is intentional:
* The way the code is arranged executes an SQL query with a
pointless `LIKE '%'` that doesn't do anything but possibly
wasting CPU resources. This doesn't look intentional.
* There are much better APIs when you really want to list all
pages.
* I would expect an input like "*", "%", or "" to return all
pages. But neither of these inputs does this. Only some very
strange inputs like "[" do.
* I would argue that "[" should behave the same as "", i.e. as
if no useful input is given.
* Since I877297f (2020) we normalize e.g. "[[foo]]" to "foo",
for convenience. Since then such an input works as expected,
instead of returning the entire database. This leaves titles
that contain nothing but invalid characters as the only
edge-case.
Change-Id: Ib2cbf315ed7c3736391362be6d69599c58e690db
All other debugging information (screenshots, webdriverio, mwbot) is
already removed.
Bug: T284335
Change-Id: I27eb5053c35b4d7813315f3001c07d469fe9cbd2
This undocumented hook which is only used in FlaggedRevs (and it's being
removed in If5a56a8fd5fc568) doesn't serve much purpose and can break
the file class.
Bug: T284777
Change-Id: I7ed8c01f0d0485f40307a24cc33cf3536f70c417
The original documentation was probably copied from somewhere else.
It never corresponded to what the method actually does.
Change-Id: I21491ec97cc24a36450466a090079f63402c8c1c
This can be used to replace calls like this:
$loadBalancer->getLazyConnectionRef( DB_REPLICA )
I’m not adding a corresponding getLazyWriteConnectionRef() method yet,
because I’m not sure it would make sense (you would want to write to the
database, but only later?). That said, if someone else has a use for it,
don’t let me stop you from adding it :)
Bug: T285042
Change-Id: Icdbf5a170f2ae4e0ea4ee144a801fadfda932cd3
To mirror the html-after-portlet template variable, it will
be possible for skins to define HTML before a portlet. For now
this can only be modified by skins.
Depends-On: I32586a379cbacaad5cfb361facf79c01e982818a
Change-Id: Ia64e7d4009cf303494ff455e1596286bcca811d9
setWrapperLegendMsg and setSubmitTextMsg are calling Message::text
Replacing setSubmitText + Message::text with setSubmitTextMsg makes the
code easier to read
Change-Id: I73389991fea82e1927027dc95c3debc3d8c15939
ForeignAPIFile::parseMetadata is a recursive function trying to parse the
metadata tree. We want to emit _error as value if the metadata returned
by API is not an array but at the same time, we broke when the function
reaches the leaves and tries to parse them making parseMetadata return _error
for all leaves instead.
This broke beta cluster. I tested this change on beta cluster and this
patch fixes it.
Bug: T275268
Change-Id: I2befa92a8f9619ba6eb990d461f0a6f0fa7a4677
array_fill_keys() was introduced in PHP 5.2.0 and works like
array_flip() except that it does only one thing (copying keys) instead
of two things (copying keys and values). That makes it faster and more
obvious.
When array_flip() calls were paired, I left them as is, because that
pattern is too cute. I couldn't kill something so cute.
Sometimes it was hard to figure out whether the values in array_flip()
result were used. That's the point of this change. If you use
array_fill_keys(), the intention is obvious.
Change-Id: If8d340a8bc816a15afec37e64f00106ae45e10ed
Factors out logic that's responsible for assembling data for the logout
link in a public SkinTemplate::buildLogoutLinkData function.
This function is required by the new version of the Vector skin to
reposition the logout button outside of the personal tools menu.
Bug: T281791
Change-Id: If82a736e37174aaadd0ff07019a1fae3759a9e51