Commit graph

1501 commits

Author SHA1 Message Date
umherirrender
d63121016d fix some spacing
Added/removed spaces around logical/arithmetic operator
Reduced multiple empty lines to one empty line
Removed wrong tabs before comments at end of line
Removed too many spaces in assigments

Change-Id: I2bba4e72f9b5f88c53324d7b70e6042f1aad8f6b
2013-03-07 17:53:21 +01:00
Matthew Flaschen
375687eddb (bug 43270) Add wgPostEdit to show if user just saved this page
* Sets short-lived cookie in EditPage
* Adds JS module, 'mediawiki.action.view.postEdit', to all views to
  convert cookie to wgPostEdit.  This avoids caching the variable in the
  HTML.
* Based in part on PostEdit extension

Change-Id: Ie89507f8e98c365df9d93a7633223103b9025790
2013-02-25 16:32:21 -05:00
Ryan Lane
1abb019e25 Give a 200 response for valid user pages
Rather than sending a 404 on empty user pages, send a 200 response.
It's ideal to use the user's page as an OpenID identity url, but
OpenID expects 200 responses on identity urls. If we send 404s on
empty user pages it's necessary for all users to have content on
their pages to use Wikimedia as a provider. This change eliminates
that requirement.

Fixes: bug 45241
Change-Id: I527aa9d9c19c5cef7bebde78ef22f426bcbb3cd6
2013-02-22 00:49:39 +00:00
umherirrender
f3cf109e62 remove space before semicolon
Change-Id: Ic0d890f5e27cec017c7f7910a67d53b2edf82079
2013-02-09 22:44:24 +01:00
Aaron Schulz
7fa1aa7364 Made Page an interface, since it is only there to pass type checks.
Change-Id: Ifc2b754027c02bd2907010a47f125bb9544bb609
2013-02-07 12:46:02 -08:00
umherirrender
1044b0b8df fix some spacing
Change-Id: I8f976013f33c5818e4402604fe8610aa3f43b0c6
2013-02-04 20:18:33 +00:00
Platonides
5d064a7433 Reorganise the functions doing wfProfileOut and returning on all if branches.
Makes life easier for static analysis, since they don't need to
handle if the end of a function where a wfProfileOut was not called
was reachable or not.

It is recommended to review this change ignoring whitespaces
(specially for includes/parser/Tidy.php)

Also documented the rationale for the elseif chain in UploadBase::detectVirus()

Change-Id: Ic4f65937fa9e6f926d8fcfd670e3b0e99e06eefc
2013-01-13 17:53:05 +01:00
Alexandre Emsenhuber
323480faaa Make Block::newFromTarget() work again when passing only a vague target
Since SVN r106354 (85ee2d2d), when passing null or an invalid block target
to Block::newFromTarget(), it was never returning any block, even if the
vague target would have matched one.

This broke two features of core MediaWiki:
- Excluding user and user talk pages of blocked users from being indexed,
  the feature that actually caused bug 33101 and the revision mentionned above
- Blocking of account creation when both the user and its IP address are blocked,
  but of only the IP address blocks prevents account creation (bug 13611)
And maybe some others in extensions, I didn't check that.

This changes reverts part of r106354 to make Block::newFromTarget() work again
in that case and changed Article::getRobotPolicy() to pass the user to be checked
as vague target only when it's an IP address and as specific target otherwise.

Change-Id: Ie7e16e0bae8c4326d16cca237877693f7b474a01
2013-01-11 11:30:21 +01:00
jeroendedauw
bdacfd5a15 Fixed return type doc
Change-Id: Ie326867633bcf4bf03a9047fa8fa62cc66520d32
2013-01-08 19:47:00 +01:00
Tim Starling
e0a78d0a33 Introduce $wgEnableCanonicalServerLink
(bug 43466) If enabled, send a rel=canonical link on every page
indicating the correct server to use. I tested all three callers:
Article, ImagePage and the variant feature in getHeadLinksArray().

