Commit graph

2435 commits

Author SHA1 Message Date
Marius Hoch
e2322ff761 Arrays in PHP are a bit special...
Change-Id: Ic1c16e297f68417ba4a12c109e3a6e83974a82d5
2014-09-22 19:12:02 +02:00
jenkins-bot
fea10ac2b4 Merge "Move default logo to resources/assets/ directory" 2014-09-21 05:23:53 +00:00
Bartosz Dziewoński
96b3dd0ae3 Move default logo to resources/assets/ directory
The problem here is that the path to 'wiki.png' is saved in users'
LocalSettings.

We likely should not remap the path, like we did for footer license
icons in Ic7c32e56:

* It's likely that users changed their logo image by overwriting the
  file in skins/common/.
* If the normal upgrade process is followed (overwrite-uploading new
  files), the old file will still be there with the skins/common/
  directory.
* If it does cause problems, they'll be rather easy to notice and fix.

On the other hand, maybe we should?

* This is going to be annoying for git users.
* It will bite anyone who deletes all MediaWiki files when upgrading
  via tarball, which is more likely with the recent skin system
  changes encouraging users to remove old cruft from skins/ directory.

Bug: 69277
Change-Id: I175fe57048ebf9d348fb2fe67bf62cf5df389003
2014-09-20 20:45:50 +00:00
Bartosz Dziewoński
bf1168b8cd Fix CSSJanus flipping in LESS mixins and remove broken custom LESS functions
Custom LESS functions are problematic for us for a number of reasons,
as outlined by Timo on bug 67368. We should get rid of them.

The only use case was implementing CSSMin data: URI embedding in LESS,
which used to be impossible due to lessc not preserving comments (bug
54673). However, thanks to new syntax added in f3779e06 we can insert
the annotations in such a way that the compiler won't mess with them.
The same technique is used in OOjs UI since 584ed144.

The LESS-function-based embedding implementation also meant that we
were unable to flip images for RTL (bug 66091 and friends: bug 66773,
bug 68326). The annotation one doesn't have this limitation.

Bug: 67368
Bug: 66091
Bug: 66773
Bug: 68326
Change-Id: I3062346ed63272a1c22b5df27b4cc1de2a699d9a
2014-09-20 20:28:22 +00:00
James D. Forrester
85729d4eba Bump 1.25
Change-Id: I361206d6c0522e89f685a1b76fec56ec593032c5
2014-09-19 14:03:18 -07:00
daniel
4f0b2f4241 Allow callback functions for creating SpecialPages.
This enables factory functions to be registered for special
pages, as an alterative to giving a class name. This follows the
same rationale as Ieb85493a7765, which introduced factory functions
for API modules.

Change-Id: Ia2107dc5af7869187ba5dc02a1bef46d6801e138
2014-09-18 14:47:34 +02:00
Roan Kattouw
ef26c7ad4f Followup 1cf5a6e: use $wgResourceBasePath to refer to resources/assets, not $wgScriptPath
Bonus: actually make $wgResourceBasePath default to $wgScriptPath, rather than
special-casing it in ResourceLoaderFileModule.

Change-Id: I608435cef00d3e77a5bbdb0a0122d3e7e1a4eb78
2014-09-17 16:21:28 -07:00
Bartosz Dziewoński
1cf5a6e9d3 Move assets/ to resources/assets/
While it's "semantically" incorrect (these files are not
ResourceLoader resources), putting them in that subdirectory is a lot
less hassle than introducing a new toplevel directory.

Follow-up to 2b4b9a3f. Discussion that resulted in the toplevel
assets/ took place on I6268d663 (now abandoned).

Change-Id: Iedbfd802457fe35803899e3479540177760ec30b
2014-09-17 21:39:03 +02:00
Yuri Astrakhan
3a28ee5acb CSS/JSON/JavaScript ContentHandler refactoring
* All content handlers that deal with code/data tend to have
English as their page language & pageview language, so moved common
code to the abstract CodeContentHandler class.

* Renamed JSONContent & JSONContentHandler into JsonContent*

Change-Id: I46819a0572ef5becc211d0d82471ff7102edaa3c
2014-09-15 08:24:15 +00:00
Bartosz Dziewoński
679bc3040c Move footer icons to assets/ directory
poweredby_mediawiki_88x31.png is straightforward, just need to update
some paths.

