Commit graph

101 commits

Author SHA1 Message Date
Adrian Lang
5d8fd152f3 Correct doc of WikiImporter::__construct parameter
Change-Id: I0c61bb4f8d1e51f3b58ff99a9c632561dfd5134d
2014-06-02 12:09:15 +02:00
jenkins-bot
487823ba89 Merge "Correctly parse 'redirect' XML tag during Special:Import." 2014-05-28 18:56:40 +00:00
Sebastian Brückner
85b695c2ee Correctly parse 'redirect' XML tag during Special:Import.
Bug: 65481
Change-Id: Id9b3b7878b2e7b6fc7a06b163e5bac60e700490e
2014-05-28 16:47:49 +02:00
jenkins-bot
36e4a83640 Merge "Introduce ContentHandler::importTransform." 2014-05-27 18:26:19 +00:00
daniel
5ca37ababd Introduce ContentHandler::importTransform.
ContentHandler::importTransform allows ContentHandler
implementations to apply transformations on page content
upon import. Such transformatiosn may by useful to update
from legacy formats, apply ID rewriting, etc.

Note that the transformation is done on the serialized content.
This allows for a "raw" import implementation that writes
improted blobs directly into a blob store without unserializing
them into an intermediary representation. Implementations may
choose to unserialize, transform, and then re-serialize.

Bug: 65256
Change-Id: I290fdf5589af43def8b3eddb68b5e1c23f6124e8
2014-05-20 19:12:35 +02:00
Alexander Lehmann
ba16bbd0a9 Inserted test whether the resource 'uploadsource' is already registered.
Bug: 65530

Change-Id: I1b82d6dc6a37792d4e7b7d01316802ea4d38a88b
2014-05-20 13:12:02 +00:00
Siebrand Mazeland
a7fbdd6503 Make phpcs-strict pass on includes/ (7/7)
Change-Id: Ia9baaf0b3cdbe1a3c6b50ef8c4fe86fead88f909
2014-05-15 20:07:09 +02:00
Alexandre Emsenhuber
5c4bf6b9bd Fix coding style from Ie40c0721ec (e9f01c9)
- Opening brace goes on the same line as the function definition
- No backslash before class name in @return

Change-Id: I4c43e047c36d0ce6e9c2344f6ee98786b2b8eac4
2014-05-15 16:44:25 +02:00
Alexander Lehmann
e9f01c9324 Inserted getter for the XMLReader and change the visibility of some
functions for use in hooks.
Bug 64657

Change-Id: Ie40c0721ec32935294756d60ea6686ebeefa61af
2014-05-15 14:17:36 +02:00
umherirrender
192a9d021c Fixed some @params documentation (includes/[Export.php|Import.php])
Swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.

Change-Id: I32ed752d23088f6203462134b2af57c6f06a4de5
2014-04-23 11:30:40 +02:00
umherirrender
b9cd789fce docs: closure -> Closure; callback -> callable
Changed closure to capital word Closure in doc and type hint,
also changed callback in docs to callable

Change-Id: I52c8e8f13d38a837052101c38b9986be780ca057
2014-04-19 08:43:31 +02:00
Ladsgroup
1ba0445c12 Changing URLs of mediawiki.org in scripts to the SSL-based website
http://www.mediawiki.org --> https://www.mediawiki.org

Part 2

Change-Id: I3be61fe3dfb502cc20180486eb1a8016eac151df
2014-03-12 23:24:03 +00:00
jenkins-bot
70ae276db1 Merge "(bug 47070) check content model namespace on import." 2014-01-28 20:56:02 +00:00
umherirrender
65a4ae9fe9 Change Title::getInterwiki() in conditions to Title::isExternal()
Change-Id: Icce26e6194ae96f262029554e05b49117d5e112e
2014-01-02 11:59:10 +01:00
daniel
4cc9407fe9 (bug 47070) check content model namespace on import.
When importing, we need to check that the kind of content we are about to
import is actually allowed in the specified location on the local wiki.


This change does two things:

* Introduce the ContentModelCanBeUsedOn hook which provides control over
which kind of content can be used where.

* Introduce a check against ContentHandler::canBeUsedOn in the importer,
along with an appropriate error message.

Change-Id: Ia2ff0b0474f4727c9ebbba3c0a2a111495055f61
2013-12-17 16:58:57 +00:00
umherirrender
cbc4fd7a5b print is not a function
Removed parenthesis after print

