Commit graph

611 commits

Author SHA1 Message Date
Tim Starling
efba9e3476 Moved image metadata to the database. Changed Image object to have lightweight constructors, similar to the User object. 2005-04-10 18:29:30 +00:00
Ævar Arnfjörð Bjarmason
8ee3ea37df * (bug 1343) Redundant whitespace around tables (<p><br/><p>) 2005-04-09 08:36:29 +00:00
Ævar Arnfjörð Bjarmason
f259876e96 * Removed redundant code: LanguageZh_tw.php = 0; for (LanguageZh_tw.php = 0; ... ) 2005-04-09 07:52:04 +00:00
Ævar Arnfjörð Bjarmason
db91701b61 * Reverted my commafyNum patch. 2005-04-09 01:35:42 +00:00
Ævar Arnfjörð Bjarmason
5b67454ed9 * (bug 87): Category tags produce ugly whitespace 2005-04-09 00:31:40 +00:00
Ævar Arnfjörð Bjarmason
7e420ce599 * Adding a new function to format a number like 1520626 as 1,520,626 and
1520626.34 as 1,520,626.34 etc, using it for MAG_NUMBEROFARTICLES.
2005-04-08 19:56:09 +00:00
Zheng Zhu
ffd7b6829e cache the title text of an article when there is different ways of presenting the title in different language variants 2005-04-07 23:04:08 +00:00
Ævar Arnfjörð Bjarmason
3b0ae6de8a * Using wfTimestampNow() and only allowing people to save make signitures with
the timestamp set as the default in the wgContLang file (I'll be crucified
  for this)
2005-04-07 18:14:31 +00:00
Ævar Arnfjörð Bjarmason
46f07aa69c * changed function magicRFC: documented it, and rewrote a small part of the
code, don't use stuff like $x = wfMsg( 'msg' ); $x = str_replace( '$1', $str, $x );
  when you can use $x = wfMsg( 'msg', $str );
