Commit graph

31167 commits

Author SHA1 Message Date
Timo Tijhof
2bcffe8be4 Exception: Clean up html document for error pages
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
2013-10-30 21:52:49 +00:00
jenkins-bot
0732467b6d Merge "Add language handling to imageinfo/extmetadata API" 2013-10-29 18:33:32 +00:00
jenkins-bot
7ab94d37bb Merge "Add extmetadata to the ForeignAPIFile iiprops" 2013-10-29 18:32:53 +00:00
jenkins-bot
498693b9ea Merge "Add "extended" file metadata to API" 2013-10-29 18:29:32 +00:00
jenkins-bot
1068762721 Merge "Make FormatMetadata accept RequestContext, instead of hard coding $wgLang." 2013-10-29 18:25:57 +00:00
jenkins-bot
966fb8da62 Merge "Add an interface for getting "standard" file metadata." 2013-10-29 18:23:10 +00:00
tgr
042f1c77a6 Add language handling to imageinfo/extmetadata API
Adds options to return metadata in all available languages, or in
a single selected language.

Change-Id: I78f096318904a08abd317a5ed3f74ee33d3289cb
2013-10-29 17:49:19 +00:00
Mark Holmquist
8f156c6471 Add extmetadata to the ForeignAPIFile iiprops
Also clean up iiprop handling in ForeignAPIRepo.

