Commit graph

578 commits

Author SHA1 Message Date
Aryeh Gregor
d2bf30bbdd Experimentally enable HTML 5 doctype
Per wikitech-l discussion.  This also removes a <meta> tag that was
completely pointless, but theoretically required by XHTML 1, yet causes
the HTML 5 validator to complain.

Together with a few other recent commits, this should cause at least
Special:BlankPage to validate as HTML 5.  Real pages may still have some
invalid markup that should be fixed -- in a large majority of cases,
markup that was poor practice in XHTML as well.  (The Wikimedia
copyright icon needs to have border="0" removed for everything to
validate 100% on Wikipedia.)

By Brion's request, this is still behind a config option, and can be
disabled with $wgHtml5 = false;.  I expect we'll be able to remove that
option in the near future, once everyone is satisfied that changing two
lines of HTML output that all browsers have demonstrably ignored since
the Paleolithic won't cause all Wikipedia users' computers to undergo a
spontaneous uncontrolled fission reaction or something.
2009-07-10 04:19:51 +00:00
Tim Starling
1353a8ba29 Implemented the PoolCounter feature and did some general refactoring in the areas that it touched.
* Renamed Article::outputFromWikitext() to Article::getOutputFromWikitext()
* Factored out cascade protection updates
* Removed recently-added Article::tryParserCache(): misnamed, can be done in one line of code in the caller. Deprecated OutputPage::tryParserCache().
* Made some functions public instead of protected when they could be useful from hooks.
* In ParserCache, removed PHP 4-style ampersands

In Article::view():
* Factored out robot policy logic, "redirected from" header, patrol footer, diff page, revdelete header, CSS/JS formatting, footer, namespace header, missing article error
* Removed some variables, renamed some others, fixed incorrect use of empty()
* Used the refactored footer section to do a couple of early returns and unindent a massive if(!$outputDone) block
* Removed fantasy interpretation of $this->getContent()===false in comment
* Don't try the parser cache when ArticleViewHeader specified $outputDone=true
* Move timing hack to getOutputFromWikitext()
* Stop using $wgOut->parserOptions() with save/restore nonsense every time you want to change something in it. This is meant to be OOP.
* Don't overwrite the article text with an error message and then pretend to write it to the cache, that's confusing
2009-07-08 08:12:35 +00:00
Aryeh Gregor
c4012b03bc Unify MonoBook <head> generation with legacy skins
This was less work than I thought it would be.  The only possible
practical difference in MonoBook should be that some IE fixes are moved
down; at a glance, I don't see how this would hurt anything, but if it
does then some more hacks can be added to move them back up.

A bunch of whitespace was changed in both MonoBook and legacy skins.
Legacy skins had some stuff moved around in the <head>, but mainly to
better match MonoBook, so they should work better if anything, not
worse.  dir= was added to the <body> in legacy skins, matching MonoBook.
There should be no other practical differences.

I would strongly encourage people to port the Modern and Vector skins to
at least share the <head>-generation code like this.  I'd even more
strongly encourage people to totally rewrite the skin system, but that's
a bigger job.  :)
2009-07-07 21:49:45 +00:00
Andrew Garrett
480741ce4b Core changes for r52307 2009-06-23 21:52:39 +00:00
Siebrand Mazeland
6f9d6cbcf9 Fix double escaping issues. Related to r51559 and friends. 2009-06-15 12:32:59 +00:00
Siebrand Mazeland
33e4039aec Follow-up to r50822. Add id="mw-returnto" to allow styling. 2009-06-15 11:11:17 +00:00
Alexandre Emsenhuber
804d0b7d74 added tabs and new lines for better source readability 2009-06-09 12:34:09 +00:00
Siebrand Mazeland
38ca12aa82 * replace some use of deprecated makeKnownLinkObj() by link() in core
* use array type parameter instead of string to escapeLocalUrl(), getFullURL() and getFullUrl() for readability
* add FIXME in Parser.php and LogEventsList.php where I didn't know how to replace makeKnownLinkObj by link()
* return type for private method Skin::editUrlOptions() changed from string to array
* some code readability improvements

Linking this to r51559 for CodeReview as there is some discussion there, and these changes are very similar.