The six license icons are more problematic, as the paths to them are saved
in users' LocalSettings. We're remapping them in Setup.php.

Bug: 69277
Change-Id: Ic7c32e56043cfbf94ef2271de4ff41ef18fbeee7
2014-09-09 14:29:57 +02:00
jenkins-bot
d1b6cd35d4 Merge "resourceloader: Only store sources' load.php urls" 2014-09-07 23:10:33 +00:00
Jackmcbarn
1ad3e0f29e Warn about bug 44011
Add a note to the documentation for $wgURLProtocols warning about
bug #44011.

Change-Id: Ifc8a1efefb862173c897796395532fda8300439f
2014-09-07 11:09:59 -04:00
Kunal Mehta
e103ba265b resourceloader: Only store sources' load.php urls
Previously ResourceLoader would store any arbitrary data about a
source, provided it had a 'loadScript' key. It would register
the 'local' source with an additional 'apiScript' key, which was
also documented in DefaultSettings.php. However, it was
completely unused outside of the ForeignAPIGadgetRepo class in
Gadgets 2.0, which should be changed to take an API url as a
parameter. This was not useful as it was not ever formally
exposed, and it could not be depended upon that a source had
registered an 'apiScript' key.

For backwards compatability, both ResourceLoader::addSource()
and mw.loader.addSource() will both take an array/object, but
discard all parameters except for 'loadScript'.

Also added tests for ResourceLoader::addSource().

Bug: 69878
Change-Id: I4205cf788cddeec13b619be0c3576197dec1b8bf
2014-09-05 04:38:22 +02:00
jenkins-bot
67a8829cd5 Merge "Remove dead mime_content_type() code paths" 2014-09-03 23:40:53 +00:00
Aaron Schulz
a9ba7d45f4 Added BloomCache classes
* Implemented a version of BloomCache using Redis
* Added a BloomCheckTitleHasLogs handler class for avoiding
  slow logging table queries when large amounts of 404 pages
  are viewed (by various web crawlers at the moment).

bug: 67439
Change-Id: I26e5034755e3a7208a45991b1cf2f12467679cc1
2014-09-03 17:43:21 +00:00
Kevin Israel
eac059c722 Remove dead mime_content_type() code paths
Since PHP 5.3, mime_content_type() is implemented as part of PHP's
fileinfo extension and thus is deprecated in favor of the newer
alternatives provided by that extension (already in use).

Also updated a comment in DefaultSettings.php that mentioned the
function. Did not modify lessc.inc.php, a third-party library
maintained separately from MediaWiki.

Change-Id: Ic4a0873989ddb634ec9a05c3340941a9ba3f5ec5
2014-09-03 16:35:35 +00:00
Tim Starling
91d8a51825 Don't send rel=canonical to variant-neutral page
This has been the subject of multiple complaints from Google, it
apparently prevents them from properly indexing the variant-specific
pages. Instead, send the variant-independent link as rel=alternate
hreflang=x-default, which is recommended by Google as the preferred way
of specifying "auto-redirecting homepages" in this help page:

https://support.google.com/webmasters/answer/189077?hl=en

Send rel=alternate links unconditionally, since that is also recommended
by that help page: "each language page must identify all language
versions, including itself".

Remove $wgCanonicalLanguageLinks since it would be rather pointless and
poorly named if it only controlled rel=alternate links.

Bug: 52429
Change-Id: Ic75717f6e4ac1f73aa600c2e1bdb9c60e607edb4
2014-08-26 14:38:40 -07:00
Bartosz Dziewoński
05047791f1 Fix documentation for $wgResourceLoaderLESSVars
* These aren't string values, but LESS code snippets. This rarely
  matters, but it matters very much when it does.
* Changes to the values do not actually trigger cache invalidation.
  Hashed contents are only used for "second-level" cache keys and do
  not make it possible to invalidate module cache.

