Commit graph

1173 commits

Author SHA1 Message Date
SPQRobin
ec81140f9b Merge "(Bug 41493) Move PageContentLanguage hook to Content class" 2012-11-01 23:55:20 +00:00
daniel
b5b2b2f898 (Bug 41574) Supply Title object to Revision if possible.
The Revision object needs the Title to determine the default content model.
Providing the Title explicitely wherever possible avoids an extra database
lookup. Most importanlty, this fixes fatal errors that ocurr when the
database lookup fails due to slave lag or transaction state.

Change-Id: I516e82f7a893b274c513b128b8a46db491160b55
2012-11-01 13:48:18 +01:00
daniel
d879e4227a (Bug 41493) Move PageContentLanguage hook to Content class
This change moves the PageContentLanguage hook from Title::getPageLanguage
to Content::getPageLanguage, so the hook is no longer bypassed by
Content::getPageViewLanguage and consequently Title::getPageViewLanguage.

Change-Id: I51dabe9aee9d544483e7416a8fdf7721638d21bf
2012-10-29 18:08:04 +01:00
umherirrender
82375631c2 Fix tabs inside/between statements/text
This tabs are strange and a space there is better

Change-Id: I0885dff575ee2fcd0668d08fef3226e132c5b319
2012-10-26 18:18:59 +02:00
RobLa
89790eaea4 Bug 37209: change exception into debug entry
Change-Id: Ic2d3f0b8b0b15828a8acbc8868f26102bb33e75d
2012-10-24 13:38:43 -07:00
Antoine Musso
9362bb6c56 miscellaneous doxygen warnings
* @licence -> @license
* Protects inline HTML by using double quotes, our inline comments uses
  elements such as <h1> or <firstnameLastname@gmail.com>
* Commands in lowercase (@TODO -> @todo, @NOTE -> @note)
* removes @abstract and @static since doxygen detects them from PHP
  code.
* various undocumented function parameters
* typos in parameters declarations

Change-Id: I62ad6fc124c355bf31acc780b9614a59cf79a421
2012-10-22 14:00:08 +02:00
umherirrender
9d19d7342a Remove a bunch of trailing spaces and unneeded newlines
Change-Id: I7db616db8c969567d420c0161fa207b366e292b6
2012-10-19 22:03:05 +02:00
Aaron Schulz
5fec9caec7 Merge "Silence warnings about deprecation by ContentHandler." 2012-10-13 00:03:31 +00: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
aude
603a1de640 remove exception, introduced with content handler merge
There is a bug [1] in the Title::isRedirect() method, when called from Linker,
in some cases when the link cache is not aware of a title.  The bug
should be fixed ASAP. Until then, this removes the exception and maintains
same behavior as before the merge.

[1] https://bugzilla.wikimedia.org/show_bug.cgi?id=37209

Change-Id: I7874a5ecdd24417108685f811bbc2e6a2d82aa94
2012-10-11 12:14:40 +00:00
Siebrand Mazeland
632ce2a8fd Remove unused variables.
Change-Id: I4b76cbbca22555eacb8ef4de58993b485f7cdd18
2012-10-09 09:43:14 +00:00
daniel
329d5b3516 Merge branch 'Wikidata' into master.
This introduces the ContentHandler facility into MediaWiki,
see docs/contenthandler.txt.

For convenient review, a squashed version is available at
https://gerrit.wikimedia.org/r/27191

The ContentHandler facility is a major building block of the Wikidata project.
It has been discussed repeatedly on wikitech-l.

Change-Id: I3804e2d5f6f59e6a39db80744bdf61bfe8c14f98
2012-10-09 11:34:24 +02:00
umherirrender
22dd67ea3c Avoid direct access to $wgGroupPermissions
Created a new method User::groupHasPermission and check also
$wgRevokePermissions for the given right