2005-04-07 14:24:42 +00:00
Brion Vibber
6f5560867c Start removing the Latin-1 hacks. We're going pure UTF-8 for 1.5... 2005-03-26 22:23:48 +00:00
Ævar Arnfjörð Bjarmason
98b50e1c00 * (bug 1015) this fix enables the full wikisyntax inside <gallery> captions 2005-03-26 18:55:10 +00:00
Antoine Musso
4caf76c1ea Implement #1739 : new magickeyword REVISIONID. Give the diff / latest revision id for the article being view. Useful for proper citation.
New fetchedRevId method in Article::
2005-03-26 18:24:32 +00:00
Ævar Arnfjörð Bjarmason
8cd1085873 Indentation fix, there was a bit too much of it... 2005-03-26 02:50:01 +00:00
Brion Vibber
fad4b5928d * Move editsectiononrightclick setup to JavaScript (it requires JS anyway)
This lets us use the same parser cache for both settings of this option.
2005-03-25 12:37:19 +00:00
Brion Vibber
e69fe0c5a2 * do showtoc option via CSS hiding of toc when it's off.
This lets us use the same parser cache for either setting.
2005-03-25 09:35:59 +00:00
Brion Vibber
a9ec0acd3d * remove 'hover' option; always put in the title attribute on links
* convert 'hightlightbroken' to use CSS switching so we don't need a separate parser cache copy of each page depending on this setting
  ?-mode falls back to normal rendering in IE 6/win
  ?-mode looks crappy in IE 5.2/mac :(
2005-03-25 07:25:49 +00:00
Ævar Arnfjörð Bjarmason
b04b29509d * (bug 1662) Implemented a new magic word, {{CURRENTMONTHABBREV}} which returns
the abbreviation of the current month, cleaned up the sourcecode while I was
  at it to always display CURRENTMONTH, CURRENTMONTHNAME, CURRENTMONTHNAMEGEN
  and CURRENTMONTHABBREV in that order that's mnemonics for you.
2005-03-24 03:00:06 +00:00
Jens Frank
23b879b55f Enhancement 1485 Automatic rendering of -- as HTML dash 2005-03-15 06:07:58 +00:00
Tim Starling
900e0b3b50 Removed special case preventing table of contents on the main page. People can use __NOTOC__, after all. 2005-03-13 16:52:48 +00:00
Brion Vibber
6530a8af02 remove obsolete line 2005-03-13 02:01:27 +00:00
Brion Vibber
9e6e293334 Add page_len field with byte length of current revision text, since
revision text is now stored separately and may be compressed.
This field is indexed which speeds up Special:Shortpages & Longpages.

Removed no longer used wfArticleIsStub().
2005-03-12 11:51:02 +00:00
Brion Vibber
985ba40e98 * (bug 1659) Redundant caseless modifier in Parser.php 2005-03-11 02:32:19 +00:00
Domas Mituzas
1894517b75 Fix for Bug 1620, Wiki-table nnd tag strips whole line, hiding text after table
Bug reported and patch supplied by: Andrius Ramanauskas (Knutux) - alarm at takas.lt
2005-03-04 10:24:07 +00:00
Antoine Musso
feb72b4162 phpdoc fixes 2005-03-04 08:41:28 +00:00
Brion Vibber
ca38c848f8 Remove some cruft from skins... sooooo much cruft yet to go 2005-02-21 11:28:07 +00:00
Brion Vibber
d458eefd9c Fix direction, use of variable for stub threshold 2005-02-21 06:07:52 +00:00
Brion Vibber
9636a88e1c Clean up experiments for special:data, special:validate, special:geo.
Moving these things to extensions if they are needed in the future.
2005-02-18 11:47:36 +00:00
Brion Vibber
1da57d4e12 * Corrections to template loop detection 2005-02-11 09:02:15 +00:00
Brion Vibber
3a7a90e612 Use the new character entity reference sanitizer on wikitext as well as
attribute value normalization. One step closer to well-formed XML all the
time...
2005-02-06 16:13:06 +00:00
Brion Vibber
5d0480ebec Rewrote fixTagAttributes() for robustness and correctness:
- Attribute whitelist now per-element to appease validation
- Always put values in quotes, for well-formed XML
- Check that entities in attributes (but not yet in general text) are actually defined in HTML
- Remove extra spaces that got put at the end of some tags w/o attributes
- Be generally anal about things
2005-02-06 12:46:31 +00:00
Brion Vibber
45b6f3ca35 Split the HTML sanitizer functions from the Parser monolith 2005-02-06 06:44:48 +00:00
Brion Vibber
cbce2981ca * Fix notice error on nonexistent template in wikitext system message 2005-02-05 07:14:25 +00:00
Antoine Musso
bb7a1ac93a some quotes and phpdoc comments 2005-01-31 22:59:55 +00:00
Brion Vibber
07650eba1d * (bug 1228) Fix double-escaping on &amp; sequences in [enclosed] URLs 2005-01-30 04:11:22 +00:00
Jens Frank
ea9b9f176d BUG#1217 Image within an image caption broke rendering 2005-01-22 23:11:17 +00:00
Jens Frank
0957c04743 BUG#1131 Fix headings containing interwiki links 2005-01-22 09:34:56 +00:00
Jens Frank
24d8299089 BUG#925 Fix canonized_headline for e.g. <math> 2005-01-22 09:13:02 +00:00
Brion Vibber
7710788d3a * Remove unnecessary initialization and double-caching of parser variables
This saves a couple milliseconds; since the variables are internally cached there's no benefit to running every variable when we're often just going to use one or two (Sitename in messages for instance)
2005-01-18 11:52:06 +00:00
Tom Gilder
2d71cb3080 Generate expanded URLs for printing on the client, not server (using CSS, or JS for IE/win) (bug 642) 2005-01-15 23:56:26 +00:00
Tom Gilder
221156150e Complete TOC recode: proper HTML list; CSS for layout; JS recode; hidden TOC stays hidden across different pages; never show TOC if no headings; more opportunity to style TOC 2005-01-15 23:21:52 +00:00
Jens Frank
50ebb1e045 BUG#1317 - External links in image caption not working
Changed regexp to allow single ] inside of an image's alternative text
2005-01-13 09:13:22 +00:00
Antoine Musso
f2baa43923 Implement #1206
Patch by M7 "computerville (at) gmail (tod) com"
FORPORT from 1_4
2005-01-11 01:30:13 +00:00
Brion Vibber
c0d99e5c3e * (bug 1186) news: in the middle of a word 2005-01-08 03:03:10 +00:00
Jens Frank
922609f104 BUG#1269 - Fix section editing for articles with verbatim <h[1-6]> sections
There's a space added before the closing bracket during processing of HTML tags.
Changed the regexp to also match </h1 >
2005-01-06 00:13:49 +00:00
Jens Frank
eb39f13f04 BUG#32 External links had a whitespace after the link when tidy was used 2005-01-02 22:09:54 +00:00
Brion Vibber
8e4250ae57 * Add the dreaded <span> to the HTML whitelist 2004-12-23 14:04:11 +00:00
Brion Vibber
4f323f50e1 Fancy sig option for the very nice folks who just aren't content with a user page link and will produce ugly invalid code and then complain about it. merge from REL1_4 2004-12-23 08:40:51 +00:00
Brion Vibber
bbfaa459f9 monkeys! monkeys bouncing around my BRAIN 2004-12-23 07:47:17 +00:00
Brion Vibber
64ac6b8e77 Merge SCHEMA_WORK into HEAD. Lots of changes, some things are probably broken:
* Page moves/overwrites are a little iffy
* Compression might not be working right
* Profit!
2004-12-19 08:00:50 +00:00
Brion Vibber
d319dbe869 Split link generation, table of contents, and image functions from the
Skin class to a separate class, in preparation for thinning and refactoring.
Most users of these functions don't need the _Skin_, which generates the
user interface, and they clutter up the code with unrelated stuff.
2004-12-18 06:29:23 +00:00
Brion Vibber
3150abb758 * Gracefully ignore non-legal titles in a <gallery> 2004-12-15 09:07:21 +00:00
Brion Vibber
9a2a36ce5e * Defer message cache initialization, shaving a few ms off file cache hits 2004-12-09 05:51:20 +00:00
Brion Vibber
e6bb9de12b Merge image gallery fixlets from 1.4 2004-12-09 02:13:00 +00:00
Shane King
94ba835da9 Added support for .. style backlinks within subpages. See bug #981
for full details.
2004-12-07 01:23:32 +00:00
Brion Vibber
c6d4472efb Allowed HTML list has been frozen for some time, and we're trying not to add new tags. 2004-11-30 08:00:17 +00:00
Antoine Musso
229ac8759b Fix bug http://bugzilla.wikimedia.org/show_bug.cgi?id=671
* allow <abbr> and <acronym>
2004-11-30 05:22:39 +00:00
Evan Prodromou
4b42f18b66 Removed CVS keywords from files, to make merging between branches
easier. Interpolated keywords cause lots of conflicts and headaches at
merge time for older (<1.12.x) CVS versions.
2004-11-29 18:25:30 +00:00
Brion Vibber
b7557bf809 Profiling points 2004-11-28 04:05:05 +00:00
Brion Vibber
d66f60ed43 Loop invariant optimization: skip further checks for subpages on namespaces where subpages aren't allowed. Saves ~20ms on [[List of Royal Navy ship names]] on my test rig. 2004-11-28 03:29:50 +00:00
Brion Vibber
ffe8c4594e Avoid undefined string index notice on {{}} 2004-11-28 02:46:52 +00:00
Brion Vibber
f75240210c Tell regexp parser to use extra analysis on external link regexp;
this saves about 10ms on [[Zuiderzee Works]] on my test rig.
2004-11-26 12:10:24 +00:00
Brion Vibber
7a4c860acc Tell regexp engine to do extra analysis on doBlockLevels() paragraph-level
HTML checking. This speeds up this part of the operation from about 30ms
to about 7ms in Zuiderzee_Works on my test rig.
2004-11-26 10:49:46 +00:00
Brion Vibber
e39dd4532c (bug 934) List each category on a page only once.
Dan Keshet's patch (http://bugzilla.wikipedia.org/attachment.cgi?id=134&action=view) plus an added version check on parser cache objects, to automatically discard cached objects using the incompatible older format.
2004-11-25 22:02:30 +00:00
Brion Vibber
5a8cf9de43 Profiling points etc 2004-11-23 07:41:07 +00:00
Brion Vibber
f8c3d4bfb4 Inner loop optimization: reverse order of conditions for language variant link check, so the condition short-circuits correctly and we can skip the expensive per-link lookup. 2004-11-22 10:05:11 +00:00
Brion Vibber
2376b2c6f1 Avoid asking for the day, month etc name messages and the total number of articles over and over. InitialiseVariables() gets called during message transformations, so this saves several milliseconds of startup time which can be a significant portion of execution time on ParserCache'd page views. 2004-11-21 14:07:24 +00:00
Jens Frank
5b8630e1bf Added magic PubMed-Link, links to PubMed DB can be set like RFC
or ISBN links, using PMID 15545900 magic link.