Change-Id: I59b7c1d5589825ea390967036190218d5ce2db88
2013-01-07 01:04:05 +00:00
Platonides
84e1e6b5ae Removal of unused globals.
Change-Id: I870665d18f955a245222cfceca4665897277e7e4
2012-11-26 22:15:11 +01:00
Marius Hoch
d1debff476 (bug 7851) Implement mediawiki.page.patrol.ajax
Implement AJAX patrolling with the new mediawiki.page.patrol.ajax
module, which makes use of the API via mediawiki.api.

During the patrol process a spinner (created by jquery.spinner)
shows up and after it a suitable message gets shown via
mediawiki.notify.

Depending on whether we had success or not the link then turns up
again or the brackets completely disappear just like on a normal page view.

On top of adding the module, I've changed the following:
- Added the patrol token to the ResourceLoaderUserTokensModule.
- Registered messages 'markedaspatrollednotify' and
  'markedaspatrollederrornotify'.

Change-Id: I472357566dda0ab572c20e2e4b87508b0f2f4c73
2012-11-13 23:09:38 +01:00
Alexandre Emsenhuber
0cc1ab9f9d * (bug 41966) Follow-up I551a90b0 (c2172d4): fix fatal error in PoolWorkArticleView::doWork()
The error is Fatal error:  Call to a member function getParserOutput() on a non-object in includes/WikiPage.php on line 3363.

The problem is that if the fifth parameter passed to PoolWorkArticleView::__construct() is not given or is null, which is now
the case since the change mentioned on the first line of this commit summary, the content is fetched from Page::getContent().
When the Page object is a WikiPage instance there is no problem, but when this is an Article instance, Article::getContent()
actually returns the content as *string* and not as object, like it did before the Wikidata branch merge.

Worked arround this by passing the WikiPage object to PoolWorkArticleView from Article::view().

Also removed non-existing sixth parameter to PoolWorkArticleView::__construct().

Change-Id: I537862f519542de4f034be29bba4b75898382f59
2012-11-10 16:29:56 +01:00
daniel
c2172d45e4 Beware that getContent() may return null
Before the introduction of the content handler, missing content was
signified by getText() returning null instead of a string. null will
work much like an empty string in most contexts, so in many places,
it was not checked explcitely whether the conent was null.

Now, when getContent() returns null, this often caused a fatal error,
because the code would access whatever getContent() returned as an object,
without checking whether it was null (because no such check was performed
previously, when the content was represented as a string).

This check introduces explicite checks for getContent() returning null
in the most essential core classes.

Change-Id: I551a90b0b67b8edc7570ca5d252ecc1de903f097
2012-11-09 19:45:12 +01:00
daniel
09c607f7b9 Silence warnings about deprecation by ContentHandler.
The introduction of the ContentHandler caused quite a few functions and hooks to
become deprecated. Usage of these has been removed in core, but is still present
in extensions. Extensions should be fixed after ContentHandler has settled in a
bit, but for now we need a way to silence the warnings.

Change-Id: Ia223243222675f778e8f8c32923f956790db0b4f
2012-10-12 14:56:02 +02:00
daniel
1048b0bcb2 Fix merge artifact in Article::showCssOrJsPage.
Change-Id: I1e9608809b81d2c5feeb048ddee96d5324b62a81
2012-10-09 14:23:42 +02:00
Siebrand Mazeland
448937dabc Replace deprecated call.
Change-Id: I71866194d72bca059e28b0bd74f4ecd5686743c4
2012-10-09 09:43:06 +00:00
daniel
bb51a58e57 Cleanup of Wikidata branch.
This cleans up several issues raised in comments to I3b2dad3a,
mostly style and merge artifacts.

Change-Id: I99f5e300a671db1353db151cd187ffd2e4478d03
2012-10-08 17:34:47 +02:00
daniel
c546fae8ed merge latest master into Wikidata branch
Change-Id: Id4e0f40c03679c13d8934a6add99b5cd86d0437d
2012-10-08 13:58:54 +02:00
umherirrender
20291cd166 Pass user object to some Revision::getText/Title::userCan calls
Also passed some $wgUser direct (when already there), so it is seen by
someone, that the user should be passed to that method.