Change-Id: I41edb091fa35c8c68b6f95cc5fd208ea99418cdb
2012-10-09 06:41:23 +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
daniel
c3c7ae0615 Merge "Prevent page moved to different content model." into Wikidata 2012-10-08 11:11:33 +00:00
daniel
01e1b1a8e8 Use ContentHandler as a factory for recirects.
Redirects should not be constructed as wikitext, since other content models
may use other mechanisms to represent redirects.

Change-Id: Id85c3b3ada1924628e4e51757573d233e998f920
2012-10-05 16:50:32 +02:00
daniel
cc126b8efa Prevent page moved to different content model.
Pages should never be moved in a way that would change their content model.
Without this explicite check, that might happen when $wgContentHandlerUseDB
is disabled.

Change-Id: Id1a101f56bee6f13a7259d34019c587e75a4c182
2012-10-05 16:08:07 +02:00
daniel
7db9491d89 set mediawiki version number
Change-Id: I3479776bd3bb25c4d75d07e62ede2ad989025c5b
2012-10-05 15:03:24 +02:00
Daniel Friesen
55a52d5915 more public accessors for Title class
This patch adds new public accessor to the Title class. They are merely
returning the already existing conventions.

Added tests for the four new methods:
 - Title::getBaseText()
 - Title::getRootText()
 - Title::getRootTitle()
 - Title::getSubpageText()

The later does not test with $wgNamespacesWithSubpages variants.

Change-Id: I4f7230c1a5487b82d06c78a45c50436085df57be
2012-10-01 20:52:03 +02:00
Tyler Anthony Romeo
af68ecea64 (bug 40541) Fixed minor code style problems.
Follow-up to I17ac68014840daa47bfd4768e978e9ff2edb00db.
Replaces some ==/!= with ===/!== and other code style
changes mentioned in Gerrit comments on previous patchset.

Change-Id: I50da16bc62241491ac5c4948e0d3059b21f113dc
2012-09-30 21:23:05 -04:00
Tyler Anthony Romeo
0a1e291036 Added protocol option to Linker and OutputPage::addReturnTo.
Added new argument to the Linker options array to allow
the forcing of an HTTP or HTTPS protocol. In order to facilitate
this, a protocol argument was added to Title::getLinkURL.

Also, an options argument was added to OutputPage::addReturnTo
so that options can be passed to the linker and so that the
returnto URL can be forced to a certain protocol.

Change-Id: Ia9cc11e310ad6ef23c221bdba3a4834e7c5556e7
2012-09-27 13:47:42 -04:00
daniel
b6b686c13b merged master
Change-Id: I0ef7c7f33a5dc5855f38b20c03ddc5306f38ec66
2012-09-19 12:34:10 +02: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
Aaron Schulz
dcdb56b3f6 Merge "Limit the Title backlink cache to two instances." 2012-09-11 06:22:44 +00:00
umherirrender
d7720f1960 Fix Title::getRedirectsHere to respect interwiki prefix
Respecting rd_interwiki is needed to act the same way than
Special:Whatlinkshere. For local redirects it is needed to also check
for NULL, not only the empty string

Change-Id: I4f3f242d69054dcbb3c7a02441991196ba140986
2012-09-08 06:57:10 +02:00
daniel
a98607815f introducing ContentHandler::getPageViewLanguage
Change-Id: I5b7aabaab48b30a9b6620a0cb4272bc5e348c014
2012-09-05 18:27:32 +02:00
daniel
b6fe213226 merge latest master.
some tests fail due to logical changes, will fix that in a follow-up