Some code beautifying.
2004-11-20 11:28:37 +00:00
Tim Starling
ac77eb5b2c Fixed bug causing interwiki links to disappear unless accompanied by an internal link 2004-11-13 14:24:42 +00:00
Jens Frank
a8369d40dd Moved <gallery> code to Parser, registering images in a gallery as link 2004-11-13 12:04:31 +00:00
Jens Frank
e34d357e9d New tag "<gallery>" to generate a table of image thumbnails 2004-11-13 10:53:46 +00:00
Erik Moeller
1c54b48e4a [[Wikinews:Bla]] should not be matched as a news:// URL type.
Change regex to require that URL_PROTOCOLS is at the beginning of a link
(e.g. [[news:bla]]) for it to match.

Note: This will break if someone decides to reverse the order of
replaceExternal and replaceInternal again.
2004-11-07 10:14:36 +00:00
Brion Vibber
35cd7657f5 Remove old commented-out section which has some literals that break my editor's syntax highlighting 2004-10-28 01:22:49 +00:00
Erik Moeller
d2f27cf300 restore old order of replaceInternal/replaceExternal, mask absolute URLs
left behind by [[Media:]] links to prevent them from being parsed twice.
2004-10-25 05:24:23 +00:00
Jens Frank
bbfc760c1f Rename fields of user_rights and user_groups table to tablename_columnname schema 2004-10-24 09:21:53 +00:00
Tim Starling
412eda0517 Correcting bugs due to double-prefixing table names. Removing obsolete Database member functions. Adding comments to Database.php 2004-10-24 07:10:33 +00:00
Zheng Zhu
2f305c082a forgot to move the comment 2004-10-23 13:00:33 +00:00
Brion Vibber
2e7cecdeb6 Remove $wgCurParser kludge 2004-10-23 07:10:37 +00:00
Erik Moeller
0d02b52702 Preliminary support for shared upload directory. This is primarily intended
for the Wikimedia Commons. If $wgUseSharedUploads is set, MediaWiki will try
to locate an image file in the shared upload directory if it is not found
locally. Thumbnails for shared images will also be generated in the
shared directory.

Note: I changed
                $text = $this->replaceInternalLinks ( $text );
                $text = $this->replaceExternalLinks( $text );
to
                $text = $this->replaceExternalLinks( $text );
                $text = $this->replaceInternalLinks ( $text );

in Parser.php. Otherwise [[Media:Bla.jpg]] to an absolute URL would be
incorrectly parsed as external links. The header of
replaceExternalLinks says:

        Note: we have to do external links before the internal ones

So the old order was not consistent with the documentation. I did some
tests and nothing seems to be broken, but I have some problems executing
parserTests.php so I couldn't test it systematically.
2004-10-21 05:04:14 +00:00
Zheng Zhu
ccf6536d52 Moving code that checks for valid link in another variant from Parser.php to Language.php 2004-10-21 02:47:51 +00:00
Zheng Zhu
b6093aad4e Added option wgDisableLangConversion to disable langauge variant conversion, mainly for debugging and testing purpose. 2004-10-19 18:02:44 +00:00
Zheng Zhu
7bb0a0b64b removed double conversion of linked text. 2004-10-19 17:44:00 +00:00
Brion Vibber
da056c312e (bug 737) only use the post-parse link placeholders within replaceInternalLinks().
The recent move of the replacement step from OutputPage into Parser completely
broke a crapload of special pages; this makes the links show again.
2004-10-19 07:30:56 +00:00
Wil Mahan
4bc5a37c98 Move replaceLinkHolders() from OutputPage to Parser, because
it needs to happen before unstripNoWiki() and before tidy.
This also makes the parser more self-contained, so there is
no need to create an OutputPage object for the parser
tester.