Change-Id: I373dfedac1e43db4d0aa709384eee7f7e7f1808c
2014-08-23 00:37:26 +00:00
James D. Forrester
c45b456725 Set default setting for thumbsize to 300px (index 5) not 180px
Bug: 67703
Change-Id: I172ccc0128747090a199695d3bce04388b3bef57
2014-08-20 22:23:12 +00:00
This, that and the other
569c3e862b Allow two-tier setup of transwiki import sources
There has been some demand, particularly in the Wikimedia cluster, for the
ability to import from any wiki of a cluster. For this to occur, the
transwiki import user interface needs a bit of a rethink.

This patch replaces the existing single dropdown with a pair of dropdowns:
the first to select the wiki project, and the second to select the
subproject (e.g. a Wikipedia/Wiktionary language, or a Wikia site).
The second one is optional (to support single-wiki sites like Meta, or
for backwards compatibility with existing setups).

$wgImportSources is now treated as a mixed array/associated array (see
comment in DefaultSettings.php). Existing configurations will still work
but will receive no new functionality.

The non-JavaScript fallback is not pretty, but (a) it works, (b) I don't
see an easy way to make it nicer, and (c) wiki sysops should probably be
using a JavaScript-enabled browser for admin actions like importing...

The intention is to alter the WMF configuration to automatically populate
$wgImportSources with all public cluster wikis. I'm not exactly sure how
this will be set up, but this patch is an important first step. I expect
some non-WMF users of MediaWiki will find it helpful as well.

Change-Id: Icdb655500c1ae5374dc7a9f4d99e6738b2269b14
2014-08-19 21:59:27 +10:00
jenkins-bot
552125ee38 Merge "Special:Version: Link to tree instead of commit for git hashes" 2014-08-18 18:26:55 +00:00
jdlrobson
aa15d5287d Add blanket support for mediawiki ui via globals
This provides better mobile experiences on various pages
and a more consistent UI across both mobile and desktop.

It does this in two ways.

1) Forces HTMLForms to not use table based layouts so as
not to interfere with responsive nature of mediawiki ui elements

2) Applies MediaWiki.UI classes to most pages
If a page is created via Xml or Html classes it will use mediawiki ui
Where possible I've added classes unconditionally, but for cases of buttons
this is behind the $wgUseMediaWikiUIEverywhere global since button styling is
enabled on pages by default and for checkboxes since it is changes HTML markup.

3) Adds all MediaWiki.UI styles to pages which can use it
When enabled:
* Apply these styles to all pages which use HTMLForms
* Apply to EditPage
* Apply to anything that uses certain elements outputted by the
Xml or HTML helper classes
* Apply to History page
* Apply to protection page
* Apply to move page
* Apply to deletion page

Currently kept behind a global to allow us time to finetune
existing elements. After further testing we will look to kill the
globals and make mediawiki.ui the default

See: I430c0fbb79d2a33bb828b2427bda0ee01115d73f
Change-Id: I47db5eab4569514d039261d11b6dedb0eeae17b5
2014-08-15 14:48:00 -07:00
Tyler Romeo
6f458cfba3 Changed password default to PBKDF2
Bug: 28419
Change-Id: I096a862c884f6a6adbb381c0fcc70844bf007c63
2014-08-14 12:08:03 -07:00
jenkins-bot
ab972997ee Merge "Remove various functions and globals deprecated since 1.22 from RecentChange" 2014-08-14 18:06:35 +00:00
jenkins-bot
723a597307 Merge "Allow to send the memory usage with UDP profiler." 2014-08-13 22:24:39 +00:00
Aaron Schulz
c202712d19 Enabled $wgUseLinkNamespaceDBFields
Change-Id: I7aa64c3ef50cd0bc210ea755a0c9d6ee1b7abb7c
2014-08-13 21:33:56 +00:00
withoutaname
557b2cf3ef Remove various functions and globals deprecated since 1.22 from RecentChange
Change-Id: I5200892e75ffa894133e2e386d53c09536547de9
2014-08-12 22:19:36 -07:00
withoutaname
0eed71b776 Remove deprecated $wgHTCPMulticastAddress, $wgHTCPMulticastRouting and $wgHTCPPort
Change-Id: Icfbc178d823e59f2e305cbc4bca0b194d2786026
2014-08-12 21:52:40 -07:00
Kunal Mehta
d2a82fcb60 Add JSONContent and handler from EventLogging
As was discussed at the architecture summit, a basic JSON content
class which handles validation and basic display. Not intended to
be used directly, but for extensions to subclass.

