Commit graph

1247 commits

Author SHA1 Message Date
Tim Starling
7222fb59d6 Revert r79122, causes bug 27891 (old version seen immediately after edit). 2011-03-14 04:26:52 +00:00
Happy-melon
3d161feebf Follow-up r83755: @deprecated @since is wrong, doesn't have the expected semantic meaning. 2011-03-12 18:14:33 +00:00
Alexandre Emsenhuber
33f66d157b Skip a part of useless code when redirecting because of getOldIDFromRequest() or showing a diff page 2011-03-12 14:21:41 +00:00
Alexandre Emsenhuber
08861c5638 Only call User::getSkin() when necessary.
(With this, a parser cache hit on action=render may not load the skin at all)
2011-03-11 14:31:12 +00:00
Mark A. Hershberger
b3df4babc2 misc w/s cleanups, “svn diff -x-w” clean 2011-03-08 18:12:17 +00:00
Alexandre Emsenhuber
a526d19f20 Follow-up r83240: seems people prefer returning false than the current version when no revision with given ID is found 2011-03-05 17:55:21 +00:00
Alexandre Emsenhuber
0c99ecc6f2 * (bug 27763) Article::getParserOutput() no longer throws a fatal given when an incorrect revision ID is passed 2011-03-04 20:16:35 +00:00
Sam Reed
28f7bf1f2b Followup r82727, improve comments, cast return value to bool 2011-02-24 16:00:06 +00:00
Ryan Schmidt
6bac96af7e * random redirect-related fixes:
** automatically add redirect=no to all links on the redirect page in Article::viewRedirect.
** properly check if redirects are enabled if $wgMaxRedirects < 1 (moved check from Title::newFromRedirectArray to Title::newFromRedirectInternal).
2011-02-22 16:39:17 +00:00
Platonides
dae94d2472 Follow up r63584. The change of resetArticleID() could have all kinds of
side effects, given that it stops lazy cache fillings.
2011-02-18 23:44:18 +00:00
Alexandre Emsenhuber
67d91714f6 * Don't use assignment in a condition check
* Pass the Title object so that it doesn't rely on $wgTitle
2011-02-17 17:06:06 +00:00
Mark A. Hershberger
b4cee86beb w/s fixups 2011-02-12 04:06:22 +00:00
Platonides
d9bcf39e34 Convert the if into an early exit. Whitespace ignoring diff recommended. 2011-02-10 17:13:12 +00:00
Platonides
49074e8a56 Yet more additions of wfProfileOut() 2011-02-10 16:39:53 +00:00
Daniel Friesen
b4d811d659 Fix bug slightly caused by moving legacy code out of the Skin class. The Article class was calling the legacy Skin::historyLink in a very ugly way (ie: having it's own mTitle, but relying on whatever title just happened to be set on the skin that it grabbed). 2011-02-08 01:15:50 +00:00
Alexandre Emsenhuber
136f4c06fa Deprecated wfMsgWeirdKey(), use wfMessage() instead. Moved getDefaultMessageText() from Article to Title so that it can be used there instead of duplicating code. No usage in extensions. 2011-02-05 15:11:52 +00:00
Alexandre Emsenhuber
61accbc57a Follow-up r81456: forgot to remove a global declaration 2011-02-03 15:31:38 +00:00
Alexandre Emsenhuber
a58b7f5139 * Use wfMessage() instead of wfMsgGetKey() and wfEmptyMsg()
* Factorise common code
2011-02-03 15:29:13 +00:00
Alexandre Emsenhuber
51c6afc751 * Replaced $wgMessageCache by MessageCache::singleton(); since we only use one instance of this class (as for ParserCache, LinkCache)
* MessageCache::singleton() calls wfGetMessageCacheStorage() directly instead of using $messageMemc, just in case this would be called before that variable is set
* Per TimStarling: also removed deprecated methods in MessageCache class: addMessages() and related, [get|set|enable|disable]Transform(), loadAllMessages(), loadMessageFile() and some others. Same for the legacyData stuff in LocalisationCache that was only used by MessageCache::addMessages() and related. 
* Converted remaining extensions
2011-01-26 15:42:04 +00:00
Robert Leverington
2a30aa1d25 Add new hook ArticlePrepareTextForEdit, called when preparing text to be saved.
Add new parser option "PreSaveTransform" that allows the pre-save transformation to be selectively disabled.
2011-01-16 21:12:26 +00:00
Alexandre Emsenhuber
151e665515 Added wfDeprecated() to Article::insertNewArticle() and Article::updateArticle(). The last usage of these two methods was removed in r80402. 2011-01-15 16:07:49 +00:00
Alexandre Emsenhuber
10c8ebb2e7 Added ArticleViewFooter hook to allow extensions adding additional items to the footer of normal views 2011-01-14 21:54:29 +00:00
Daniel Friesen
39ab3cfc9f Implement Message::isBlank and Message::isDisabled.
And while we're at it... update a random assortment of code using wfEmptyMsg to use the new wfMessage class and our exists/isBlank/isDisabled methods.
2011-01-14 10:51:05 +00:00
Alexandre Emsenhuber
67aa77d6b1 Set $mRevision to null by default so we don't need the isset() call 2011-01-12 12:50:46 +00:00
Alexandre Emsenhuber
dd32f9c57d Be sure to use the latest rev id and not whatever getRevIdFetched() could be 2011-01-10 08:33:19 +00:00
Alexandre Emsenhuber
c52cf288d4 Fix for r79874: only set $mRevIdFetched from fetchContent(), it was overriden by the loadLastEdit() call in getRevIdFetched() for old versions which caused it to be always the latest rev id 2011-01-09 17:41:42 +00:00
Alexandre Emsenhuber
80bbce5524 Kill Article::$mCurID, not set anywhere, not used anywhere (including extensions) 2011-01-09 12:01:58 +00:00
Alexandre Emsenhuber
463b0b3f2c Fix typo from r79874 2011-01-09 11:48:10 +00:00
Alexandre Emsenhuber
a0d541474d Changed to calls to Article::getContent() to Article::getRawText():
- in Article::insertRedirect(): if this will be saved in the redirect table, it should only be checked with the current text (in fact this is never called when viewing an old revision, but just in case someone breaks this)
- in Article::prepareTextForEdit(): as for Article::doEdit() this should be actual page's contents
2011-01-09 11:46:15 +00:00
Alexandre Emsenhuber
bf31a123db Only set $mUser, $mUserText, $mComment and $mTimestamp fields in fetchContent() if we have loaded the latests revision 2011-01-08 20:07:18 +00:00
Happy-melon
355717054f Remove ancient deprecated functions:
* Article::getDB(), deprecated in 1.13 (r36334)
* Article::showArticle() - 1.7 (r14809)
* User::SetupSession() - 1.8 (r15823)
* User::isBot() - 1.8 (r15689)
Annotate other deprecated functions with @since <version>
2011-01-06 18:04:04 +00:00
Happy-melon
64038e5f0d name attribute is invalid on <tr>s, and long-since deprecated generally. 2011-01-06 17:22:38 +00:00
Happy-melon
e6c1611379 More documentation formatting 2011-01-06 15:55:56 +00:00
Alexandre Emsenhuber
625b4216e5 Run preSaveTransform() with the user that did the edit, not unconditionally $wgUser 2011-01-04 19:08:44 +00:00
Tim Starling
ccfe5ad97b Fix for bug 26561: clickjacking attacks. See the bug report for full documentation. 2011-01-04 06:12:33 +00:00
Alexandre Emsenhuber
03dfa9f60c * Modified Article::loadPageData() to use a slave database connection and pageDataFromTitle() instead of pageDataFromId() in the default case, as in Wiki.php (this also saves a query since the ID will be fetched with other fileds)
* Removed the loadPageData() call for the initial article in Wiki.php, will be triggered by the isRedirect() call 7 lines below if needed (this was not needed if $target is set by the InitializeArticleMaybeRedirect hook), but kept the second one (same as above, Article::exists() triggers Title::getArticleId() that would use one query to get id and a second one is needed to get the complete page data)
* Modified Article::fetchContent() to use common code (loadPageData()) and to only call it if really needed
2011-01-03 19:50:01 +00:00
Alexandre Emsenhuber
5cc90de1a1 Just call loadPageData() if not already done to get the $mIsRedirect flag in Article::isRedirect() instead of doing a lot of useless stuff 2011-01-03 18:15:44 +00:00
Alexandre Emsenhuber
a2653cd21b no need to set $this->mOldId, this is already done in getOldID() 2011-01-03 17:12:27 +00:00
Sam Reed
102299eb9d Document getParserOutput() return type in Article 2011-01-01 22:46:23 +00:00
Alexandre Emsenhuber
8d3285fee1 Made the page_count update defered, as for the site_stats update. I just removed Article::incViewCount() since nothing else was calling this function. 2011-01-01 16:58:00 +00:00
Platonides
ed4c31bd4d (Bug 26458) Section edit links appear on pages that user does not have right to edit ( 2010-12-29 16:42:46 +00:00
Platonides
e2e210e2de Fix bug 14404. The articles are now always saved with the default options.
Most importantily, articles with {{int:X}} will now have consistent table 
links no matter the language of the last saving user.
Existing articles with broken tables will be updated on a null edit (a purge is not enough).

Test added in r79121.
2010-12-28 18:44:32 +00:00
Platonides
779b87e1df Play safe and clear the article object internals, too (eg. mTouched). 2010-12-28 18:16:46 +00:00
Platonides
7663fdd44a Remove ParserOptions clonations, already cloned in getParserOptions().
Ref r70783
2010-12-26 19:23:11 +00:00
Happy-melon
6b5d1c1c0e Revert rollback implementation of r78585, r78599. The way the API is set up, it's not possible to have some tokens on the new system and some on the old. 2010-12-20 19:03:00 +00:00
Happy-melon
ff2f6606b0 Follow-up r78585: Make Token::PERSISTENT the default, so no need to specify it. That will be more usual, I expect. 2010-12-19 15:23:22 +00:00
Happy-melon
e0bec9555e Merge in Token class from my branch; would like some second opinions on the concept. This seeks to replace the much-abused $wgUser->editToken() token generator, 90% of the uses of which are not for editing but rather general actions.
Implemented for rollback mainly as a proof-of-concept; obvious further targets are patrol links and HTMLForm.
2010-12-18 23:07:30 +00:00
Alexandre Emsenhuber
9cb3299aee Checking permissions for $wgUser while doing an edit with another user is not a good idea 2010-12-14 19:40:27 +00:00
Platonides
f3aabaa1f7 Do not access to mTouched internals of Article from a different module per r70783#c12039 2010-12-14 17:49:01 +00:00
Alexandre Emsenhuber
1b1cd0a8bc Removed trailing whitespaces 2010-12-13 19:47:34 +00:00