Call unstripNoWiki() before creating a Title object
for an internal link; this fixes <nowiki> inside of
a link target. Need to make sure this does not degrade
performance.
2004-10-15 17:39:10 +00:00
Wil Mahan
ac9d5ac85f When checking for self links, use Title::getFragment() rather
than searching for '#', so that self-links escaped with
character entities are handled correctly. Related to
bug 337.
2004-10-13 04:30:19 +00:00
Wil Mahan
07ba17d234 Also add " to disallowed URI characters, per RFC 2396, fixing
some more test cases.
2004-10-11 22:10:14 +00:00
Wil Mahan
346f93fc27 Oops, invalid chars in bracketed external links should
be added to the link description, not the trail.
2004-10-11 19:15:24 +00:00
Wil Mahan
b22f8f318a Re-exclude '<' and '>' from external links, since brion pointed
out cases where it matters. We don't need to exclude them from
external link text, to allow for e.g. bold text in the link
description.
2004-10-11 18:54:35 +00:00
Wil Mahan
a2f8c159a9 Detect and disallow &gt; and &lt; within external links.
Fixes bug 289.
2004-10-11 16:57:49 +00:00
Wil Mahan
6838bf3e06 Prevent double-escaping of '<' and '>' in external links;
allow them in free external links again, at least until there
is a consistent way of handling them. Convert some spaces to
tabs from zhengzhu's last commit.
2004-10-11 16:16:27 +00:00
Zheng Zhu
3285ea4627 performance tweak related to title conversion 2004-10-08 04:27:07 +00:00
Wil Mahan
5d887f3e68 Trivial fix from Rowan Collins to better handle
malformed images with captions containing links.
2004-10-06 19:22:42 +00:00
Wil Mahan
f984174290 Don't call Parser::replaceInternalLinks twice, but instead
recursively replace links inside of image captions. Patch
by Rowan Collins (IMSoP), loosely based on a patch by me.
Fixes bug 637.
2004-10-05 03:55:41 +00:00
Wil Mahan
73f357a52b Oops, I committed the wrong file - sorry. :) 2004-10-05 00:21:52 +00:00
Wil Mahan
da2c08db84 Move length check to secureAndSplit(), so it is always used.
Also, don't query the DB for the max length, but use a
hardcoded 255.
2004-10-05 00:17:25 +00:00
Wil Mahan
c69017e8c7 Use Skin::makeExternalLink() rather than hardcoding HTML
in Parser; be more careful not to slow down the common
case of only one language variant.
2004-10-04 20:42:51 +00:00
Zheng Zhu
bfc27da4c4 Convert the title of an article to the preferred language variant. 2004-10-04 03:47:39 +00:00
Wil Mahan
0401df5c2e Disallow '<' and '>' in free external URIs; this is consistent
with RFC 2396 and fixes a parser test case. Remove the
INVERSE_EXT_LINK_URL_CLASS constant, which has never been used.
2004-10-02 21:33:06 +00:00
Wil Mahan
4f31d83137 Fix bug 553: when a piped link contains a template parameter, it
sometimes confuses the table code, because '|' is also used
to delimit cell attributes. This change prevents doTableStuff()
from treating any text containing '[[' as attributes.
2004-10-01 21:20:47 +00:00
Wil Mahan
b117cc2b6e A different fix for ':' in definitions that makes
[http://blah foo : bar ]: baz
work as expected
2004-09-27 21:01:39 +00:00
Wil Mahan
66c2f28ec1 Fix "; url://blah blah : definition" definition lists and related cases,
noted by brion and JeLuF
2004-09-27 06:13:07 +00:00
Wil Mahan
a59732b60b Fix bug 77: semicolon-colon wikitext syntax requires extra space now;
add some profiling statements
2004-09-27 04:44:00 +00:00
Wil Mahan
c2756ebfa1 Fix problem with RFC magic links, as noted at bug 479 2004-09-26 17:59:08 +00:00
Wil Mahan
e1ea27cf2e Don't strip leading ':' in maybeDoSubpageLink() so that
{{:foo}} works for including from main namespace.
2004-09-25 20:35:38 +00:00
Wil Mahan
2f54e9b50e Fix bug 561: {{/Subpage}} acts like {{Template:/Subpage}}, by
breaking out a maybeDoSubpageLink() function and using it when
including a template.
2004-09-25 20:13:14 +00:00
Wil Mahan
446f11bafc Move tidy call from Parser to OutputPage so that it happens
after link placeholder replacement.
2004-09-25 18:22:21 +00:00
Wil Mahan
7bd759a966 Undo some of my changes to sections from templates; I think they
were wrong
2004-09-25 16:06:10 +00:00
Wil Mahan
90d2ccd96a Fix two parser bugs: bug 41 and bug 529. For the former, I replaced
a broken check for '{{{' in braceSubstitution(). For the latter,
I undid part of JeLuF's fix to bug 523 and changed
braceSubstitution() to add a newline '{|', '#', '*', ';', or ':'
come at the beginning of a template and a newline isn't already
present. Also, minor cleanups to the template section code.
2004-09-25 05:16:38 +00:00
Wil Mahan
4860983705 Another attempt at fixing bug 2. Call replaceInternalLinks() before
replaceExternalLinks(). Use placeholders for interwiki links, as with
other internal links, to avoid parsing them as external. Disallow
links to pages containing a URL protocol followed by a colon.
Unrelated: output a warning comment when a template loop is detected.
2004-09-24 18:29:01 +00:00
Zheng Zhu
2d244b91f7 Attempt to fix links not fixed in the wgLang->wgContLang transition 2004-09-24 18:24:01 +00:00
Zheng Zhu
f84493db51 First batch of files modified to switch wgLang to wgContLang. 2004-09-24 13:14:52 +00:00
Wil Mahan
122d818923 Fix bug in pre-save transform caught by tester 2004-09-24 02:38:20 +00:00
Wil Mahan
b541d3bf4b Revert previous change, which broke interwiki links. 2004-09-23 07:25:02 +00:00
Wil Mahan
1c9c17f675 Call replaceExternalLinks after replaceInternalLinks. Fixes bug 2 and
a related bug.
2004-09-23 07:16:05 +00:00
Wil Mahan
e3179bba15 Remove a space for parser checker consistency 2004-09-23 06:29:46 +00:00
Wil Mahan
6cc7b51210 Don't unstrip() in internalParse(), because it's already done in parse().
This fixes <nowiki>*list item</nowiki>, which was caught thanks to the
parser tester. :)
2004-09-22 20:04:11 +00:00
Jens Frank
d5a30ef7ac Fixed some typos 2004-09-22 17:46:13 +00:00
Zheng Zhu
40cd22b4a9 use wgContLang to convert among different language variants 2004-09-22 03:51:32 +00:00
Wil Mahan
5c2b2730ff Now it is straightforward to fix bug 89, subst: template parameters.
Initial patch thanks to alanyst@gmail.com.
2004-09-22 00:15:54 +00:00
Wil Mahan
1962304c6a Two somewhat experimental changes before I fix bug 89:
1) Don't suspend the LinkCache when including templates;
because we don't call replaceInternalLinks() anymore,
it doesn't do anything.
2) Don't call strip(), removeHTMLcomments(), or replaceVariables()
on template parameters in argSubstitution(). The first two
should already be done on the article including the template,
and the third is unnecessary because it isn't possible to
pass templates as parameters to templates.

