Commit graph

1173 commits

Author SHA1 Message Date
Platonides
34d35fb6f9 Use only the page relevant pieces in the parser cache key. Eg. two users with different math options will now
use the same parsercache entry for articles without <math> tags.
The cache key format is kept as a fallback so the old cached entries can be reused.

Should boost parsercache hits, but it also makes easier to pollute the parsercache by tag hooks that behave 
badly, directly using $wgUser or $wgLang.

Extensions hooking PageRenderingHash now see !edit=0 and the !printable=1 bits.

Fixes bug 24714 - Usage of {{#dateformat: }} in wikis without $wgUseDynamicDates can lead to unexpected results

Builds upon r70498, r70498, r70501, r70517, r70651, r70653, r70765, r70780.
2010-08-09 21:53:21 +00:00
Tim Starling
cc9f81ed94 * Revert r66878, completely misses the point of factoring out doEdit() in the first place, which was to separate the UI layer from the backend layer, to support callers with alternate UIs or no UIs.
* Reverted followup 66880.
* Reverted dependent changes r67752, r68606, r68608, r68609. The point of deprecating insertArticle()/updateArticle() was to allow the UI code to be moved to EditPage. If you move that exact EditPage-specific functionality back into Article::doEdit(), and call it from all sorts of non-EditPage places, then we'll hit the same sorts of bugs we had before r14834.
2010-08-09 08:33:42 +00:00
Tim Starling
f05145c821 Per CR r52888, have Article::getParserOptions() clone the object itself, so that the caller doesn't have to do it. 2010-08-09 07:41:25 +00:00
Chad Horohoe
4c74490bb8 Big commit: kill almost every freeResult() call as useless 2010-08-08 12:27:48 +00:00
Platonides
6d452cd317 Some minor changes I had in my working copy. 2010-08-07 22:17:00 +00:00
Alexandre Emsenhuber
0a3d8dc0d3 Per comments, follow-up to r70278: make patrol tokens compatibles between api and normal interface 2010-08-07 18:56:52 +00:00
Platonides
7bfebad308 Change quickUserCan( 'edit' ) and getIsPrintable() into setEditSection( false )
Follow up r48544. Init ParserOptions::mIsPrintable in initialiseFromUser()
Move the "No edit section it's printable" from Parser to Article.
This leaves getIsPrintable() unused. Left there for extensions (none seems to be using it, could be removed).

The "even if the user has them on" comment wasn't accurate. The user preference only controls them via CSS.
Anyway, it would work as expected now if it got moved into ParserOptions. The setEditSection() no longer set it to true.

Remove the quickUserCan( 'edit' ) which is just a hidden way of calling $wgUser from the Parser to be explicitely 
done in Article to disable the editsection. This results in quickUserCan being called once instead of twice if $wgUseETag == true;.
2010-08-05 14:37:50 +00:00
Platonides
121bb4f03e http://www.mediawiki.org/wiki/User:Catrope/Stub_threshold shows us people setting it to insanely large values trying to disable it.
r70433 addressed the UI. Here we proxy its access via a new method getStubThreshold() that disables it if a page of such size cannot be 
created (by an user), so we can serve them parser cached articles again.
2010-08-03 22:32:09 +00:00
Platonides
a9b5c1402c Remove all calls to $wgMessageCache->loadAllMessages()
Deprecated and empty since r52503
2010-08-03 19:15:43 +00:00
Max Semenik
ef733eac11 Removed Article::getRobotPolicyForView() - deprecated and not used anywhere 2010-08-02 18:51:18 +00:00
Alexandre Emsenhuber
3f6432ff1e * (bug 24418) action=markpatrolled now requires a token 2010-08-01 15:50:30 +00:00
Platonides
336db41f87 Finish fixing r69883 2010-07-27 18:47:30 +00:00
Platonides
1af741ee27 Use the canonical names for classes. 2010-07-27 18:33:04 +00:00
Siebrand Mazeland
7800599650 Partial revert of r69883. Broke page deletion because of missing global.
Nikerabbit suggested complete revert of r69883.
2010-07-27 17:23:06 +00:00
Platonides
b906f72da0 Mark used $wgUser as global.
$wgLang of 2917 already marked as global in 2889. Ditto for $wgDeleteRevisionsLimit of 2927.
$wgContLangmarked as global twice in getAutosummary

Are you able to catch the global declared twice left?
2010-07-25 17:56:23 +00:00
Sam Reed
5fd23ed8b5 More unused globals 2010-07-25 17:47:41 +00:00
Sam Reed
ddf8405c14 Remove various unused globals
Add missing global $wgUser;
2010-07-24 19:11:34 +00:00
Roan Kattouw
8d4c81e306 Followup to r51583: actually use the rd_interwiki and rd_fragment fields, in the spirit of r33133: we now use the redirect table as a cache for redirect targets, no longer pulling the page text from ES for every logged-in redirect view. Old-style redirect table entries with NULL for fragment and interwiki are automatically updated when the redirect is visited or edited. 2010-07-08 10:49:36 +00:00
Niklas Laxström
e7d77ad5f3 Extra whitespace which annoys me 2010-06-30 07:42:07 +00:00
Niklas Laxström
22ba137a6a Code cleanup 2010-06-28 07:17:16 +00:00
Matěj Grabovský
d1bec9cbf2 Follow-up r68606, per comments:
* Made proper use of Article::doEdit's return value (hopefully)
2010-06-26 19:52:52 +00:00
Matěj Grabovský
beb7b8fe3b (bug 18891) Deprecated Article::insertNewArticle still used in core 2010-06-26 13:25:08 +00:00
Max Semenik
edc40d10fa Fixed hit counter on SQLite 2010-06-18 19:39:08 +00:00
Alexandre Emsenhuber
fa537d2d3f Fixed some doxygen warnings 2010-06-15 20:09:19 +00:00
Platonides
b81bae03d0 Add page_latest to the LinkCache. 2010-06-15 12:14:54 +00:00
Alexandre Emsenhuber
cf9f80d3e9 * Fix for r67185: cache the page if caching is allowed, not the opposite :)
* also removed useless check for $this (can this ever be false?)
2010-06-10 15:37:04 +00:00
Bryan Tong Minh
26fa8cb9f1 Return some more verbose error messages when editing fails using the API. Added wfDeprecated to Article::updateArticle() and used the Status result from Article::doEdit directly in EditPage::internalAttemptSave. 2010-06-09 19:52:11 +00:00
Happy-melon
27dae679b9 Follow-up r67230 - be consistent in use of IDs rather than classes. 2010-06-02 19:47:28 +00:00
Raimond Spekking
22bb560509 Bug 23733 - Add IDs to messages used on CSS/JS pages 2010-06-02 19:30:55 +00:00
Alexandre Emsenhuber
5f1f15c357 * (bug 23740) Article::doRedirect() now use $extraQuery parameter correctly if the $noRedir parameter is set to true 2010-06-01 15:19:19 +00:00
Daniel Kinzler
36c68af119 allow parser/extensions to control for how long a ParserOutput gets cached. Introduced updateCacheExpiry(), Cleaned up use of getCacheTime() for marking uncacheable objects. 2010-06-01 14:28:51 +00:00
Alexandre Emsenhuber
fd1192ef5a Per jabowery1's comment on IRC: Article::followContent() doesn't exist, changed to Article::followRedirect() 2010-05-30 18:09:03 +00:00
Tobias
d73fb3713e New feature RevisionMove (bug 21312). Introducing SpecialRevisionMove.php and revisionmove permission. Experimental, use at own risk (no group has this permission by default, so it should not break anything unless you are foolish enough to experiment with it :)) 2010-05-30 18:00:01 +00:00
Aryeh Gregor
74a21f3bd1 Remove most named character references from output
Recommit of r66254 to trunk.  This was just

