Commit graph

627 commits

Author SHA1 Message Date
Aaron Schulz
913879eaef Use getPrefixedDBkey() for template profile call.
Change-Id: Iac5183635984aa9261c1e85e32f6bb173ec513ae
2013-06-07 10:42:59 -07:00
Daniel Friesen
97caae596d Drop support for XHTML 1.0
* $wgHtml5 = false; is now ignored completely.
* $wgDocType and $wgDTD have been removed.
* $wgXhtmlDefaultNamespace is now ignored.
* XHTML5 will be output if $wgMimeType is set to an XML mime type (according to HTML5's rules).
* For backwards compatibility with extensions $wgHtml5 and $wgXhtmlDefaultNamespace are set
  in Setup.php but depending on them is deprecated.

Change-Id: Iad9634e2ee420b5a3bbffe550421fde4fa1819b0
2013-05-15 23:09:25 -07:00
Tim Starling
1fe9340bb3 Remove hphpc support and deprecate related functions
hphpc has been superseded by hhvm, so support for hphpc is no longer
needed.

* Continue to use Preprocessor_Hash under HipHop since it is still
  faster under hhvm
* Keep $wgCompiledFiles for now, so that wikihiero doesn't give an error
  before Ic9d1e795 is merged
* Migrate the run-server script and associated configuration file to
  hhvm. Enable EnableStaticContentFromDisk since it doesn't seem
  ridiculously inefficient at first glance. Run from $IP rather than
  $IP/.. since hhvm is apparently not picky about sourcing files from
  outside of the current directory.

Change-Id: Ic3e769f1fbad4f7ad26dd819406796fee48c6b45
2013-05-09 08:28:05 +10:00
Brian Wolff
2d542d3fd5 {{PAGESIZE:{{FULLPAGENAME}}}}, {{{{FULLPAGENAME}}}} not outdated
Previously, when parsing {{PAGESIZE:{{FULLPAGENAME}}}} or
{{ {{FULLPAGENAME}} }} (a self-transclusion), we used the
version currently in the db, which is outdated because
the moment we save the page there will be a new version.

This often causes confusion when testing templates that
often have examples of template use in the doc section
which would be one version out of date.

This change causes those variables to give results for
the most recent version of the page. For self-templates
that's done by reparsing the page after save. For
self page sizes this is done by taking the size
of the input to Parser::parse.

Note that {{subst:PAGESIZE:{{subst:FULLPAGENAME}}}}
will still yield previous revision like before.

bug: 39590
Change-Id: Idfac13de37d05317f65e4131534543e66cf74873
2013-04-27 20:45:32 -03:00
umherirrender
c0d61543b2 Pass array to Title::getLocalURL instead of an urlencoded string
This makes code easier to read and the urlencode is done inside
getLocalURL or friends

Change-Id: I21b988890356d11835eedba12a90a347bf0905b2
2013-04-27 08:22:01 +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
blotmandroid
d197fbd349 Introducing a new variable {{ROOTPAGENAME}}
Introduced a new variable ROOTPAGENAME which has similar
content like BASEPAGENAME.
ROOTPAGENAME only contains the name of the topmost page without namespace, e.g.
for "User:Name/Article/Subarticle" it should be "Name".
BASEPAGENAME would be "Name/Article" here.

Update : fixed indentation in maintenance/fuzz-tester.php

Added to RELEASE-NOTES-1.2.2

Bug: 6747
Change-Id: I71ef0a15c95c9145462f3aa7fdb3ed11dac79265
2013-04-24 02:13:25 +05:30
umherirrender
6c38a5eb72 Fixed spacing in logging/parser/profiler/rl/revdel/search folder
Added spaces before if, foreach
Added some braces for one line statements

Change-Id: I11bbcfa351e945b7bde10c2105d61a3cf5622205
2013-04-20 17:38:24 +02:00
csteipp
69f96f65dd Sanitize $limitReport before outputting
Prevents possible injection of "-->" and other HTML by extensions using
the ParserLimitReport hook.

bug: 46084
Change-Id: Id97b6668da6df3e5e4c0acefffa00c82cac3c44a
2013-04-15 13:48:15 -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
umherirrender
978bb31c5e Add missing wfProfileOut before throwing an exception
Change-Id: I1d830da0597f19efd0b2ae48642389975e736e23
2013-04-08 18:37:24 +00:00
Alexandre Emsenhuber
f4b1735753 Fix case of some Title methods (final round)
Change-Id: I41afed9c1d19aaca62685a51f881cf04a10998d8
2013-03-28 11:30:06 +01:00
Alexandre Emsenhuber
df5265e14d Fix case of some Title methods
Change-Id: I37ce7fe392f4941c500fa0a88007664501d7e338
2013-03-27 14:36:05 +01: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
MatmaRex
b3dd3881b2 (bug 23393) (bug 45803) Parser: Fix whitespace handling within headings
* HTML <hN> headings containing line breaks are now handled correctly
  (bug 23393).

* Whitespace within == Headline == syntax and within <hN> headings is
  now non-significant and not preserved in the HTML output (bug
  45803).

Change-Id: I0f2d81dd0b2f7742c5cdb6b7d2cc58a15d3f1029
2013-03-21 16:50:58 -07:00
Platonides
c06cec54b7 $wgContLang global unneeded in braceSubstitution() since fc00763f0
Change-Id: I0fc7f1ca5989d4a7ca8b4a49fd1f5229f23f9be5
2013-03-20 11:32:45 +01:00
Brad Jorsch
fc00763f0d Add parser method to call parser functions
There is currently no straightforward way for anything to call a parser
function and get the result. This abstracts out that portion of
braceSubstitution() to allow this.

The immediate motivation for this patch is to close bug 41769 against
Scribunto, see I0138836654b0e34c5c23daaedcdf5d4f9d1c7ab2.

Bug: 41769
Change-Id: I339b882010dedd714e7965e25ad650ed8b8cd48f
2013-03-20 02:52:45 +00:00
umherirrender
08b30f7d4d Remove error suppression from Parser::formatHeadings
The array index looks always initialized

Change-Id: I63a1c264ded0c4a744ee990de9bef4f8f9d20d1d
2013-03-18 08:44:46 +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
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
IAlex
3f92a5672e Merge "remove space before semicolon" 2013-02-10 12:51:02 +00:00
IAlex
0cce298226 Merge "fix some spacing" 2013-02-10 12:47:01 +00: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
f3cf109e62 remove space before semicolon
Change-Id: Ic0d890f5e27cec017c7f7910a67d53b2edf82079
2013-02-09 22:44:24 +01:00
umherirrender
c16e1a4490 TRUE, FALSE and NULL must be lowercase
From phpcs

Change-Id: I09672012be28ae3985702e314442db00d154de24
2013-02-09 21:10:44 +01:00
MatmaRex
1b71bc5256 (bug 29472) kill $wgUseDynamicDates
Remove $wgUseDynamicDates and everything related to it.

I left DateFormatter::reformat() alone, since it might possibly be
used elsewhere, and to be honest I'm afraid to touch it.

Change-Id: I609db8471c14e5e5946916f085d2ee5b96204d81
2013-02-06 17:38:05 +01:00
umherirrender
570dda0455 fix some spacing
Change-Id: I88e73d47a552918880514d88a876296a6cb80d88
2013-02-04 20:09:18 +00:00
jenkins-bot
5a09e9a15e Merge "Fix self link issues about titles in different or mixed variants" 2013-01-31 20:46:49 +00:00
jenkins-bot
7fbc18e1ba Merge "fix some spacing" 2013-01-27 13:14:56 +00:00
umherirrender
2e8da558ba fix some spacing
Change-Id: Id7eda67a43f9040117edd79fdbeb678f1c3a6da2
2013-01-26 22:11:09 +01:00
umherirrender
9d6575af15 The static declaration must come after the visibility declaration
From phpcs

Change-Id: Ieab0207f965630eda113abdc0259aa2eddcf5ca7
2013-01-26 21:03:52 +01:00
Liangent
bca8b8ad7d Fix self link issues about titles in different or mixed variants
Change-Id: I64a1b25a45cb8df9fea6fbbfd92cac2e6d53ff98
2013-01-25 18:07:11 +08:00
jenkins-bot
a8d72e1faa Merge "(bug 43964) Invalid value of "link" parameter in <gallery> no longer produces a fatal error" 2013-01-24 19:32:59 +00:00
jenkins-bot
cb4b29fd96 Merge "Further tweaks to pipe trick documentation (follow-up Iaf365e31)" 2013-01-24 15:48:24 +00:00
Alexandre Emsenhuber
6f74a93d1b (bug 43964) Invalid value of "link" parameter in <gallery> no longer produces a fatal error
Also added a test for this just in case someone wants to break this :)

