Commit graph

1242 commits

Author SHA1 Message Date
Brad Jorsch
18062eb3b0 Add user rights 'viewmywatchlist', 'editmywatchlist'
These are needed for OAuth grants.

Note that, even if 'editmywatchlist' is not granted, various actions
will still allow for adding but not removing of pages.

Change-Id: Ie33446a228dd6ed0114730935c1bf65667f5ce01
2013-06-26 10:20:40 -04:00
jenkins-bot
2361107a27 Merge "Remove unnecessary exception from Title::getLatestRevID()" 2013-06-11 07:02:43 +00:00
Tim Starling
22e2e96088 Remove unnecessary exception from Title::getLatestRevID()
Bug 37209: An exception was thrown where the data cached in the Title
object was inconsistent with the data in LinkCache. It shouldn't be
surprising that this happens, since there is no guarantee that the data
was derived from the same transaction or even the same DB server.

But I don't think it is a problem worth troubling the user over, since
with $flags=0, the slave DB server will be used, and no special guarantee
of consistency should be expected by callers. If callers do need
consistency, then they should make their own arrangements to get it,
such as clearing the LinkCache.

Since we have to pick a winner, and the choice is mostly arbitrary since
it's not possible to tell which is fresher, I think LinkCache is a better
choice since the lifetime of its cache entries can be controlled.

Change-Id: I0add48463341e56fe8c155b1007487278ad2705d
2013-06-11 08:58:32 +02:00
Brad Jorsch
fc989b468d Add user rights 'editmyuserjs' and 'editmyusercss'
These are needed for OAuth grants.

Change-Id: I52f8e4a5cb48573cb2dbc26fc508e61a95d748c3
2013-06-10 15:44:22 -04:00
Platonides
5e48bc1cc7 Remove unused global
Follow-up 22eb569

Change-Id: I2c34b1f02c7304bd6864a7402c8be0ab313c7162
2013-06-04 23:40:30 +02:00
Tyler Anthony Romeo
7120504bb9 Add TitleQuickPermissions hook to Title::checkQuickPermissions
Currently Title permissions hooks get called after
Title::checkQuickPermissions, preventing users from
overriding quick permission checks. Added a hook to
allow this. Needed for bug 45898.

Change-Id: Id672270741282778815b06eff8b234ca4d819744
2013-05-24 19:37:01 +00:00
jenkins-bot
7106407580 Merge "TitleSquidURLs hook for changing the URLs to purge" 2013-05-21 20:06:10 +00:00
daniel
e311f6f868 TitleSquidURLs hook for changing the URLs to purge
This allows extensions to purge derivative resources that need
updating when a wiki page is changed.

Change-Id: Ic28ce7f57f29376b041627288979981fcb218a44
2013-05-21 20:01:55 +00:00
Tyler Anthony Romeo
22eb569fb4 Fixed behavior of Title::invalidateCache.
Removed actions that should not be in Title::invalidateCache,
specifically the clearing of the InfoAction cache, and added
those actions to their appropriate locations.

Added a new method InfoAction::invalidateCache that clears the
cache for a given title.

Bug: 46816
Change-Id: Ic12c66446c0d71f567dceb5d4630382ff41ad8bf
2013-05-21 10:41:42 -07:00
Timo Tijhof
4bd5471ca3 docs: Remove odd colons after @todo
Most were this way already:
https://doc.wikimedia.org/mediawiki-core/master/php/html/todo.html

Ran a find/replace on the odd ones. Also made them all
lower case.

Change-Id: I70c6a69344ddebc603e9a1c1d87e3cc4f4f4c560
2013-05-15 06:23:40 +00:00
Alexandre Emsenhuber
7053baca03 Remove "will be removed in ..." comments
All of them are wrong, since 1.20 is out for a while now, and
these methods are still here.

Change-Id: I3b59b61490c9aea5252e25623b0b282295dcc3f6
2013-05-11 22:04:21 +02:00
Tim Starling
45ce72f907 Revert "Fixed behavior of Title::invalidateCache."
Causes jenkins build failure

This reverts commit 3b4c514efa

Change-Id: Ieeb54f1e7a9cfb5ac02b8a9f49bbe0644a064fa0
2013-05-06 00:52:46 +00:00
Tyler Anthony Romeo
3b4c514efa Fixed behavior of Title::invalidateCache.
Removed actions that should not be in Title::invalidateCache,
specifically the clearing of the InfoAction cache, and added
those actions to their appropriate locations.

Added a new method InfoAction::invalidateCache that clears the
cache for a given title.