find extensions phase3 -iname '*.php' \! -iname '*.i18n.php' \! -iname 'Messages*.php' \! -iname '*_Messages.php' -exec sed -i 's/&nbsp;/\&#160;/g;s/&mdash;/―/g;s/&bull;/•/g;s/&aacute;/á/g;s/&acute;/´/g;s/&agrave;/à/g;s/&alpha;/α/g;s/&auml;/ä/g;s/&ccedil;/ç/g;s/&copy;/©/g;s/&darr;/↓/g;s/&deg;/°/g;s/&eacute;/é/g;s/&ecirc;/ê/g;s/&euml;/ë/g;s/&egrave;/è/g;s/&euro;/€/g;s/&harr;//g;s/&hellip;/…/g;s/&iacute;/í/g;s/&igrave;/ì/g;s/&larr;/←/g;s/&ldquo;/“/g;s/&middot;/·/g;s/&minus;/−/g;s/&ndash;/–/g;s/&oacute;/ó/g;s/&ocirc;/ô/g;s/&oelig;/œ/g;s/&ograve;/ò/g;s/&otilde;/õ/g;s/&ouml;/ö/g;s/&pound;/£/g;s/&prime;/′/g;s/&Prime;/″/g;s/&raquo;/»/g;s/&rarr;/→/g;s/&rdquo;/”/g;s/&Sigma;/Σ/g;s/&times;/×/g;s/&uacute;/ú/g;s/&uarr;/↑/g;s/&uuml;/ü/g;s/&yen;/¥/g' {} +