Change-Id: I1343872de7aa7c64952a3d86a63aaa091e46bda3
2013-05-09 20:06:03 +02:00
Max Semenik
1f8a7dc2d2 Import: Fix incorrect wfRunHooks usage
af125df519 broke importing
because Import.php was calling wfRunHooks() improperly.
Fixing the calls and making the wfRunHooks() signature
match Hooks::run() to make call errors immediately detectable.

Change-Id: If44292fedf6917cde1dae7f0391231a18d414610
2013-05-02 18:06:19 +00:00
umherirrender
9f14ecf829 Added space after switch/Removed spaces after unset
While at it, added/removed some other spaces in the same files

Change-Id: I84d8001aa123a008807ad5eb76f396aed7c899a4
2013-04-26 16:42:31 +02:00
umherirrender
ef2f507d23 Fixed spacing in files direct in includes folder
Added spaces before if, foreach
Added some braces for one line statements

Change-Id: Ibb8dd102db045522d12ff939075ba7420d95ab6b
2013-04-21 06:38:49 +00:00
csteipp
77a8d57691 Disable external entities in Import
Temporarily disable loading entities in XMLReader when calling read()
during import.

bug: 47251

Change-Id: I0b39386e6cf4ec0244aab8ebc4095922511e2964
2013-04-15 13:52:49 -07:00
umherirrender
15abcf71ca Added/Removed spaces around string concatenation
And added/removed spaces around some other tokens,
like +, -, *, /, <, >, =, !

Fixed windows newline style

Change-Id: I0b9c8c408f3f6bfc0d685a074d7ec468fb848fc8
2013-04-13 13:36:24 +02:00
Alexandre Emsenhuber
df5265e14d Fix case of some Title methods
Change-Id: I37ce7fe392f4941c500fa0a88007664501d7e338
2013-03-27 14:36:05 +01:00
umherirrender
6c278b6d7e fix some spacing
* Removed spaces around array index
* Removed double spaces or added spaces to begin or end of function
  calls, method signature, conditions or foreachs
* Added braces to one-line ifs
* Changed multi line conditions to one line conditions
* Realigned some arrays

Change-Id: Ia04d2a99d663b07101013c2d53b3b2e872fd9cc3
2013-03-25 22:22:46 +00:00
Yuri Astrakhan
9506e3d812 Spellchecked /includes directory
* Ran spell-checker over code comments in /includes/
* A few spellchecking fixes for wfDebug() calls

Found one very strange (NOOP?) line in Linker.php - see "TODO: BUG?"

Change-Id: Ibb86b51073b980eda9ecce2cf0b8dd33f058adbf
2013-03-13 03:42:41 -04:00
jenkins-bot
6114f05fc1 Merge "Correct case of Title::getPrefixedDBkey() calls" 2013-03-12 15:13:21 +00:00
jenkins-bot
fac1ec45f1 Merge "Don't use isset() to check whether an existing variable is null" 2013-03-12 15:08:56 +00:00
Tyler Anthony Romeo
4dcc7961df Fixed @param tags to conform with Doxygen format.
Doxygen expects parameter types to come before the
parameter name in @param tags. Used a quick regex
to switch everything around where possible. This
only fixes cases where a primitve variable (or a
primitive followed by other types) is the variable
type. Other cases will need to be fixed manually.

Change-Id: Ic59fd20856eb0489d70f3469a56ebce0efb3db13
2013-03-11 13:15:01 -04:00
Alexandre Emsenhuber
c6a889acc4 Don't use isset() to check whether an existing variable is null
Change-Id: Ie63f060fb7928fd51a8ad71293955f923f6a18c3
2013-03-10 16:23:46 +01:00
Alexandre Emsenhuber
cd4dd7ca85 Correct case of Title::getPrefixedDBkey() calls
Change-Id: Ic9ef0cc6dbb0a8eb0ee93432299ef59759223e2c
2013-03-09 21:14:22 +01:00
umherirrender
ca31ebad3f fix some spacing
Added/removed spaces after opening/before closing parentheses

Added a space after a comma

Removed unneeded parentheses in condition

Change-Id: I306091347ccaaf11dee0cdfda3019cb0c12be51b
2013-02-09 23:03:53 +01:00
umherirrender
1044b0b8df fix some spacing
Change-Id: I8f976013f33c5818e4402604fe8610aa3f43b0c6
2013-02-04 20:18:33 +00:00
umherirrender
6fbbbd17ca fix some spacing
Change-Id: Ie7bb35871cc99237f3a655f7db22ca1f0646df5e
2013-01-27 14:21:50 +01:00
daniel
d1cf044329 (bug 42787) Make import robust against corrupt content.
This catches serialization exceptions caused by corrupt or mis-reported
non-text content.