Todo: core special pages
2009-06-07 15:02:12 +00:00
Philip Tzou
8a2d96a4b3 Follow up on r51177. Need use is_array(). 2009-05-30 05:14:24 +00:00
Philip Tzou
5336b9ba6f 1. Follow up on r49157, r50902 and r50938. According RFC 2616 section 14.4, language code name should always use '-' but not '_'.
2. metadata 'keywords' should have all variant forms of keyword.
2009-05-30 05:07:46 +00:00
Niklas Laxström
281c378ee7 Work around parser madness, because I have no idea what is going on. The following renders each line as a paragraph:
<div>a
b
c/div>
2009-05-25 13:49:01 +00:00
Niklas Laxström
d3b61fea7c Escaping fixes 2009-05-22 09:35:48 +00:00
Siebrand Mazeland
545ecfa121 Fix typo in comment 2009-05-19 23:27:53 +00:00
Siebrand Mazeland
547858b7fe Use link() instead of deprecated makeLinkObj() where possible. 2009-05-08 23:24:31 +00:00
Robert Leverington
2aa0c02088 * Strict Standards: Cannot assign by reference.
Fix for previous commit.
2009-04-09 18:54:15 +00:00
Robert Leverington
4cf686c22c * Strict Standards: Only variables may be passed by reference.
Reference title object to variable before passing as a parameter.
2009-04-09 18:51:45 +00:00
Alexandre Emsenhuber
894650c3f7 * removed useless $wgUser and $wgOut globalisation
* fix for r49324: work arround E_STRICT: only variables should be passed by reference (OutputPage::getTitle() doesn't return a reference but OutputPage::addWikiTextTitle() want one)
2009-04-09 08:53:15 +00:00
Remember the dot
e4d211703c (bug 12998) Allow <sup>, <sub>, etc. in DISPLAYTITLE 2009-04-09 05:15:43 +00:00
Chad Horohoe
d5dd4044e5 Stage 2 of war on $wgTitle!! Make OutputPage, Skin and children rely on mTitle rather than $wgTitle. In theory, you could have an OutputPage/Skin that was referring to some title other than $wgTitle, unlikely though. In any case, make getTitle() return $wgTitle for now, just in case. 2009-04-09 02:22:36 +00:00
Chad Horohoe
2438e56741 Document OutputPage::out() 2009-04-07 18:21:07 +00:00
Tim Starling
43f0ff4469 In OutputPage::addScriptFile(): escape attributes for HTML. No XSS, just good practice. 2009-04-01 08:50:57 +00:00
Arash Boostani
c32a1ef480 Fixed bug #11213 - [edit] section links in printable version interfere with cut-and-paste of article text 2009-03-18 23:27:48 +00:00
Brion Vibber
ae98c49213 * (bug 17537) Disable bad zlib.output_compression output on HTTP 304 responses
Patch by ezyang - http://bug-attachment.wikimedia.org/attachment.cgi?id=5829
2009-03-18 21:26:57 +00:00
Aryeh Gregor
c6be9caca9 Remove more "?>" 2009-03-16 00:36:17 +00:00
Aryeh Gregor
cd99068dbe Avoid "?>", messes up some syntax highlighters 2009-03-16 00:34:46 +00:00
Aaron Schulz
6cd1a1b1d9 * Avoid double output on filecache failover
* XHTML fixes to error html
* Added isDisabled() to OutputPage
* Make sure filecache marks output done
2009-03-13 20:15:16 +00:00
Siebrand Mazeland
f66a0b97b0 * Use $wgLang->commaList( array ) instead of implode( ', ', array ) where possible
* remove a piece of commented out code in SpecialSearch.php
2009-03-08 19:40:09 +00:00
Roan Kattouw
ee408f0789 (bug 17538) Use local URLs in <link>s 2009-02-20 20:49:47 +00:00
Brion Vibber
92079d3b1c * (bug 16335) __NONEWSECTIONLINK__ magic word to suppress new section link.
Patch by Carlin: https://bugzilla.wikimedia.org/attachment.cgi?id=5680
With slight whitespace tweaks.
2009-02-19 22:14:59 +00:00
Alexandre Emsenhuber
f04183b0da Removed check for empty( $action ), seems to be old register_globals code, but since $action is set in index.php with
$action = $wgRequest->getVal( 'action', 'view' );
it can't match empty() in "normal" conditions
2009-02-04 19:43:30 +00:00
Philip Tzou
205ef1ba8b 1. Use param $ignoreOtherCond instead of $forTemplate and $ignoreSubmitCond in findVariantLink().
2. Drop some duplicate categories produced by findVariantLink().
2009-02-02 07:54:43 +00:00
Andrew Garrett
ed8623d113 Allow af_public_comments to be wikitext.
Relatedly, add parseInline function to OutputPage, to avoid duplicating the same awful regex in wfMsgExt.
2009-01-31 01:59:13 +00:00
Raimond Spekking
5f0a8c9561 Revert r46524 per Nikerabbits comment 2009-01-30 16:45:09 +00:00
Raimond Spekking
4b5874d606 Add a newline in front of the message to avoid wrong parsing when the message text starts with line-start-markup such as a table or list.
The missing newline was the real culprit of the breakage seen in http://www.mediawiki.org/wiki/Special:Code/MediaWiki/45651#c1531
2009-01-29 07:01:51 +00:00
Brion Vibber
d542c890ba Roll back r46059, r46062 "(bug 1433) Add meta-information to pages with language links." for now.
Localization issues with the description text should be ironed out first... also test use of rel="alternate" on the main links if that works, could save the extra metadata.
2009-01-27 23:08:02 +00:00
Philip Tzou
5a9c4ca3cb Find variant link of categories, to fix some strange bugs in Chinese Wikipedia. 2009-01-23 09:32:41 +00:00
Danny B
ed085abf00 * + xml:lang 2009-01-23 04:29:40 +00:00
Andrew Garrett
d6cccddf1d (bug 1433) Add meta-information to pages with language links. 2009-01-23 02:11:20 +00:00
Alexandre Emsenhuber
8eeb88abd0 Fix for r45648: only change page title if it's not an empty string (which is the default value) 2009-01-10 19:41:11 +00:00
Shinjiman
128d787c1d follow up of r45642, only set page title when it is not on the special namespace 2009-01-10 19:34:16 +00:00
Shinjiman
7637a89d82 * Fixing the caching issue by using -{T|xxx}- syntax (only applies on wiki with LanguageConverter class)
* Improving the efficiency by using -{A|xxx}- syntax (only applies on wiki with LanguageConverter class)
  patches by PhiLiP
2009-01-10 16:13:44 +00:00
Brion Vibber
d2496f69df Revert r45063 "Move doNothing return check above global declarations"
Change makes the code harder to read by hiding a control statement in the middle of a global declaraction chunk.
2008-12-31 17:56:04 +00:00
Brion Vibber
880d68b28c Pull back r45181 "(Bug 12998) Weaken DISPLAYTITLE restictions (patch by rememberthedot@gmail.com)" for now.
Escaping issues per comment http://www.mediawiki.org/wiki/Special:Code/MediaWiki/45181#c1046
2008-12-31 16:49:38 +00:00
Aaron Schulz
d0aeaa55ff (Bug 12998) Weaken DISPLAYTITLE restictions (patch by rememberthedot@gmail.com) 2008-12-30 12:22:15 +00:00
Aaron Schulz
4c462927ce Move doNothing return check above global declarations 2008-12-27 05:09:54 +00:00
Aryeh Gregor
3aedfc60d7 Revert revert I accidentally committed 2008-12-24 19:08:18 +00:00
Aryeh Gregor
3012280a8b Revert "(bug 16707) Add "rel='next'" link to login page to return to last page"
This reverts commit 22524e7e3a432df722438400581d2d56ea566dc2.
2008-12-24 19:07:03 +00:00
Aaron Schulz
88717159c3 (bug 16707) Add "rel='next'" link to login page to return to last page 2008-12-23 21:30:40 +00:00
Brion Vibber
a4e2060e45 Revert r44801 "Tweaks from profiling"
Mostly seems to be formatting tweaks, loss of useful debug log output, and mysterious unexplained changes.
If some of these tweaks actually are based on profiling data, please provide details, such as "rearranging this call reduces service time from 80ms to 50ms for client cache hits on my machine" or whatever.
2008-12-23 19:39:00 +00:00
Aaron Schulz
eef9a8cdd7 Tweaks from profiling 2008-12-19 09:21:20 +00:00