Interface:
* Restore sitename as part of error page document title
(follows-up 4ca9805). Moved to general Exception class as it
is useful in general, this effectively changes the title from
"This wiki has a problem" to "Internal error - Wikipedia".
* Added basic <style> to have it use a sans-serif font and a bit
padding to offset it from the edge of the window.
* Output stacktrace in <pre> as-is (with linebreaks) instead of
in a <p> with <br/>.
Clean up:
* Removed spurious "<!-- SiteSearch Google -->" comment.
* Change sitesearch radio button to not need the id/for
attributes but simply nest them. Visual rendering and browser
behaviour is identical.
* Renamed $text to $html since that is what it is (follows-up
4ca9805 which reused that variable for html, it used to contain
text).
* Remove odd linebreak from "dberr-problems" message, it was
being output as-is in the html (html escaped, of course) and
line breaks have no meaning inside an <h1> tag. Using a simple
space instead. Visual rendering is identical.
Coding style:
* Using <!DOCTYPE html> instead of <!doctype html> for consistency
with other documents we output.
* Switched a few inline #-style comments to use // instead.
* Switched a few strings from double quotes to single quotes in
areas close to the changed code.
Change-Id: I33232d871200cbd23501c9a6c5f8a178931e135e
Part of the point of this, is to add a hook to allow extensions to add
their own metadata (I intend to create a companion extension to parse
Commons description pages - I5e6bc45f9751)
It's hoped that this would provide a simple system to get file metadata,
and would be able to return information on any wiki (even without any
extensions installed to provide additional information). So it could
fallback to exif data, if there's no better source of information for
the file available. It's also meant to be done in such a way that, in
the future, when Wikibase is deployed on Commons, it could be integrated
without too much fuss.
marktraceur changed this patch to be a little less heavy-handed: it will
now return unformatted data by default from the API, but there's also a
method for formatting that data in the way that bawolff originally
intended. I'm still trying to figure out if there's much use in that
method, but for now it's not particularly useful.
Change-Id: I77303d8e535fc1c42e14cfb853814e5c434a81ec
The point of this patch is to allow someone to use this class
to get the metadata formatted in the language of their choice
(by passing in an appropriate context object), instead of
forcing $wgLang. This is important for future evil plans I
have.
To do this, some of the previous static methods were changed
to non-static. I checked and fixed all users of such methods
(including extensions). Some of the implied private methods
were also explicitly marked as such.
Change-Id: I673d99fa36280d1baf14c150f4aaff039676830a
Currently file metadata is handler dependant. However they usually
end up extracting the same type of data (author, date, etc) plus
one or two handler specific things. This adds a handler independent
interface for getting metadata that is likely to be common for all
types of file (At the moment, this is the exif/iptc/xmp information)
This commit used to also contain stuff adding parser functions,
which is now split to its own commit. This commit is needed
by a bunch of other commits, in particular I0d957891e0.
Change-Id: I43d9252f69dc5b8ba0b848cf40aa1b97329c85ae
UploadStash::getFile has a "noAuth" parameter, which should be set true
when this is called from UploadStash::removeFileNoAuth.
Callers should already be doing their own auth checking, or calling
UploadStash::removeFile.
Bug: 56298
Change-Id: Ic70c4e2bc6df5cb9b139a3631766f8ff0ec4ef02
When MediaWiki autoloading fails, we should gracefully return false.
Instead, we have been calling strtolower roughly 1,000 times in the hope
of finding a case-insensitive match.
This patch preserves the legacy case-insensitivity, but improves its
performance by approximately 100x, by storing the case-insensitive class
lookups as a static variable.
There is a new global $wgAutoloadAttemptLowercase which will switch the
behavior if desired. The default is to support case-insensitive loading.
Change-Id: Ifb12e05614a48390b730167e9d4ddcd8545db764
To minimize the number of discrete requests that the browser has to make in
order to render the page, ResourceLoader tries to condense as many modules as
possible into each request. To ensure that the response is not stale,
ResourceLoader tacks the modification time of the most recently modified module
to the request. This behavior makes poor use of locality: an update to a single
module will change the URL that is used to retrieve it and a number of
unrelated modules, causing those modules to be re-retrieved even though they
have not changed since they were last retrieved. This is because the browser
cache is not aware that the response from load.php is a composite of modules
that should be versioned separately.
This patch adds mw.loader.store. On browsers that implement the localStorage
API, the module store serves as a smart complement to the browser cache. Unlike
the browser cache, the module store can slice a concatenated response from
ResourceLoader into its constituent modules and cache each of them separately,
using each module's versioning scheme to determine when the cache should be
invalidated.
Because the localStorage API is synchronous and slower than memory access,
modules are cached as a single JSON blob. At the beginning of the page load
process, the entire blob is loaded from storage into memory. During the load
process, any required modules that are not in the store are fetched from the
server and set in the in-memory store. When the DOM is complete, the store is
synced back to localStorage in a single operation.
* NOTE: The module store is enabled only if $wgResourceLoaderStorageEnabled is
set to true; it is false by default. We can change the default if / when we
establish conclusively that the feature is beneficial and stable.
Change-Id: If2ad2d80db2336fb447817f5c56599667141ec66
== Prelude ==
wl_notificationtimestamp controls sending the user e-mail
notifications about changes to pages, as well as showing the "updated
since last visit" markers on history pages, recent changes and
watchlist.
== The bug ==
Previously, on every view of a page, the notification timestamp was
cleared, regardless of whether the user as actually viewing the latest
revision. When viewing a diff, however, the timestamp was cleared only
if one of the revisions being compared was the latest one of its page.
The same behavior applied to talk page message indicators (which are
actually stored sepately to cater to anonymous users).
This was inconsistent and surprising when one was attempting to, say,
go through the 50 new posts to a discussion page in a peacemeal
fashion.
== The fix ==
If the revision being viewed is the latest (or can't be determined),
the timestamp is cleared as previously, as this is necessary to
reenable e-mail notifications for given user and page.
If the revision isn't the latest, the timestamp is updated to
revision's timestamp plus one second. This uses up to two simple
(selectField) indexed queries per page view, only fired when we
do not already know we're looking at the latest version.
Talk page indicator is updated to point at the next revision after the
one being viewed, or cleared if viewing the latest revision. The
UserClearNewTalkNotification hook gained $oldid as the second argument
(a backwards-compatible change). In Skin, we no longer ignore the
indicator being present if we're viewing the talk page, as it might
still be valid.
== The bonus ==
Comments and formatting was updated in a few places, including
tables.sql and Wiki.php.
The following functions gained a second, optional $oldid parameter
(holy indirection, Batman!):
* WikiPage#doViewUpdates()
* User#clearNotification()
* WatchedItem#resetNotificationTimestamp()
DifferenceEngine gained a public method mapDiffPrevNext() used
to parse the ids from URL parameters like oldid=12345&diff=prev,
factored out of loadRevisionIds(). A bug where the NewDifferenceEngine
hook would not be called in some cases, dating back to its
introduction in r45518, was fixed in the process.
Bug: 41759
Change-Id: I4144ba1987b8d7a7e8b24f4f067eedac2ae44459
In the output of MWExceptionHandler::formatRedactedTrace, it is not
possible to determine (without checking the configuration) whether arg 0
in "foo('REDACTED')" was redacted or was merely passed the string
"REDACTED".
This patch changes redaction to instead output "foo(REDACTED)" in the
case of redaction. This parallels the situation with arrays and objects,
where for example "foo(Array)" was passed an array while "foo('Array')"
was passed the string "Array".
Change-Id: Ia2a761687c69b630afa3ccd8668b06b28e3ecdd3
100 MB is no longer sufficient.
That value was chosen back in 2006 (r14795); the world has largely
moved on to 64-bit programs since then, and applications such as
ImageMagick seem to use 16-bit precision for each image channel.
It's not enough to scale regular large-ish images on default system
settings anymore.
Bug: 34241
Change-Id: I66bbe12925689f9273f3b5fb29adc8c15c828c70
Adds an empty, hidden input field to the edit interface, and will
reject any edit if that field is filled in. This will protect
against the simplest form of spambots.
Localized messages will be imported separately.
Bug: 52063
Change-Id: I185b6a1e232299f496244a23f4bf0dc6ea22b6c9
They're obviously prettier and non-intrusive enough to fit old
interfaces. The colors are changed to more pastel ones and the general
size of the boxes is reduced.
Also remove unnecessary bolds on the informations on
Special:Preferences and Special:ChangePassword.
Change-Id: Ieae62db1a124261ae7f5bf67aced8b84cfbadd3d
Account creation messages don't need to be parsed. This is
a temporary fix to follow up when double-parsing was accidentally
added in 69ea440003 (I402c6bebcfe).
Bug: 44718
Bug: 52191
Change-Id: I333d5468820994625348316ebf6c57d4df025284