Bug: 46816
Change-Id: I38ac616d2e99fb339aca33425745368ba85b6350
2013-05-06 00:21:25 +00:00
Aaron Schulz
db11362b97 Avoid use of __METHOD__ in closures.
Change-Id: If633400bc915e3e0582d420826c30761678f4878
2013-04-26 15:50:06 -07: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
Platonides
e371ba1ef6 Remove globals unneeded after 47d1060
Change-Id: I39b6fa829e0d6ea7861b06edd8f5c599edcf4b76
2013-04-25 16:31:01 +02:00
Kevin Israel
47d1060398 Remove is_numeric check from Title::checkUserBlock
This should allow the usernames of administrators such as "7"
to show correctly on permissions error pages.

I extracted the working code from UserBlockedError::__construct
into a separate method Block::getPermissionsError, called from
both places with context provided as an argument.

Additional changes to get the test suite to pass are included.

Bug: 46768
Change-Id: I49d973992a99e03b4e8de112b47b737037a85338
2013-04-24 01:05:23 +00:00
Aaron Schulz
4738bc315a Moved Block and Title purgeExpired() functions to onTransactionIdle().
Change-Id: I82b2f4689a42481cd2a476351354f55ded581ff5
2013-04-18 22:53:28 +00:00
Ori Livneh
0bb7a68398 Fix @return type hint for Title::newFromID
Change-Id: I7f9ff81b91dcabb68c9c86eedf391b3e6160c6d4
2013-04-18 14:57:03 -07:00
umherirrender
dbd0b590e9 else if -> elseif
Also fixed some spacing while at it
Added some braces for one line statements

Change-Id: Iebfa2b17091509daabc76248121c7763e2295d20
2013-04-17 16:52:47 +02:00
Hashar
572ee81c0b Revert "Remove is_numeric check from Title::checkUserBlock"
Breaks unit testing (see bug 47031). The commit managed to land in
the branch because of a bug in Jenkins (bug 46723).

This reverts commit 8cc0b601aa

Change-Id: I4b3fadccaae9c35964a0c47d63b22c4f35148a24
2013-04-09 08:20:12 +00:00
Kevin Israel
8cc0b601aa Remove is_numeric check from Title::checkUserBlock
This should allow the usernames of administrators such as "7"
to show correctly on permissions error pages.

I extracted the working code from UserBlockedError::__construct
into a separate method Block::getPermissionsError, called from
both places with context provided as an argument.

Bug: 46768
Change-Id: Ic3fa926a5a4c109faff35fffbccb60fb06ea4a18
2013-04-09 02:40:35 +00:00
Reedy
38dd67f747 bug 42649 - PHP Fatal error: Call to a member function isLocal() on a non-object in Title.php
Change-Id: Ie6027c818785b12f6be9c47caab77ffa4a587a79
2013-04-08 23:29:57 +01:00
umherirrender
42b711ec0a Fix doc and deprecated warning of Title::fixUrlQueryArgs
Break long line

Change-Id: Iaeef8ce87c3ffd4609651f7cc0e8340a0f4bebfc
2013-04-08 19:28:54 +00:00
Aaron Schulz
5b77487e85 Deferred page_touched update via onTransactionIdle.
* This should reduce deadlocks and lock wait timeouts.

Change-Id: I595bc33d7643e7964d796b1d3da31f7cfab55024
2013-04-02 23:35:36 +00:00
Alexandre Emsenhuber
15833dafdf Fix case of some Title methods
Change-Id: I1a37ffb0e8cde4deac027721b0e463585b58d634
2013-03-26 10:54:15 +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
Aaron Schulz
e8e2474c8f Revert "Misc follow-ups to I2fc3966e (a161c5e)"
That apparently caused bug 46397.

This reverts commit 388b14a15d


Bug : 46397
Change-Id: Ideaa86f0d535873a08e27d6f98f6bd4255b8c594
2013-03-22 21:24:58 +00:00
Aaron Schulz
8608787897 Call loadFromRow() as needed in Title::moveToInternal.
* Follows up 61c0064de5,
  which was missing a load call to fully fix the bug.
  Calling loadFromRow() forced the page to load as
  non-existing (which it should be).
* The redirect title was triggering a load from a slave in
  updateRevisionOn() and wrongly updating the destination page
  to point to the redirect revision and leaving the redirect
  page with page_latest=0;

Bug : 46397
Change-Id: Id6abe062a0266a790716df8c592911fd89b83223
2013-03-21 23:31:53 +00:00
Aaron Schulz
61c0064de5 Call loadPageData() as needed in Title::moveToInternal.
* This avoids use of a slave for loading the page ID to do
  the updates using $newpage. That bug prevented page moves
  by using the old 0 ID and throwing an exception.

Bug: 46397
Change-Id: Iea3259dce6840e3f2959d98a20177acd60433b64
2013-03-21 14:18:58 +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
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
cd4dd7ca85 Correct case of Title::getPrefixedDBkey() calls
Change-Id: Ic9ef0cc6dbb0a8eb0ee93432299ef59759223e2c
2013-03-09 21:14:22 +01:00
Reedy
c3e4057e06 Kill off numerous unused variables
Change-Id: I7039f1328f37ee669b694f73ee282602186bffd1
2013-03-08 02:36:24 +00:00
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
Siebrand Mazeland
9b7889b84b Use American English spelling for behavior
Spotted in ipbreason-dropdown by Shirayuki.

