Commit graph

340 commits

Author SHA1 Message Date
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