followed by reading over every single line of the resulting diff and
fixing a whole bunch of false positives.  The reason for this change is
given in <http://lists.wikimedia.org/pipermail/wikitech-l/2010-April/047617.html>.
I cleared it with Tim and Brion on IRC before committing.  It might
cause a few problems, but I tried to be careful; please report any
issues.

I skipped all messages files.  I plan to make a follow-up commit that
alters wfMsgExt() with 'escapenoentities' to sanitize all the entities.
That way, the only messages that will be problems will be ones that
output raw HTML, and we want to get rid of those anyway.

This should get rid of all named entities everywhere except messages.  I
skipped a few things like &nbsp that I noticed in manual inspection,
because they weren't well-formed XML anyway.

Also, to everyone who uses non-breaking spaces when they could use a
normal space, or nothing at all, or CSS padding: I still hate you.  Die.
2010-05-30 17:33:59 +00:00
Siebrand Mazeland
5c1630efa7 Ran stylize.php, removed trailing whitespace, updated indentation and code formatting. 2010-05-30 14:28:54 +00:00
Platonides
b608000544 Bug 23699: Add trailing \n at the end of <div>s in wrapWikiMsg()
Patch by Umherirrender
2010-05-28 21:22:45 +00:00
Platonides
a4698cf20b Follow up r65027. Use wfMsgForContent, the message is fully in Content language as we may not have a $wgUser here. 2010-05-27 16:35:59 +00:00
Happy-melon
42f68e4b1a Follow-up r66878 per CR. 2010-05-25 17:04:57 +00:00
Happy-melon
bfd17608db (bug 23641) refactor code around Article::doEdit(), and restored access to watch/unwatch settings to ArticleSaveComplete hook, removed in r14834 AFAICT. Patch by Tisane. 2010-05-25 16:40:02 +00:00
Aaron Schulz
fb29f7b1af * Removed leftover token check of unhide=1 that was removed elsewhere
* Diff doc tweak
2010-05-24 18:15:52 +00:00
Mark A. Hershberger
ec31dd602e Start adding support for leaving user's messages. Begin using it in UploadFromUrl.php
In the end, we should probably use a template if its around and do something sane with the subject line if not.
2010-05-14 20:36:23 +00:00
Tobias
1161315085 fixing documentation (it seems the function name has changed) 2010-05-01 10:56:52 +00:00
Philip Tzou
a1a63d4d8d Follow up r64876. Try to fix pagetitle-view-mainpage. 2010-04-11 13:04:58 +00:00
Tim Starling
7dc30f7aea Fix for issue noted on CR r64876: fatal error on CSS/JS subpage display 2010-04-10 23:52:07 +00:00
Alexandre Emsenhuber
5301d480de * fixed some doxygen warnings 2010-04-10 21:14:49 +00:00
Tim Starling
3a2345fe1c Proposed cleanup of recent LanguageConverter-related commits:
* Moved the responsibility for calling $wgOut->setPageTitle() from OutputPage::addParserOutputNoText() to the OutputPage/Parser caller. Previously, every call to $wgOut->addWikiText() (or any other message parsing function) was resulting in the title being reset to a converted version of $wgTitle, producing bug 23124. Moving responsibility to the caller seems to work fairly well, since there are apparently only two callers that really want {{DISPLAYTITLE}} etc. to work (EditPage and Article::view). 
* Reverted data flow obfuscation in OutputPage::setHTMLTitle() from r64851, replaced by the above. The caller decides what overrides what.
* Reverted inappropriate, cache-polluting references to $wgUser and $wgRequest in Parser::parse(), introduced in r64819.
* Reverted incomprehensible boolean parameter to Language::convert() from r64851, reintroduced Language::convertTitle() instead. Gave it a simpler implementation than before.
* Fixed broken {{DISPLAYTITLE}} feature, was being unconditionally overwritten by the ParserOutput::setTitleText() call in Parser::parse(). Give {{DISPLAYTITLE}} precedence over autoconverted title, like we do for -{T|...}-.
* Tested extensively (perhaps not exhaustively)
2010-04-10 13:38:50 +00:00
Alexandre Emsenhuber
08ea1edfea Removed call to Title::invalidateCache() from Article::addTrackbacks(), this makes the page uncacheable if $wgUseTrackbacks is true 2010-04-03 07:46:12 +00:00
Alexandre Emsenhuber
07171f23dd Per Nikerabbit, follow-up to r64522: use __METHOD__ 2010-04-02 19:51:21 +00:00
Alexandre Emsenhuber
c779e80b43 Fix notice: Use of undefined constant __FUNC__ - assumed '__FUNC__' in /Library/WebServer/Documents/phase3/includes/Article.php on line 1039 2010-04-02 17:32:56 +00:00
Alexandre Emsenhuber
bfdbcfbcf9 Removed unused variable 2010-04-01 12:05:46 +00:00