Change-Id: I8a5e4087ecf674fbcf6327c5d168cd401be12400
2012-09-05 17:50:13 +02:00
Hashar
89a055491c Merge "'lang' attrib in #mw-content-text should be set to variant code." 2012-09-04 15:04:52 +00:00
Liangent
da43314022 'lang' attrib in #mw-content-text should be set to variant code.
Change-Id: I15cd8c102991c5007b43e06939a0c1a7593d0933
2012-09-04 17:00:27 +02:00
Aaron Schulz
af89b09a06 Limit the Title backlink cache to two instances.
Change-Id: I1e17a3de20d7c84a9818a850d4b7cc2898f72dc2
2012-09-03 12:45:50 -07:00
IAlex
bceb90ceed Merge "Replace deprecated wfMsg* calls with Message class calls." 2012-08-31 13:15:45 +00:00
Aaron Schulz
a53de31828 Added explicit DB flags for Revision loading calls.
Change-Id: Ie90d4197ad7a16009c96273eeae1a658678a8200
2012-08-29 20:04:30 -07:00
daniel
72952a082c merged master some more
Change-Id: I53f349e42336ce0426ea1aff939853b3cd728aeb
2012-08-29 15:37:17 +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
Siebrand Mazeland
01788cddd3 Replace deprecated wfMsg* calls with Message class calls.
Last round of easy replacements. About 30 uses in core remain (outside of HISTORY
and GlobalFunctions::wfMsg*). I'll work with IAlex and Nikerabbit to work towards
getting rid of those, too.

Updated method documentation in a few places.

Change-Id: I2491c006b62a9cc183230e31a0bd96c91e5b6142
2012-08-27 20:44:47 +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
Tyler Romeo
4893afd833 (bug 31040) Fixed $wgSecureLogin effect on returnto.
Added parameter to Title::getFullURL to allow specification
of a protocol rather than assuming PROTO_RELATIVE. Also
added an accompanying parameter to Skin::makeSpecialUrl
to make a link for a specific protocol.

Cleaned up the creation of personal URLs in SkinTemplate.php
so that when $wgSecureLogin is enabled, the returnto
query is not lost in the process.

Note: This will only work if $wgServer is set to a
protocol relative URL.

Change-Id: Iba48eb3620fb3a721220364185f7abfd902412d0
Signed-off-by: Tyler Romeo <tylerromeo@gmail.com>
2012-08-13 08:53:43 -04:00
Aaron Schulz
1690388847 Merge "(bug 12701) Use diff of all unseen revisions in the "new messages" bar." 2012-08-09 16:59:57 +00:00
daniel
d87135d706 merged master
Change-Id: Iad12ee382d6aeb1fab6fefb611d290b74865ea4b
2012-07-23 22:07:18 +02:00
Catrope
e23e3a3c79 Fix bug in moveTo() with $auth=false and $createRedirect=false
Even when $auth=false, moveToInternal() would unconditionally check
$wgUser's 'suppressredirect' permissions and override $createRedirect.
This means it was impossible to suppress redirect creation when moving
pages in a maintenance script, even when telling moveTo() to disable
permissions checks.

Fixed by moving the check from moveToInternal() up into moveTo() and
respecting $auth there

Change-Id: I9b52dc67c7ae2dbda3ca62f78d4d7df118771c0f
2012-07-19 15:48:05 -07:00
tomek
74cbd6b05f fix problem with retriving fresh LatestRevID when GAID_FOR_UPDATE
Change-Id: Idff009752da3336383a20581d79ffd231332f463
2012-07-11 13:12:58 -04:00
Siebrand
5fb8b96195 Merge "Expose the log_id of the deletion log entry in the action=delete API" 2012-07-01 15:55:29 +00:00
Alexandre Emsenhuber
58852d8827 Deprecated Title::userIsWatching(); use User::isWatched() instead.
* The problem is that Title::userIsWatching() relies on $wgUser,
  which is not suitable on every case. Instead User::isWatched()
  requires both an User and a Title object.
* Replaced all core calls from the former to the latter
* Added a cache in User for the WatchedItem instances so we do not
  need to do a database request every time something want to know
  whether a page is watched or not, which can happen several times
  per request.

Change-Id: Ifa9c55b7ffb487ce6893c74df233eedc7654dc5e
2012-06-29 23:22:35 +02:00
Aaron Schulz
938d6ec732 Merge "Purge Squid variant pages based on page language (not $wgContLang)" 2012-06-28 22:23:42 +00:00
daniel
1ff6a778b3 determine getPageLanguage via ContentHandler
Change-Id: I73760d4b4412aef416ee3b55d85e9fa257703063
2012-06-26 16:37:42 +02:00