Change-Id: I4a1b46669658cc7b7d074f8fb85dd172e6c45633
2013-10-29 17:48:17 +00:00
Brian Wolff
d141781396 Add "extended" file metadata to API
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
2013-10-29 17:47:59 +00:00
Brian Wolff
b6aa32bf01 Make FormatMetadata accept RequestContext, instead of hard coding $wgLang.
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
2013-10-29 16:12:15 +00:00
Brian Wolff
2cbd926e34 Add an interface for getting "standard" file metadata.
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
2013-10-29 16:12:07 +00:00
Brad Jorsch
d4b250ad38 UploadStash::removeFileNoAuth shouldn't need auth
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
2013-10-29 11:58:17 -04:00
jenkins-bot
9ea365dcb2 Merge "Backport information boxes' styles from vforms to shared CSS" 2013-10-29 09:26:02 +00:00
Tim Starling
bcdaf27eac Remove poorly-phrased doc comment and the FIXME which went with it
Change-Id: I82994ba8f92322b420b4a3fed40d5d579b06a6d2
2013-10-29 01:40:24 +00:00
Reedy
6afa1f337c Fix double space in trigger_error() call
Change-Id: I31b0aab630bf4083f4fa15d3fbce8a0d0759c94e
2013-10-29 01:24:26 +00:00
jenkins-bot
cef19c4796 Merge "Cache ResourceLoader modules in localStorage" 2013-10-29 00:13:09 +00:00
Reedy
b0aebdaa0a Fix populateRevisionLength.php so it's not trying to select revision
fields from the archive table (they won't exist!)

Follows up https://gerrit.wikimedia.org/r/#/c/54111/

Change-Id: Ie161a08097a2cd3393d69574263cfe78e4329bb4
2013-10-28 22:08:50 +00:00
Adam Roses Wight
7f51cf22f9 Minor optimization to the AutoLoader
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
2013-10-28 21:39:57 +00:00
MarkAHershberger
22280a1e3b Merge "installer: Run the LESS compiler for *.less files" 2013-10-28 21:39:31 +00:00
Ori Livneh
c719401661 Cache ResourceLoader modules in localStorage
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
2013-10-28 14:14:35 -07:00
jenkins-bot
248154da7e Merge "Revert "Revert "Add new recentchanges field rc_source to replace rc_type""" 2013-10-28 17:53:55 +00:00
jenkins-bot
bad62996da Merge "Set relevant User on Special:Unblock" 2013-10-27 20:20:42 +00:00
jenkins-bot
80bbce9f59 Merge "API: Remove leading/trailing spaces from error and description text" 2013-10-27 20:16:08 +00:00
Bartosz Dziewoński
dfc3e3df90 Correctly update wl_notificationtimestamp when viewing old revisions
== 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
2013-10-27 17:47:53 +00:00
umherirrender
c256d2ae32 API: Remove leading/trailing spaces from error and description text
Change-Id: Id866c7258a297fe965a64d52e3458d53e140aa4c
2013-10-27 17:24:15 +01:00
jenkins-bot
c83d5d7864 Merge "FormatJson: Remove whitespace from empty arrays and objects" 2013-10-25 22:33:12 +00:00
jenkins-bot
1aeec323e8 Merge "Add HTML ID to tag filter input" 2013-10-25 20:40:47 +00:00
Kunal Mehta
53a8acaf8a Add HTML ID to tag filter input
Makes it so if you click "Tag filter" the input box is
now focused.

Bug: 56175
Change-Id: I502f86f227bc0d1cc5ea936d9047bc51d169323a
2013-10-25 13:30:00 -07:00
jenkins-bot
bd1351b8d8 Merge "Distinguish redactions from the string "REDACTED" in formatRedactedTrace" 2013-10-25 20:27:01 +00:00
Erik Bernhardson
6bbd4bca6c Revert "Revert "Add new recentchanges field rc_source to replace rc_type""
This reverts commit 113f49bb21 after the
schema change has been completed.

Change-Id: I5412466444526986e1209d0982dd62cd5b387ad1
2013-10-25 13:10:42 -07:00
jenkins-bot
a34dd90a36 Merge "Fix Tidy quietly breaking TOC disabling" 2013-10-25 19:44:11 +00:00
Max Semenik
d6f673c115 Fix Tidy quietly breaking TOC disabling
The functionality was introduced in I2889bcb9
but doesn't work in presence if Tidy.

Change-Id: Ibf96cc3bc94fac75fd92ec5b9205011fcb68f0c2
2013-10-25 19:04:51 +00:00
Brad Jorsch
63b2441d62 Distinguish redactions from the string "REDACTED" in formatRedactedTrace
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
2013-10-25 11:42:27 -04:00
Reedy
08e84030d3 Replace php_sapi_name() with PHP_SAPI
Change-Id: I222789cacaa2653c4dac62708ce228674c90af4c
2013-10-25 13:57:26 +01:00
jenkins-bot
d6c2fcb8c4 Merge "Fixed use of wrong callback array element" 2013-10-25 11:18:12 +00:00
jenkins-bot
85d95e6abd Merge "Use i18n instead of hardcoded brackets and spaces" 2013-10-25 09:00:29 +00:00
Aaron Schulz
5b876967a7 Fixed use of wrong callback array element
bug: 56124
Change-Id: Ia9f058f42616f5c7c5936733747d0c3a8d56dc19
2013-10-24 23:12:04 -07:00
jenkins-bot
71173a98bd Merge "Triple default $wgMaxShellMemory (raise to 300 MB)" 2013-10-25 00:15:28 +00:00
umherirrender
ce801197c9 Pass language to File::getDescriptionText
Follow-Up: Ifcae821a51f4207e7816e710d3b3857c7ed438b6
Change-Id: I8e13f672fd37319add1c090a5b2f38c45d18fda5
2013-10-25 00:04:12 +00:00
Aaron Schulz
584de11eb1 Fixed broken quickDescribe() method
Change-Id: Ic68f483c4008ff6ae8c4accef2f9d1f180a5d377
2013-10-24 16:34:07 -07:00
Bartosz Dziewoński
45d3656a4c Triple default $wgMaxShellMemory (raise to 300 MB)
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
2013-10-25 01:16:53 +02:00
jenkins-bot
0f5f31d255 Merge "Set $parentLen in contributions" 2013-10-24 21:04:36 +00:00
jenkins-bot
5a12fef81f Merge "Fix undefined variable in Status::getMessage()" 2013-10-24 20:54:57 +00:00
Bartosz Dziewoński
00935a282e Set $parentLen in contributions
Follow-up to I77dd45eb.

Bug: 56115
Change-Id: I17bd160577e6b287cc5a61e2a3b983b035c87f81
2013-10-24 20:52:21 +00:00
aude
92e284d3fa Fix undefined variable in Status::getMessage()
If $shortContext and $longContext are false, and there
are errors, then $s is undefined.

Change-Id: Ie07f80b43a48a6fc4ed28b2c519f51fd32690bc8
2013-10-24 19:29:05 +00:00
jenkins-bot
8cabb5f777 Merge "Make TOC hideable" 2013-10-24 19:22:32 +00:00
Kunal Mehta
0988d1200d Merge SimpleAntiSpam extension into core
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
2013-10-24 20:56:11 +02:00
MatmaRex
0b539d7fa1 Backport information boxes' styles from vforms to shared CSS
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
2013-10-24 20:46:02 +02:00
Reedy
209cdf314c Initial bump to 1.23
Change-Id: I1c2d7bdd1d861ace3f7e7bd8f8f0047c31194446
2013-10-24 18:13:19 +01:00
Tyler Anthony Romeo
96a9a3e101 Fix double-parsing of account creation messages.
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
2013-10-24 10:16:19 +00:00