Change-Id: I28ef70f716b1aade1b837ca480c49b1826fa9e26
2012-12-12 12:47:40 +01: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
aude
e21e450d43 check if $revisionInfo['format'] isset in Import.php
Change-Id: I40073665f7b8f4d36d9d8877c1e38ee0e83a7191
2012-10-15 22:36:38 +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
Siebrand Mazeland
d4b046a893 Update docs for return and exception info
* Removed some inline tabs in the process.
* IDE fixed some incorrect leading spaces, too.

Change-Id: Ic9303eff6db4424ac3f1fa2816839692b43e6190
2012-10-09 09:41:58 +00:00
daniel
7db9491d89 set mediawiki version number
Change-Id: I3479776bd3bb25c4d75d07e62ede2ad989025c5b
2012-10-05 15:03:24 +02:00
daniel
ff03cf38cc get rid of Revision::getText
Change-Id: Ia0b16813fa1688b6faccbe8ca81b1099001b1f3b
2012-09-14 18:23:21 +02:00
daniel
29719f846b merging latest master
Change-Id: I36b7f2f63ab8c08f8412d521dc68ea45c8b67711
2012-08-20 16:55:28 +02:00
daniel
d87135d706 merged master
Change-Id: Iad12ee382d6aeb1fab6fefb611d290b74865ea4b
2012-07-23 22:07:18 +02:00
Antoine Musso
aab43dd495 escape tags and entity in doxygen comments
When inserting XML elements inline <such as this one>, doxygen chokes
about it not being known. Simply enclosing the tag in double quotes
prevents doxygen from emitting a warning.

Also enclosed a few invalid functions calls such as \. and double quoted
the HTML entities such as &foobar;

Change-Id: I4019637145e683c2bec3d17b2fd98b0c50a932f1
2012-07-10 17:08:32 +02:00
daniel
906a1ba51f [bug 37746] string ids for content model and format.
The content model is stored as a varbinary(32), the format
as varbinary(64).

If the standard model resp. format is used, null is written
to the database instead of the actual id, saving space.

Change-Id: I32659b49a9ad3cb8ecae9019562cff7de42b65f9
2012-06-26 15:56:06 +02:00
daniel
cbc2014b2d Use integers for content_model and content_format.
Representing content_model and content_format as integers in the
database was suggested by Asher mainly to save space.

This change entails some refactoring and renaming, but no big
change in logic.
2012-05-14 10:22:52 +02:00
daniel
eb5d3a83a7 preserve content model and format in xml dump, use in import 2012-04-23 11:31:13 +02:00
umherirrender
6ffe706044 (bug 33564) transwiki import sometimes result in invalid title
This is a simple fix. A other solution is to check isExternal on the
original title, but than it is never possible to import pages, which
have a interwiki in the destination wiki. Now the interwiki is skipped,
when using a target namespace.

Change-Id: I148e124016cacac0e0c6c6eb8c7e8a2e85802565
2012-04-09 12:25:00 -07:00
Daniel Friesen
e2ee009e5c Commit the cryptrand project worked on in git:
- MWCryptRand: A new api for generating cryptographic randomness for security tokens. Uses whatever cryptographic source is available and if not falls back to using random state and clock drift.
- wfRandomString - A simple non-cryptographic pesudo-random string generation function to replace wfGenerateToken which was written pretending to be secure when it's really not.
- Core updates to use MWCryptRand in various places:
-- user_token generation (to do this we stop generating user_token implicitly and only generate it when needed to avoid depleting the system's entropy pool by reading random data we'll never use)
-- email confirmation token generation
-- password salt generation
-- temporary password generation
-- Generation of the automatic watchlist token
-- login and create user tokens
-- session ids when php's entropy sources are not set
-- the installer when generating wgSecretKey and the upgrade key
2012-03-20 05:17:40 +00:00
Sam Reed
c052fc3b7b Documentation followups from lastnight 2012-02-10 15:37:33 +00:00
Sam Reed
76246b9bf5 More return documentation 2012-02-09 21:33:27 +00:00
Sam Reed
7b25f8231f Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 19:30:01 +00:00