Change-Id: I2782cf1a45b574eb5fd69b1c1be561e7bdaef59e
2013-01-23 07:40:27 +01:00
Reedy
a3fbdaaa2c Remove $wgBug34832TransitionalRollback
Per "@todo This variable should be removed (implicitly false) in 1.20 or earlier."

Change-Id: Ibd6d0199848ef4631d13e1a27044c793ef15ec02
2013-01-11 15:49:33 +00:00
Waldir Pimenta
546322662b Further tweaks to pipe trick documentation (follow-up Iaf365e31)
- call them pipe tricks (plural) as there's more than one
- mention double-width comma as well
- use one tab character for alignment due to double-width chars
- document reverse pipe trick

Change-Id: I27a1d04362eb3988fc1318fa1f73f69877019439
2012-12-06 06:19:13 +00:00
Nikerabbit
d5f42a2077 Merge "Improve documentation for "pipe trick"" 2012-12-05 09:56:56 +00:00
Nikerabbit
0a32a34775 Merge "Implement static public Parser::getExternalLinkRel" 2012-11-30 20:29:54 +00:00
Marius Hoch
d067e090ea Implement static public Parser::getExternalLinkRel
I've implemented the function Parser::getExternalLinkRel which
gives the 'rel' attribute for a given link in a given NS. Per Tim's
suggestion, as it's currently impossible to invoke the logic in
Parser::getExternalLinkAttribs externally.