These seem to work, but if anybody notices any problems,
please let me know.
2004-09-21 23:56:25 +00:00
Wil Mahan
16fa7c3461 Removing variableSubstitution broke passing magic variables as template
parameters, so restore it. Instead, remove magic variable substitution
from braceSubstitution(), and modify variableSubstitution to handle magic
variables prefixed by SUBST in the pre-save transform.
2004-09-21 23:30:46 +00:00
River Tarnell
94cf4c9892 remove extraneous wfDebug 2004-09-21 19:05:46 +00:00
River Tarnell
dbdac8ca5b don't error on certain inputs if $matches[] doesn't have a last element 2004-09-21 19:03:39 +00:00
River Tarnell
7079cae2e2 use comments instead of __ so we don't scare the users if erroneous ones creep in 2004-09-21 18:20:56 +00:00
River Tarnell
a8eda05b9c fix a problem by not inserting __MWTEMPLATESECTION for section titles that don't exist 2004-09-21 18:15:37 +00:00
River Tarnell
de6c1e0330 forwardport fixes for template section edit links from rel1_3 2004-09-21 16:56:48 +00:00
River Tarnell
721cfd758c fix: inclusion of non-existent template is broken.
this still appears to be broken, but I think it was broken before this code existed as well.
2004-09-21 12:11:17 +00:00
River Tarnell
2c32f7df21 fix for several problems found by Eloquence:
section edit links in nested templates didn't work;
edit links for subsections in templates didn't work.

pending: links for non-existent templates are broken.
2004-09-21 11:54:45 +00:00
River Tarnell
2478dbdec4 make section headers in templates have edit links that point to the template. 2004-09-21 08:31:25 +00:00
River Tarnell
c10861fdf7 fix bug where __MWTEMPLATESECTION__ was being used with subst: 2004-09-21 06:54:18 +00:00
Wil Mahan
a90a2eb09b Convert many comments to phpdoc style, and document some more functions 2004-09-21 05:49:12 +00:00
Wil Mahan
11ddbffa71 Completely remove variableSubstitution(), because magic variable
replacement is redundantly done in braceSubstitution(). Aside
from removing unnecessary code, this will make it easier to fix
bug 89, parameters to {{subst:}} templates
2004-09-21 05:12:44 +00:00
River Tarnell
2242d6ed62 don't put edit links on sections from included templates.
template section headings have __MWTEMPLATESECTION__ added to them;
formatHeadings removes this and doesn't add the edit link for
such sections.  this is a rather hackish fix, but is probably
the best we can do with the current parser setup.

it would be nice (but not important) if this could be extended to
let users prevent edit links for certain sections.