Change-Id: Id4d5504a05ea34d80d59262ad3aef28f09c807a6
2012-10-05 16:25:01 +02:00
daniel
7db9491d89 set mediawiki version number
Change-Id: I3479776bd3bb25c4d75d07e62ede2ad989025c5b
2012-10-05 15:03:24 +02:00
jeroendedauw
dc8f3e6c78 Added a pile of missing brackets
Change-Id: Id7b331e1b12875736c8e7e93660e71630360a723
2012-09-27 21:46:22 +02:00
daniel
b6b686c13b merged master
Change-Id: I0ef7c7f33a5dc5855f38b20c03ddc5306f38ec66
2012-09-19 12:34:10 +02:00
Aaron Schulz
850373ba9c Merge "Use WikiPage::makeParserOptions() where possible." 2012-09-16 18:02:56 +00:00
daniel
be43796499 Comment cleanup
Change-Id: Ie41f680782502f2b70c1bdbf18da3ee790d48fe7
2012-09-13 16:21:54 +02:00
daniel
12166f46b4 merged master (2012-09-11)
Change-Id: I8e953eaa22f9d331b0af5e780fbeff6d702b23e3
2012-09-11 11:43:02 +02:00
Siebrand Mazeland
21b592d1ad Replace deprecated methods.
Also updated code formatting.

Change-Id: I188b5d29c9496383df10c391b29e9d26e59e8aeb
2012-09-08 00:28:16 +02:00
Alexandre Emsenhuber
be0878fd3a Use WikiPage::makeParserOptions() where possible.
- This is needed to for I90965346 ((bug 37453) Move
  $wgDisable(Lang|Title)Conversion to ParserOptions)
  because that change sets an option based on the Title,
  and I don't want to duplicate that to all ParserOptions
  that need it.
- Refactored ApiParse to have a WikiPage object available
  and changed some part to take advantage of having this
  object available. Also used ApiBase::getTitleOrPageId()
  to reduce code duplication.

Change-Id: Iec98e472af9c43d940f77261367a796b0d7b4b54
2012-08-31 23:16:03 +02:00
daniel
9994968774 merged master
Change-Id: Ib2b879c4daa17401eeeb50767c0e5a54254855c3
2012-08-29 15:20:15 +02:00
Daniel Kinzler
392af46809 Revert "merged master"
This reverts commit 67bfdc7a68
2012-08-29 13:14:49 +00:00
daniel
67bfdc7a68 merged master
Change-Id: Ib2b879c4daa17401eeeb50767c0e5a54254855c3
2012-08-29 12:06:38 +02:00
daniel
53ffc46221 Merge "Fixing creation of DifferenceEninge" into Wikidata 2012-08-28 11:44:44 +00:00
daniel
2bc191889a Fixing creation of DifferenceEninge
Creation of DifferenceEninge insteances was based on invalid assumptions
in several places.

Change-Id: Ib67ca893ea53a27d4ac7efd8a9ca0d3b2d93949f
2012-08-24 20:49:19 +02:00
Alexandre Emsenhuber
900383ae18 Use Status::getWikiText() instead of getErrorsArray() in Article::doDelete()
So that the usage of the Status class is more consistent with other places.

Change-Id: I8f7944905df7bc241b21f014d8544486ea012f6b
2012-08-22 20:42:27 +02:00
daniel
74fe09ed4d Bug 39509: Function for running legacy hooks.
ContentHandler::runLegacyHooks can be used to run hooks that don't
supprot Content objects yet. runLegacyHooks will issue a warning and take
case of serialization/unserialization of the content as appropriate.

Changeset 2: rebased.