Change-Id: Id0bfed81e2afd6730d820b6c9a4a09155a557f37
2012-11-30 21:20:38 +01:00
Stephan Gambke
a7c837a086 Allow null for title in preprocess
Additionally remove creation of bogus title in transformMsg.

The only place preprocess uses the title is in startParse. And that explicitly allows null.

Change-Id: I33d090bf250092fc541e284eb19dbd4053f40ae5
2012-11-24 10:40:06 +01:00
Liangent
e01adbfc0b Clean up Language::markNoConversion().
* IRIs are getting more and more widely used these days so Chinese
  characters are also needed to be prevented from being converted
  in text of external links.
* So now all markNoConversion() functions in languages with variants
  do the same thing. Merge them into a single function in the
  Language class and drop implementations in individual languages.
* By the way rephrase phpdoc of that function, and (bug 24798) fix
  the link detection regex to use wfUrlProtocolsWithoutProtRel().
  Protocol-relative regex is excluded to avoid false positives.
* Add parser test for it.

Change-Id: I2ec0ac2b9b11221584adb72555168498de209d57
2012-11-18 03:46:53 +08:00
Brad Jorsch
7c9d6c0d10 (bug 32368) Add ParserCloned hook
We store various bits of data as "expando" properties on the Parser
object, to pass information from one stage of the parser to another. If
the parser is cloned, however, we can run into trouble because two
different Parser objects are now manipulating the same extension data
structure; this often shows up when ParserClearState is called on one
clone and clears the state of the other as well.

Since a deep clone might be too expensive and still might be wrong in
some cases, it seems most useful to simply provide a ParserCloned hook
so extensions can just do The Right Thing.

Change-Id: Ieec65c908d71e89b9a66f83b9a626f842aadacbb
2012-11-16 11:27:13 -05:00
daniel
c2172d45e4 Beware that getContent() may return null
Before the introduction of the content handler, missing content was
signified by getText() returning null instead of a string. null will
work much like an empty string in most contexts, so in many places,
it was not checked explcitely whether the conent was null.

Now, when getContent() returns null, this often caused a fatal error,
because the code would access whatever getContent() returned as an object,
without checking whether it was null (because no such check was performed
previously, when the content was represented as a string).

This check introduces explicite checks for getContent() returning null
in the most essential core classes.

Change-Id: I551a90b0b67b8edc7570ca5d252ecc1de903f097
2012-11-09 19:45:12 +01:00
Waldir Pimenta
600ecaf7be Improve documentation for "pipe trick"
- Actually mention "pipe trick" so the code is searchable
- Use spaces rather than tabs for vertical alignment
- Clarify comment for double-width brackets and mention revision it was added

Change-Id: Iaf365e313144e378133fb16c64efa5b7e47d4a6a
2012-11-07 12:54:24 +00:00
Gabriel Wicke
31625b54a0 Bug 11748: Handle optionally-closed HTML tags
* Fixes bug 11748 (Parser issue for HTML definition list) and similar
  issues for nested unordered / ordered lists

* Stops wrapping HTML-syntax definition lists into paragraphs
  for consistency with their wikitext variants

* Enables one previously disabled test and adds another for nested
  definition lists with HTML syntax

Change-Id: If75ed54e11452dbcf5e6213cc20923064f811715
2012-10-25 19:31:29 +02:00
IAlex
408a3df1dc Merge "Remove unused variables." 2012-10-09 10:23:38 +00:00