Change-Id: I576ed4bc0abe5ab980aaee3fb9f9e4b43087311f
2013-03-04 10:24:57 +01:00
umherirrender
183b4dbedb Added missing @deprecated doc to File and Title
Change-Id: I32bd054e97905a5a763e47daecf4be615981a3ff
2013-02-27 07:26:24 +00:00
jenkins-bot
32b58ee118 Merge "Misc follow-ups to I2fc3966e (a161c5e)" 2013-02-25 08:55:30 +00:00
Antoine Musso
c5d757b97a style: indent tweaks to Title.php
Title.php had some indentation oddities with mixed tabs and spaces. This
patch tweak the whitespaces and sometime explode boolean logics to have
a more consistent style.

Change-Id: I891c112236a021d9b4e38eb57eeb3b232172139c
2013-02-20 15:43:25 +00:00
Alexandre Emsenhuber
388b14a15d Misc follow-ups to I2fc3966e (a161c5e)
- Also add LinkCache::addLinkObj() calls to isRedirect(), getLength() and getContentModel()
- Changed error messages when LinkCache returns null, since this really should not happen anymore
- Removed incorrect comments
- Only use the value of the member variable if GAID_FOR_UPDATE is not passed
  (for consistency between the three methods)
- Mark tests that need database access as such due to the call to Title::getContentModel()
  (generally called through Parser::getFunctionLang())

Change-Id: I84e0c47cdf7412f2b7fa5f296d066b64b7bbfd42
2013-02-18 13:31:55 +01:00
umherirrender
ddc817560c Fix check of return value from SpecialPageFactory::resolveAlias
Calling SpecialPageFactory::resolveAlias with an invalid special page
name, gives an array( null, null ) back, but this part of code checks
explicit against !false, which gives always true. Changed the condition
to use an (implicit) check, like the other places, where
SpecialPageFactory::resolveAlias is called.

Change-Id: I8def9dd88ebfbe9fcf1ba8f9cae9e25039ec77ed
2013-02-18 08:50:02 +00:00
IAlex
5572b8644f Merge "Add some missing readonly checks:" 2013-02-10 13:16:50 +00:00
umherirrender
f3cf109e62 remove space before semicolon
Change-Id: Ic0d890f5e27cec017c7f7910a67d53b2edf82079
2013-02-09 22:44:24 +01:00
umherirrender
e577cc985e Title.php: replace some '*' with explicit fields in selects
It is good practice to select only fields which are used later

Change-Id: Ie0075f2c2bbc4408f8d9b8967669d8c729b31914
2013-02-09 19:10:55 +01:00
umherirrender
bcea44e64a Add some missing readonly checks:
* Do not allow working on Special:EditWatchlist
* Do not reset all notification markers
* Do not delete expired restrictions

Change-Id: I7a990c0a80b9c7a6340465dd082a110dafea8f14
2013-02-09 18:58:56 +01:00
umherirrender
1044b0b8df fix some spacing
Change-Id: I8f976013f33c5818e4402604fe8610aa3f43b0c6
2013-02-04 20:18:33 +00:00
Alex Monk
c2c982c4e8 (bug 36537) Rename calls to wfArrayToCGI to wfArrayToCgi
Done with this command:
grep wfArrayToCGI * -R -l -Z | xargs -0 -l sed -i -e 's/wfArrayToCGI/wfArrayToCgi/g' && git checkout -- HISTORY

Change-Id: If7f4d4bfc199289c11c43cf519c2415a1aad1c51
2013-01-28 18:04:20 +00:00
nullspoon
550b878e63 Whitelisting publicly readable title with regex
This patch make it possible to whitelist pages which anonymous users may
see. It is similar to $wgWhitelistRead expect it uses regular
expressions, the list of regex are to be added in the new global array
$wgWhitelistReadRegexp.

This would be useful in a semi-public team wiki situation where the
admin would want to hide an entire namespace from everyone except those
in a particular group due to sensitive team specific information.

Added new unit test testUserCan in includes/TitleTest.php to
test this new functionality.

* adds $wgWhitelistReadRegexp to DefaultSettings.php
* updates RELEASE-NOTES-1.21 new features
* updates CREDITS

Signed-off-by: Antoine Musso <hashar@free.fr>

Change-Id: I83f6a614874c3d289ff4bd8d015f1d9c92e500b6
2013-01-28 14:38:37 +01:00
umherirrender
6fbbbd17ca fix some spacing
Change-Id: Ie7bb35871cc99237f3a655f7db22ca1f0646df5e
2013-01-27 14:21:50 +01:00