Change-Id: I31109061110f87c38bdeebf30d520c8e1241bb29
2012-08-20 22:00:52 +02:00
daniel
0139923580 fixing long lines
Change-Id: Iebcd40a1a37a3a93cc571fa2c2b0a87f53dc97a4
2012-08-20 21:33:07 +02:00
daniel
29719f846b merging latest master
Change-Id: I36b7f2f63ab8c08f8412d521dc68ea45c8b67711
2012-08-20 16:55:28 +02:00
Siebrand Mazeland
8d4913ec4d Replace deprecated wfMsg* calls with Message class calls.
Change-Id: Ifa80db1d81b9b9d1a5adfcac06a9ed14203c100e
2012-08-19 22:08:08 +02:00
Alex Monk
2fabea7eea Use wfMessage instead of deprecated wfMsg*
Or $this->msg in special pages.

Change-Id: I774a89d646615053c8424050e42ad95601f92543
2012-08-18 14:11:05 +02:00
Dereckson
8d68833208 (bug 37638) Remove calls to deprecated LogPage::logName method.
The LogPage::logName method has been deprecated in 1.19,
warnings being planned in 1.21.

This change removes any call in the MediaWiki core to this
deprecated method.

Removing extra whitespaces/tabs in includes/ProtectionForm.php.

Change-Id: I1907f17341ecb6448967a5283e3c913778dcb1a9
2012-08-15 07:50:01 +00:00
Aaron Schulz
180208751f Merge "Follow-up SVN r98012: pass Title objects to LogEventsList::showLogExtract()." 2012-08-07 20:58:45 +00:00
daniel
30d416f1c4 add Article::setParserOptions
Change-Id: Ica1c0a3c4b5b569c4911d4c1fb0167812f932c20
2012-08-07 19:02:24 +02:00
Alexandre Emsenhuber
d24a4d7f10 Use a better message when a revision is not found.
This comes from
https://translatewiki.net/wiki/Thread:Support/MediaWiki:Missing-article
that asks for a link to the deletion log in the
'missing-article' message.

Instead of simply changing that message I replaced
it with two news messages 'missing-revision' when trying
to view an old revision and 'difference-missing-revision'
when showing a difference. This removes the "lego"
construction of 'missing-article' with 'missingarticle-rev'
and 'missingarticle-diff' submessages.

I had to keep current messages since they are still
used in extensions.

Change-Id: Ibe60c84cfea922a78b3ad22cc48185a109cd617d
2012-08-06 10:53:53 +02:00
Alexandre Emsenhuber
7cb2a29392 Follow-up SVN r98012: pass Title objects to LogEventsList::showLogExtract().
It seems that I forgot to update Article.php in that revision.

Change-Id: Ia29cc62dc88abb7f58d5f8cec68f67b126763f6f
2012-08-05 11:44:22 +02:00
Alexandre Emsenhuber
388ea8dc28 Mark the history link on page deletion as known.
Two reasons:
- the page must exists to reach this part of the code
- it's useless to have special classes (redirect, stub)
  since this a link to the history and not to the
  content itself

Change-Id: I59af2f237e0539842cc7777ddd44ba5ac500b070
2012-08-02 14:06:20 +02:00
daniel
c0b50eb47d merged master
Change-Id: I6afafe971afb3f38fc8f1e66ba409283b8a698f8
2012-08-02 11:01:22 +02:00
Alexandre Emsenhuber
34362e12bd Use Linker::linkKnown() instead of Linker::link() with options in Article.
Change-Id: I01a69bc76a9904859c3baf04b19659de7edf5348
2012-07-29 21:46:11 +02:00
Alexandre Emsenhuber
73e6b5db37 Use WikiPage::loadPageData() to reload data from the master.
There's no need to do this using custom code when we already
have methods for this.

Change-Id: I348dd9a01322b7e9b521e7a014959e91254dd2aa
2012-07-25 12:22:47 +02:00
Alexandre Emsenhuber
58c2c579d9 Pass the local User object to Revision::userCan()
Change-Id: Iffd857a577593642464371a988b7b7829d246748
2012-07-24 18:28:03 +02:00
daniel
d87135d706 merged master
Change-Id: Iad12ee382d6aeb1fab6fefb611d290b74865ea4b
2012-07-23 22:07:18 +02:00