Co-Authored-By: addshore <addshorewiki@gmail.com>
Change-Id: Ifcde9bcd0efcf15a3ab692dd2a0a3038559e0254
2014-08-08 23:31:26 +00:00
rillke
c31fbf073e Unify the spelling of MIME in documentation
Writing MIME as written in Wikipedia and some documentation clean up.

Change-Id: I9dfc36d2bf55d72d9374c4075bd6d45eef0415a4
2014-08-07 23:38:45 +02:00
Bartosz Dziewoński
9f1e4b117f Move Vector's $wg configuration options to Vector.php
Change-Id: Ic1801bff707ebfb3fccdbf4ac257ed6593ca3178
2014-08-07 14:07:41 +00:00
jenkins-bot
57ec9e0669 Merge "Allow factory functions for creating API modules." 2014-08-07 08:07:48 +00:00
daniel
baa11f7430 Allow factory functions for creating API modules.
This enables factory functions to be registered for API modules,
in addition to the module class itself. This allows modules to
use proper dependency injection via the modules constructor.

Example:

  $wgAPIModules['foo'] = array(
    'class' => 'ApiFoo',
    'factory' => function( $main, $action ) { ... }
  )

Change-Id: Ieb85493a7765f466317f5fa74b0b0e262220deab
2014-08-06 22:58:14 +02:00
Bartosz Dziewoński
0b191ba970 Use a special fallback skin when selected skin is unavailable
It just displays a helpful message that explains why and how to
install and enable skins. There is no navigation nor other basic page
elements (like the logo or site notice), since this is not intended to
be a fully functional skin.

Bug: 68332
Change-Id: Id14fbb8733cd8fbb912a724ac658f5e7244364b5
2014-08-06 16:41:36 +00:00
Kunal Mehta
0a97b26c11 Remove $wgSortSpecialPages
This is a silly option, and there's no reason you wouldn't
want them sorted.

Change-Id: Iec1598fce2278d2d8d7b89a75f888e3de9801d17
2014-08-06 15:54:41 +01:00
umherirrender
7e08a8b742 Add gender for upload log entries
With Icd8662ecb9eb0f6c0ff9841bdbd5736d6dd0d015 the log for uploads was
migrated to the new system, but no formatter was set to use the new
system also on Special:Log.
There is no need for an extra formatter class, because at the moment
there is nothing extra to format.

Added the new messages and adjust them. Now upload logs supports gender.
The old messages are kept for IRC where there were already in use.
This also hide the params added with
Icd8662ecb9eb0f6c0ff9841bdbd5736d6dd0d015 on Special:Log, because there
are not needed for i18n.

Change-Id: Idf281898d8a5a023a0b9ce3bc90b3ca55c1a6376
2014-08-04 17:25:11 +02:00
jenkins-bot
839663f3c5 Merge "Remove deprecated $wgCompiledFiles configuration setting" 2014-07-31 21:43:56 +00:00
Étienne Beaulé
b230bdce16 Create preference to watchlist pages after rollbacking
This change adds a  preference in the 'watchlist' section to
automatically watchlist a page after rollbacking.

The setting is only visible, if the user has the 'rollback'-right.
I have removed the watch reverts function per advice by Vogone.

Bug: 4488
Change-Id: I3aa831c9c04d627684641af0ca5a332795c87062
2014-07-30 21:51:41 +00:00
withoutaname
57cccdb71f Remove deprecated $wgCompiledFiles configuration setting
Change-Id: I6a220291e6ebd9354e12898a77b7dc52fd59e63f
2014-07-30 13:46:53 -07:00
jenkins-bot
ae089d79d1 Merge "Define fallback skin using $wgFallbackSkin instead of hardcoding Vector" 2014-07-30 00:26:38 +00:00
withoutaname
67defa3b68 Documentation: Update $wgPasswordDefault and BcryptPassword
Slight syntax code change for $wgPasswordDefault in DefaultSettings.php
and fixed reference to global in BcryptPassword.php.