fixes bug #266
2004-09-21 04:33:51 +00:00
Jens Frank
100316948f Instead of storing entire link attributes in wikitext for
deleayed link colouring, store pointer to an entry in array wgLinkHolders. Fixes BUG#493 and should
be faster.
2004-09-20 23:02:08 +00:00
Antoine Musso
9e1cd2016a Fix bug 479 : parsing [[RFC 1234]] as internal link
I forgot to commit it :(
2004-09-20 21:41:26 +00:00
Wil Mahan
d8d8b99f5b Fix small corner case in HTML comment removal 2004-09-20 16:05:37 +00:00
Jens Frank
a38fd104b0 BUG#487 Use Wil's custom function to replace HTML comments instead of
a regular expression. It is much more robust for different test cases, e.g.
*abc
<!-- comment -->def
2004-09-20 06:17:04 +00:00
Wil Mahan
87fe496e8f Remove code that is unnecessary now that titles no longer contain
'{' or '}'; fix regex greediness bug in HTML comment removal.
2004-09-19 08:58:09 +00:00
Jens Frank
d42c91a23c BUG#93 Fix handling of <nowiki> in templates 2004-09-18 23:14:07 +00:00
Jens Frank
9a3b767c7d BUG#523 Don't remove newlines in front of templates or template variables 2004-09-18 21:02:27 +00:00
Jens Frank
55e6114499 BUG#60 Patch by Wil Mahan
Include templates instead of parsing them. Than, parse the whole wikitext
in one step
2004-09-17 06:15:12 +00:00
Jens Frank
ff264a485a Added convert() to Language class, so that convert can be called
without checking wgLanguageCode. Avoid hardcodes.
2004-09-17 05:51:03 +00:00
Zheng Zhu
6ab460a578 Added entry point to call the Traditional/Simplified Chinese conversion code in LanguageZh.php 2004-09-16 20:25:12 +00:00
Jens Frank
7d89fde3f6 BUG#487 make regex not-so-greedy. If anchored to end-of-line, several lines are eaten if
there is text following the comment
2004-09-15 05:53:21 +00:00
Brion Vibber
8d704a7942 Whoops, debugging comment. 2004-09-14 06:02:01 +00:00
Brion Vibber
63d80f72c1 Prudency measure: only enable $wgRawHtml usage if $wgWhitelistEdit is on. 2004-09-14 05:49:15 +00:00
Jens Frank
2429d63748 BUG#463 Strip first leading blank from preformatted text in output 2004-09-12 13:07:52 +00:00
Brion Vibber
b0c2c0449d Use <i> and <b> for '' and ''' instead of <em> and <strong>. There's no
good reason to use <em> and <strong> here; they increase cache storage
and bandwidth requirements ;) and may be abusing semantic markup.

* Bug 369: '' should be interpreted as <i>, not <em>
http://bugzilla.wikipedia.org/show_bug.cgi?id=369
* Bug 370: ''' should be interpreted as <b>, not <strong>
http://bugzilla.wikipedia.org/show_bug.cgi?id=370
2004-09-11 08:40:26 +00:00
River Tarnell
5012260a95 here is the correct fix for head (MF 1.3) 2004-09-09 23:24:36 +00:00
River Tarnell
b19e0b60ce don't parse blank ISBNs 2004-09-09 23:04:08 +00:00
Jens Frank
227b54cbfd BUG#76 For categories, don't use the Category:-prefix for the sortkey.
[[Category:Mountains of Panama]] now gets cl_sortkey='Mountains of Panama' instead of 'Category:Mountains of Panama'.
Avoids later issues with sorting.
2004-09-07 22:08:01 +00:00
Antoine Musso
ba2afcd9fa Split files and classes in different packages for phpdocumentor. I probably changed some double quotes to single and used function foo () { shema 2004-09-03 23:00:01 +00:00
Antoine Musso
90155b8a97 Changing comments layout preparing for generated documentation with Phpdocumentor 2004-09-02 23:28:24 +00:00
Brion Vibber
67e6306a0e Avoid numeric and boolean interpretation of "0" in self-link check and Go searching.
Fix for bug 174: 0 as an article name behaves strangely (numerical comparison in article-ids).
http://bugzilla.wikipedia.org/show_bug.cgi?id=174
2004-08-31 02:26:55 +00:00
Jens Frank
dac2ca94f4 BUG#160 Internationalize display of numbers:
* section numbers in TOC
* file size in edit page warning for big articles.
2004-08-28 19:08:49 +00:00
Jens Frank
312187e477 BUG#219 enable link shortcuts like [[:Category:catname|]] 2004-08-28 16:42:57 +00:00
Tim Starling
0f9c5b24fd Abstracted site name in LanguageFi.php. This required the implementation of general handling for inflected languages, in particular the {{grammar:}} tag 2004-08-27 14:55:41 +00:00
Jens Frank
48cf90b00f removed forgotten debugging statement 2004-08-27 06:16:16 +00:00
Jens Frank
be8efb66ca cleanup of unused categoryMagic code 2004-08-27 06:15:13 +00:00
Jens Frank
3d4d040658 BUG#206: replace <!--LINK tags by the link text for displaying text in TOCs
Thanks to Daniel D�sentrieb for his help writing the regexp.
2004-08-26 18:48:13 +00:00
Antoine Musso
3d60242fb5 massive double to single quotes conversion. I have not noticed any bug after a lot of testing 2004-08-22 17:24:50 +00:00
Brion Vibber
16514740cf Remove what seems to be an accidentally checked-in testing line:
'/([^> ]+(&#x30(1|3|9);)[^< ]*)/i' => '<span class="diacrit">\\1</span>',
(Originally added by gwicke in revision 1.197)

With very long 'words' this regexp is super slow, and causes timeouts:
Bug 183: timeout in Parser.php with Tidy
http://bugzilla.wikipedia.org/show_bug.cgi?id=183
2004-08-22 09:57:12 +00:00
Jens Frank
1eb2480014 Moved category stuff to CategoryPage, copying logic of ImagePage 2004-08-22 09:42:12 +00:00
Jens Frank
d289825788 Fix notice regarding invalid array index -1 2004-08-22 07:22:13 +00:00
Antoine Musso
9a3ae4a58e Reverting patch 1.246 made by Guillaume. It breaks things such as [[100]]. 2004-08-21 19:59:43 +00:00
Brion Vibber
830e915970 Add some more profiling points 2004-08-19 08:44:13 +00:00
Guillaume Blanchard
a3581bcf9c *fix bug in non-breaking space regexp
*add non-breaking code for French numbers
*set MAX_INCLUDE_REPEAT to 100 (I'll remove it when I'll update the per page size max)
2004-08-17 15:42:42 +00:00
Antoine Musso
440edce494 * some comments (using # instead of /* */ )
* function foobar () { shema
2004-08-16 20:01:21 +00:00
Antoine Musso
c5686b5b32 more double to single quotes 2004-08-16 15:29:17 +00:00
Antoine Musso
354e912799 Comments, double to single quotes, foobar () { shema. 2004-08-16 15:23:46 +00:00
Jens Frank
426899ec1b Move check for wgUseGeoMode to where the function is called, avoids copying the text around 2004-08-15 13:49:14 +00:00
Arne Heizmann
af38689651 New PHPtal-based skin 'Chick'. Designed for PDAs and other low-resolution devices.
See non-whitespace-changing patch at http://bugzilla.wikipedia.org/show_bug.cgi?id=49
2004-08-14 22:38:46 +00:00
Arne Heizmann
69eaf5751b Fixes to the bold/italics rendering problems [Bug 40]
http://bugzilla.wikipedia.org/show_bug.cgi?id=40
2004-08-14 08:32:57 +00:00
Brion Vibber
41c8b7bf72 Antiglobalization!
* Remove some unused and some useless functions from GlobalSettings.php
* wfEscapeHTML() replaced with PHP built-in htmlspecialchars().
* Moved some functions into Parser.php and Image.php
2004-08-13 15:55:59 +00:00
Guillaume Blanchard
1c8f04ece2 MAX_INCLUDE_REPEAT 5 => 20
Fix non-breaking space before ';'
2004-08-13 14:15:21 +00:00
Antoine Musso
4054b8773c Fix source forge bug #1007149. Wrong plural when listing categories and subcategories. Added two new messages in language.php 2004-08-12 13:58:54 +00:00
Antoine Musso
6291a4774d implement a new magic word: PAGENAMEE wich return the escaped title. Implement sourceforge feature requests 999044 and 997771 2004-08-12 13:32:04 +00:00
Tim Starling
d2ac7399cc tweaking escaping of external links 2004-08-10 11:24:24 +00:00
Magnus Manske
7b0686a408 (Hopefully) fixing various template bugs once and for all! 2004-08-08 18:05:41 +00:00
Tim Starling
5d58e45c1a Fixing bug #584804, extra characters requested in $sep for external links. This includes the right parenthesis fix suggested by Brion. 2004-08-07 18:45:30 +00:00
Tim Starling
badf11ffe6 Rewrote external link handler, using preg_split(). Passes all external link test cases on [[m:Parser testing]]. Fixes some parts of bug #583234: fixes URL inside URL problem and incorrectly rejected character problem 2004-08-07 18:24:12 +00:00
Arne Heizmann
96206ce09b Bugfix: produce valid XHTML even if user entered invalid '' / ''' mark-up. 2004-08-07 12:37:20 +00:00
Arne Heizmann
2e76b8fa28 rm trailing white space 2004-08-07 12:35:59 +00:00
Tim Starling
ea050f787c comments and descriptive variable names 2004-08-07 08:54:52 +00:00
Tim Starling
d73935a5f0 New feature, nicer display of redirects. Removed special case for redirects from Parser.php, which probably would have caused problems anyway. Changed a few places to use NS_xxx constants instead of the old Namespace:: functions. 2004-08-07 03:50:46 +00:00
Arne Heizmann
99b447f83b Performance optimisation: Merge two for loops into one. 2004-08-06 21:13:30 +00:00
Arne Heizmann
11093c73a1 Somewhat less hacky fix to the French l''''homme''' problem. 2004-08-06 20:47:21 +00:00
Magnus Manske
406abe0b0a Adding option $fixLbug to fix bug 948549 2004-08-06 17:52:43 +00:00
Jens Frank
152dcb411d Category links are not part of mBodyText, so <!--LINK tags are not converted.
set postParseLinkColour to false to force "real" link. There must be a better way to do this.
2004-08-05 20:15:32 +00:00
Magnus Manske
a56f343767 This should fix bug 980557 2004-08-04 20:56:46 +00:00
Jens Frank
61fb81f125 Removed debug output 2004-08-04 20:04:54 +00:00
Magnus Manske
ef2acad514 fixing several bugs at once, or creating new ones? 2004-08-04 19:59:04 +00:00
Magnus Manske
5d88dfc609 fixing my redirect bug fix (hopefully) 2004-08-04 17:08:33 +00:00
Jens Frank
40d9911ee1 Allow indentation of tables using :{|
Bug #989788.
2004-08-04 16:37:48 +00:00
Brion Vibber
73a4662190 Move magic ISBN, RFC, and GEO links to between replaceExternalLinks and
replaceInternalLinks. This is a basic fix for the infamous bug
[ 708163 ] [[ISBN #]] doesn't work correctly

ISBN, RFC links accidentally put inside [[ ]] brackets will now come up
relatively straightforwardly, with extra brackets. This is much nicer
than a horror of HTML errors that there were before; does not solve
problem with embedded <a>-in-<a> tag if you put it in a link piped
text, but that's a smaller problem.

Someday a full tokenized parser will wish this problem away into the
cornfields.
2004-08-04 01:53:29 +00:00
Magnus Manske
10a7bdc143 category redirect bug fix 2004-08-03 19:50:37 +00:00
Arne Heizmann
d6b0fc1ab5 Allowing for piped links inside template variables; by Emmanuel Engelhart
http://mail.wikipedia.org/pipermail/wikitech-l/2004-July/011776.html ff.
2004-07-31 14:13:07 +00:00
Brion Vibber
a3e3155936 Fix fragments on interwiki links and in-wiki links with case sensitive option on.
* [ 991569 ] Interwiki Links to Sections Do Not Work
2004-07-29 04:48:42 +00:00
Brion Vibber
81911cace9 Use localized numerals for CURRENTMONTH, CURRENTDAY, CURRENTYEAR, NUMBEROFARTICLES 2004-07-28 21:20:49 +00:00
Brion Vibber
67833d481c $wgRawHtml option to enable <html>...</html> container for RAW UNCHECKED
UNPARSED html bits. Don't enable this except on trusted sites!
2004-07-24 22:59:44 +00:00
Arne Heizmann
a75b7d316f sp :) 2004-07-24 01:03:16 +00:00
Arne Heizmann
6697d32053 Prevent category stuff ("There are 0 articles in this category.") from appearing in
the middle of articles because it is appended when a {{macro}} is expanded.
2004-07-24 00:46:27 +00:00
Jens Frank
063befc4cc Changed template inclusion code to detect loops and to limit the text length.
Based on an algorithm proposed by Emmanuel Engelhardt in
http://mail.wikipedia.org/pipermail/wikitech-l/2004-July/011254.html
slightly modified.
2004-07-24 00:37:24 +00:00
Jens Frank
4c5f567db2 allow blank lines in preformatted text started by blanks. BUG #993991 2004-07-19 19:03:43 +00:00
Jens Frank
6b37aa9a04 New global config setting $wgMaxTocLevel: Maximum indent level of toc. 2004-07-19 05:15:50 +00:00
Tim Starling
ac549401d4 * Support for table name prefixes throughout the code. No support yet for converting static SQL, which also means no installation. But it has been tested by creating the tables in the ordinary way and then renaming them
* DB_WRITE now called DB_MASTER, DB_READ now called DB_SLAVE
* Converted to use SQL wrapper functions instead of direct SQL in various places
* Experimental method for preserving the chronological order of events when slave servers are used. Untested.
* Fixes to the new post-parse existence test feature
* Some.. other stuff
2004-07-18 08:48:43 +00:00
Magnus Manske
67bcaab800 GEO mode 2004-07-16 20:32:44 +00:00
Gabriel Wicke
90f6f42193 improved pre/list interaction, cleanup 2004-07-14 18:46:02 +00:00
Gabriel Wicke
c3a00f5a65 allow pre's in lists, report by rizzo and mhnoyes 2004-07-14 18:38:28 +00:00
Jens Frank
6606778166 move $this->initialiseVariables down to where the variables are used the first time. This removes one SQL query per page view if no variables are used on that page. 2004-07-13 06:42:55 +00:00
Arne Heizmann
460d5f9aa9 Use linktrail instead of na�ve \\S* 2004-07-13 00:01:33 +00:00
Jens Frank
ecd99db4ab use makeKnownLink istead of makeLink. A page pointing to another page must exist que definitionem 2004-07-12 23:00:08 +00:00
Arne Heizmann
92fded9b95 This fixes the issue that something like [http://url/ link]s (i.e. text directly following
the closing square bracket) would produce something ugly in printing:
  link (http://url/)s
Now it finishes the word first:
  links (http://url/)
The given example seems pointless, but in languages other than English this happens more
frequently.
2004-07-12 22:57:13 +00:00
Arne Heizmann
bc18a0867d - fix issue outlined by Emmanuel Engelhart <emmanuel@engelhart.org> on wikitech-l
- fix indentation
- remove commented-out code
2004-07-12 19:49:20 +00:00
Tim Starling
b96b707efa OOP calling convention for database functions. DBMS abstraction implemented by means of functions instead of global variables, PostgreSQL object converted to a subclass instead of a drop-in replacement. Also the beginnings of a flexible table name feature. 2004-07-10 03:09:26 +00:00
Gabriel Wicke
944b872646 New magic word __TOC__ that inserts the toc at the place it is found
Implies __FORCETOC__
2004-06-29 23:59:30 +00:00
Guillaume Blanchard
af9ce48b3e add [;] to french space character list 2004-06-29 10:38:55 +00:00
Tim Starling
61819d059b Corrected spelling error 2004-06-19 06:48:02 +00:00
Antoine Musso
7936e29ba5 * doExponant() function. Convert ^^th^^ in <small><sup>th</sup></small>.
The function call is commented
2004-06-17 17:29:54 +00:00
Tim Starling
3545cddd9b oops, removed random speculation 2004-06-12 07:15:27 +00:00
Tim Starling
85ef7f8865 changed code formatting, changed parser hook calling convention so updating will require a simultaneous update of the extensions. Now use $wgParser->setHook() instead of Parser::setHook() 2004-06-12 06:15:09 +00:00
Jens Frank
21891fe83f Fix sorting of subcategories without a sortkey. Use Category name as sortkey, not the first letter of Category. See comment for details. 2004-06-10 22:32:04 +00:00
Jens Frank
f3a14034f4 use sortkey for subcategories, too 2004-06-10 12:06:25 +00:00
Tim Starling
3ac0a71c13 Hiero and timeline as fully modular extensions. To use, just include the header file from LocalSettings.php 2004-06-09 12:15:42 +00:00
Jens Frank
07db37945d Don't show underscores instead of spaces for subcategories. BUG #969473 2004-06-09 12:07:32 +00:00
Antoine Musso
107062dbba Replacement of most double quotes by single quotes for plain text strings. Should be bug free as I did not make change unless I was sure it was bug less. 2004-06-08 18:11:28 +00:00
Antoine Musso
e197696c58 Don't generate article list if we have no article to show 2004-06-07 08:27:13 +00:00
Antoine Musso
c629470933 bug fix in newcategorymagic: first char was alway the one of the category namespace (aka C) 2004-06-07 03:46:33 +00:00
Jens Frank
29c1135460 new layout for Category:XXX pages.
Can be turned on or off using MediaWiki:Usenewcategorypage
2004-06-06 09:24:07 +00:00
Antoine Musso
6ec37b9507 some comments added 2004-06-05 15:17:08 +00:00
Gabriel Wicke
c410b3f316 section anchor cleanup, unurlencode : 2004-06-05 10:34:32 +00:00
Tim Starling
2650e92361 More profiling sections 2004-06-05 04:51:24 +00:00
Tim Starling
242d225e10 removed non-matching wfProfileOut() calls 2004-06-05 02:22:16 +00:00
Gabriel Wicke
94c2a67f51 /tr added to tags 2004-06-02 23:22:24 +00:00
Gabriel Wicke
e4562fbd4c The Arab al[[Razi]] cleanup 2004-06-02 22:54:01 +00:00
Gabriel Wicke
6aa81d268b The Arab al[[Razi]] back on board 2004-06-02 22:39:06 +00:00
Gabriel Wicke
a0fbb5e730 section anchor encoding:
'%' -> '.'
pseudo-urlencoded for enough uniqueness in non-ascii languages
2004-06-02 15:19:28 +00:00
Gabriel Wicke
f982803ae9 nowiki handling
* unstrip done for nowiki separately (unstripNoWiki())
* unstripNoWiki() called *after* doBlockLevels
2004-06-02 12:29:15 +00:00
Brion Vibber
5830e7c6f9 Reverting to previous revision; this broke at least one example and I'm not sure why. 2004-06-02 08:01:48 +00:00
Brion Vibber
8f4bf54583 Don't put literal <nowiki>, <hiero>, or <timeline> into the output. This
breaks (X)HTML validation as well as the general rule of rejecting
unknown tags by showing them as text. (<nowiki> is never unknown of course,
so it never appears. Just its text remains raw.)
2004-06-02 07:43:05 +00:00
Jens Frank
cdd0bae0ab workaround, strip nowikis again in doBlockLevels. BUG #96447 2004-06-02 05:54:52 +00:00
Gabriel Wicke
e30390b38f performance fix 2004-06-02 02:42:13 +00:00
Gabriel Wicke
9feaa3422a sig fix II 2004-06-02 01:22:29 +00:00
Gabriel Wicke
10fa17d61b bug fix: list item with nowiki 2004-06-02 00:39:02 +00:00
Gabriel Wicke
afd3aaa6d1 nowiki handling
nowiki areas are wrapped in <span class="nowiki></span > (allows styling) and treated similar to pre areas in doBlockLevels
2004-06-01 22:19:22 +00:00
Gabriel Wicke
32f3b62bab keep unwrapped text arounf 2004-06-01 11:03:39 +00:00
Gabriel Wicke
c54913969e th matching in doBlockLevels 2004-06-01 07:52:44 +00:00
Gabriel Wicke
6b87eb0077 table handling fix and notice silencing instead of buggy checking in the html strip function 2004-06-01 07:25:48 +00:00
Erik Moeller
cd18b85daa unbreak template parametrization 2004-05-31 21:50:12 +00:00
Jens Frank
9134865cca Only pop an array if it really is an array. BUG # 963554 2004-05-31 13:02:19 +00:00
Jens Frank
e2d600aa8d Fix transclusion inside of tables. BUG #962494 2004-05-31 12:12:18 +00:00