Change-Id: I8d1d12c09ecd2f422f21a586e948f314e29fa605
2014-07-29 01:57:30 -07:00
Bartosz Dziewoński
3971d0646c resourceloader: Allow skins to provide additional styles for any module
The newly introduced $wgResourceModuleSkinStyles global enables skins to
provide additional stylesheets to existing ResourceLoader module.

This both makes it easier (or at all possible) to override default
styles and lowers the style footprint by making it possible not to
load styles unused on most pages.

----

Example:

Use the file 'foo-styles.css' for the 'mediawiki.foo' module when using
the MySkin skin:

  $wgResourceModuleSkinStyles['myskin'] = array(
    'mediawiki.foo' => 'foo-styles.css',
    'remoteSkinPath' => 'MySkin',
    'localBasePath' => __DIR__,
  );

For detailed documentation, see the doc comment in DefaultSettings.php.
For a practical usage example, see Vector.php.

----

Implementation notes:

* The values defined in $wgResourceModuleSkinStyles are embedded into
  the modules as late as possible (in ResourceLoader::register()).
* Only plain file modules are supported, setting module skin styles
  for other module types has no effect.
* ResourceLoader and ResourceLoaderFileModule now support loading
  files from arbitrary paths to make this possible, defined using
  ResourceLoaderFilePath objects.
  * This required some adjustments in seemingly unrelated places for
    code which didn't handle the paths fully correctly before.
* ResourceLoader and ResourceLoaderFileModule are now a bit more
  tightly coupled than before :(
* Included a tiny example change for the Vector skin, a lot more of
  similar cleanup is possible and planned for the future.
* Many of the non-essential mediawiki.* modules defined in
  Resources.php should be using `'skinStyles' => array( 'default' => … )`
  instead of `'styles' => …` to allow more customizations, this is
  also planned for the future after auditing which ones would actually
  benefit from this.

Change-Id: Ica4ff9696b490e35f60288d7ce1295766c427e87
2014-07-29 00:53:41 +02:00
Bartosz Dziewoński
25d75b36b0 Define fallback skin using $wgFallbackSkin instead of hardcoding Vector
Bug: 68332
Change-Id: Ibd7485dfa3123fb9ac3e9dd97cbe7129a0969c65
2014-07-27 22:42:24 +02:00
Tyler Anthony Romeo
95a8974c6b
Added password hashing API
Deprecated the old User::crypt, et. al password hashing
system and implemented an extensible password hashing
API.

The new Password class allows registering of child classes
and provides factory functions for creating new Password
objects. The built-in hash types are the old MediaWiki MD5
types, which are for backwards-compatibility only, and bcrypt.

Also included is support for wrapping existing hashes as well
as encrypting passwords with a configured encryption key.

Bug: 54948
Bug: 28419
Change-Id: I0a9c972931a0eff0cfb2619cef3ddffd03710285
2014-07-27 15:51:18 -04:00
Ori Livneh
8d6346930d Specify unit in doc-block for $wgHTTPTimeout and $wgAsyncHTTPTimeout
Change-Id: I01f7e2b3b2965bda6bf8728ce58160506873b596
2014-07-23 17:01:00 -07:00
jenkins-bot
1ce7d64af1 Merge "Add $wgDebugDumpSqlLength" 2014-07-23 22:32:06 +00:00
jenkins-bot
2900c4b297 Merge "DefaultSettings: Update documentation for skin-related variables" 2014-07-23 21:41:17 +00:00
Brad Jorsch
053c3c5fd4 Add $wgDebugDumpSqlLength
When $wgDebugDumpSql is set, the logged queries are truncated to 500
bytes. This is often not enough if you're wanting to actually debug
the queries instead of just seeing that queries were executed.

Change-Id: Iad3abd20c11d647834aa5546a1a9c82916c6519f
2014-07-23 11:15:49 +00:00
Bartosz Dziewoński
8b3d231cf5 DefaultSettings: Update documentation for skin-related variables
Change-Id: I646b737d225fd320181bb5fe86d548835c4f5357
2014-07-22 20:25:15 +02:00
jenkins-bot
a83900b360 Merge "Change the default for wgThumbnailMinimumBucketDistance" 2014-07-22 17:56:52 +00:00