Commit graph

214 commits

Author SHA1 Message Date
Antoine Musso
28ea816fba Implementing user levels management. This is only a very basic interface and several things need to be done! A tracking bug is at http://bugzilla.wikipedia.org/show_bug.cgi?id=767 2004-10-24 19:14:48 +00:00
Brion Vibber
8ffff3e2e0 Reorganization of SearchEngine for legibility
* Removed 'fuzzy title search', it's not been maintained and generally produces unexpected and unwanted results
* Separated search guts (in SearchEngine) from display/control (in SpecialSearch)
* Extracted MySQL3 and MySQL4 variants to subclasses
* Added PHPUnit tests for MySQL3 and MySQL4 search engines, which try to use temporary tables to fiddle in (if configured)
* comments n stuff
2004-10-20 09:56:34 +00:00
Brion Vibber
53856406a6 Clean up a few scriptlets 2004-10-14 02:13:12 +00:00
Brion Vibber
bf8a62bb96 Fix for running with no include_path set 2004-10-02 20:15:26 +00:00
Tim Starling
91cf173f4a More informative error message for when the user forgot to move LocalSettings.php. Moved recently-added setup code from index.php to Setup.php where it's meant to be. index.php isn't the only entry point! 2004-09-26 10:41:48 +00:00
Magnus Manske
c97f3bbdeb Wiki database system 2004-09-24 14:49:22 +00:00
Zheng Zhu
ca7619c81c made some more wfMsg() to wfMsgForContent changes 2004-09-22 04:09:31 +00:00
Brion Vibber
b59b2ef01a Quick fix for canonical redirects when the URL is case-converted.
Since this is now done in WebRequest, $title is already converted so
check $_GET directly.

The canonical redirect still does not handle the case of an
index.php?title=Foo URL where $wgArticlePath is set for pretty
URLs.
2004-09-06 03:17:21 +00:00
Brion Vibber
2406b511a6 Start cracking down on illegal titles: in UTF-8 mode reject titles which have had the 'replacement character' inserted, representing illegal UTF-8 sequences or non-legal Unicode characters.
Moved the PATH_INFO check from index.php into WebRequest; it now just shoves the param into $_REQUEST['title'].
2004-09-03 06:12:57 +00:00
Brion Vibber
81e0b9d3c0 One more unicode normalization fix: don't die horribly on arrays, and get the PATH_INFO title too. 2004-09-02 08:01:13 +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
Brion Vibber
82571fa72d Add back the slower version of Title::makeTitle as Title::makeTitleSafe()
and use it in a few places where user names, images, or messages are being
used to create titles.
2004-08-22 23:55:36 +00:00
Jens Frank
1eb2480014 Moved category stuff to CategoryPage, copying logic of ImagePage 2004-08-22 09:42:12 +00:00
Brion Vibber
c5410557fe Add some profiling points 2004-08-22 09:07:31 +00:00
Brion Vibber
dde3967d28 Don't include SearchEngine.php when it's not used. Saves about 180k of memory at runtime. 2004-08-21 09:51:01 +00:00
Arne Heizmann
74573405b1 # Please don't move this line to includes/Defines.php. This line essentially defines
# a valid entry point. If you put it in includes/Defines.php, then any script that includes
# it becomes an entry point, thereby defeating its purpose.
2004-08-14 20:33:01 +00:00
Antoine Musso
0737146cf0 Reverting my previous change. Comment 2004-08-14 12:20:39 +00:00
Antoine Musso
47c3eb7298 moving define(mediawiki, true) from index.php to includes/Defines.php 2004-08-14 12:10:43 +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
Tim Starling
cd2e8170d2 Ahh, so that's what that does 2004-08-12 06:54:58 +00:00
Arne Heizmann
09770282d2 Apparently cvs forgot to commit this with the rest. 2004-08-09 08:21:34 +00:00
Brion Vibber
554d5137ad Don't run power search in 'go' mode
* [ 998393 ] Powersearch seriously broken
2004-07-29 01:50:36 +00:00
Tim Starling
629601a5dc don't redirect to the canonical title if other parameters have been passed in $_GET 2004-07-25 11:49:05 +00:00
Tim Starling
1773cd1e76 * Introducing bit field for database parameters
** Database constructor calling sequence, and Database::newFromParams()
** Including flags in the server initialisation structs
** Support for setting appropriate flags from legacy globals in Setup.php
** Moved some defines to Define.php so that they can be used in LocalSettings.php, most importantly the bit field constants

* Changes related to post-parse link colouring
** Turn the link cache back on when using it for updating the links table
** No longer need to call preFill() on page view

* Better synchronisation of slave servers
** Rearranged getConnection()
** System for beginning and committing transactions when multiple connections are open
** wfAbruptExit() commits transactions, wfErrorExit() does not. Various functions changed to use wfErrorAbort()

* Allowed reporting of database errors during deferred updates by moving them above output()
2004-07-24 07:24:04 +00:00
Magnus Manske
1b8983ea76 Article validation code (as a tab now) 2004-07-20 20:48:19 +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
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
Jens Frank
a1d96e3c5f LinksUpdate uses SELECT FOR UPDATE, thus starting a new transaction. So we have to call COMMIT for it. The big BEGIN...COMMIT loop of the action=...-switch() doesn't catch the wgDeferredUpdateList. 2004-07-09 17:37:03 +00:00
Arne Heizmann
d7d2a7b23c I thought I committed this? 2004-07-08 15:41:45 +00:00
Evan Prodromou
f2760f1e19 Moved credits stuff from Skin.php to a separate module. Added a "credits"
action, which shows credits on their own page. Some Language strings to
support the separate credits page.

TODO: link user pages in credits, limit credits.
2004-06-28 17:46:54 +00:00
Tim Starling
4f189276ae fixing broken search links e.g. from prev/next links on results page 2004-06-26 12:56:44 +00:00
Antoine Musso
16a74059bd recommiting specialpages loading fix as the BoardVote extension as now been fixed 2004-06-12 01:31:00 +00:00
Brion Vibber
e96217fc1c Undo change that stopped Wikipedia from running at all 2004-06-11 23:29:56 +00:00
Antoine Musso
cd43f3b122 removing print_r *hides 2004-06-11 21:14:51 +00:00
Antoine Musso
82b207df94 do not instant Special* objects if user is not requesting a special page (save memory / cpu time) 2004-06-11 21:13:51 +00:00
Tim Starling
c1f1a87ab6 update cur_touched on action=purge 2004-06-06 14:05:51 +00:00
Brion Vibber
87d342d844 Fix bad title detection again; was dying with error on whitelist check 2004-05-30 06:44:47 +00:00
Brion Vibber
bce224d0db Fix preg_quote usage in interwiki loop detection 2004-05-29 01:24:33 +00:00
Tim Starling
e3676a470c Introducing special page modular extensions, making the board vote special page the first of these.
* Moving common special page handling to SpecialPage.php
* Special page lists in the language classes are obsolete, replaced by the list in SpecialPage.php
* Special:Specialpages uses the standard page titles wfMsg(pagename) instead of the description list previously contained in the $wgSpecialPagesEn arrays
* Ability to add custom messages to the MessageCache. Overridable by the MediaWiki namespace.
* Moving board vote functionality from includes/SpecialBoardvote.php to extensions/BoardVote.php
2004-05-15 03:36:39 +00:00
Erik Moeller
472272dc61 New feature:
Automatic or manual collapsing and expanding of long pages.
Pages can be collapsed automatically according to a size threshold
set in the user preferences. Pages can be collapsed manually by clicking
the "Collapse" link in the TOC.

When a page is collapsed, only the intro & TOC are displayed. The
individual TOC lines link to section views, which can be individually edited
(classic section editing).

Section editing/viewing behavior has also been improved. When a section
with subsections is viewed or edited, all subsections are also loaded.

Known issues:
- After saving a section, we return to the full article view
rather than the section view, even if we previously were in section view
mode.
- Should work with Standard and Monobook, not tested with Cologne Blue yet.
- In Monobook, no backlink to the mother article is shown during section
viewing (Gabriel, can you fix that?)
2004-05-12 13:26:36 +00:00
Brion Vibber
34ceac3add Whitelist and diff fixes:
* Enforce whitelist on oldid and diff specifiers (bug 950911)
* Show the titles given for oldid and diff if they differ (UI change related to bug 622636)
* Use canonical text form in $wgWhitelistRead
2004-05-11 09:47:41 +00:00
Brion Vibber
762b8e9b47 Allow installing and running the wiki on a server where ini_set has been
disabled via disable_functions in php.ini (bug #928168)

The PHPTal skin doesn't function unless the PEAR bits are in include_path,
so it's disabled if ini_set can't be used. If the files are manually placed
or a real PEAR installation is available with the right stuff, one can
use $wgUsePHPTal = true;

There are likely other things that need to be taken into account for
restricted environments. Maintenance scripts haven't been tweaked for
such an environment yet either.
2004-05-09 10:37:00 +00:00
Tim Starling
8f22cb45b1 include_once -> require_once 2004-05-07 13:43:10 +00:00
Tim Starling
52def2f997 Interwiki redirects using prefixes in the URL 2004-05-04 12:37:29 +00:00
Gabriel Wicke
df106e2f49 New, simple method to retrieve the plain source of an article
Syntax:
* action=raw
* ctype=text/plain (defaults to text/plain, used in the header)
* charset=utf-8 (defaults to wgInputEncoding, used in header)
* oldid=int (retrieves old version if set)
2004-04-28 17:38:48 +00:00
Brion Vibber
37cf644140 Fix for old-style search URLs to force the page to behave as search 2004-04-24 06:39:59 +00:00
Brion Vibber
93b09379fb Add experimental MathML output option for math (only works with some
browsers and requires use of an XML content type; try setting
$wgMimeType = "application/xhtml+xml" and use Mozilla).
Rearranged a couple things in prefs.
Did some refactoring in Math.php to remove some duplicated code and
figure out what is going on.
2004-04-22 08:51:04 +00:00
Brion Vibber
e77f54f65b Un-break large number of actions. Timwi, please read http://www.php.net/switch 2004-04-09 10:46:28 +00:00
Arne Heizmann
444b3b8b84 Make code infinitely more readable and understandable by seizing use of a pointless,
confusing and error-prone feature of PHP.
2004-04-09 10:29:54 +00:00
Brion Vibber
33821336ba Whitespace & coding standards adjustments to Evan's last commits.
Metadata.php seems to be missing, so the new code doesn't work yet.
2004-04-04 22:33:11 +00:00
Evan Prodromou
22f8c4ce37 Added code to implement Dublin Core and Creative Commons RDF metadata.
If these features are turned on (with global flags), a metadata link tag is
provided to the appropriate action ('dublincore' or 'creativecommons'). When
the wiki script receives these actions, it creates RDF files on the fly.

Also includes two valuable general functions: one to show an HTTP error
(used when the flags are turned off), and one to do content negotiation
(used to determine the MIME type for RDF files).

A helper function is also added to page output to display metadata links.
2004-04-04 21:58:05 +00:00
Brion Vibber
84027db7f2 Installation, compatibility, security fixlets:
* Detect use of PHP as CGI and disable index.php/Title URLs
* Try to auto-create math tmp & output directories if not present
* Disable Asksql in default install ($wgAllowSysopQueries)

Added skin names to LanguageEo
2004-03-26 16:47:12 +00:00
Gabriel Wicke
d3831b1dd3 added manual purge action 2004-03-13 16:09:00 +00:00
Gabriel Wicke
35a86615bf calls to setSquidMaxage for cacheable pages 2004-03-13 13:43:22 +00:00
Brion Vibber
014093acc4 More globals and uninitialized variables fixes. Added WebRequest ($wgRequest)
object to encapsulate the handling of get/post variables:

The following grab something out of $_REQUEST. The first parameter is the
variable name and is required. The second is an optional default value:

  $wgRequest->getVal() - any type, returns NULL if no default given
  $wgRequest->getInt() - forced integer, 0 default
  $wgRequest->getText() - runs through $wgLang->recodeInput()
  $wgRequest->getBool() - return true/false
  $wgRequest->getCheck() - returns true if the var is set, even if to ""

$wgRequest strips slashes at initialization if necessary.

Also in this fine object:
  $wgRequest->wasPosted() - returns false if this wasn't a real form post,
    so we can protect against faked submissions in get urls.

There's still plenty of work to do, not everything uses the new functions
yet. To test the strict mode, do define('DEBUG_GLOBALS', 1);
2004-03-08 09:09:35 +00:00
Brion Vibber
51f738ea9a More unitialized variable cleanup && 'pure' register_globals cleanup...
Added wfDebugDieBacktrace() function to help in pinpointing problems by
showing a function call backtrace along with a friendly die message.
2004-03-08 02:50:04 +00:00
Brion Vibber
9e53bfc81c Imported the register_globals hack from REL1_2. Also starting work on
elimination of the use of import_request_variables (which gives us all
the insecurity of register_globals). Uncomment the define of DEBUG_GLOBALS
in index.php to turn on extra error reporting and trace down use of
uninitialized variables and nassssty globals.

Also rearranged the magic_quotes fixing, may not yet cover everything...
2004-03-08 01:51:32 +00:00
Brion Vibber
8d3f9999c3 Use PATH_INFO for prettier default URLs: index.php/Foo instead of index.php?title=Foo 2004-03-06 21:35:07 +00:00
Tim Starling
840dee3ad4 * Fixed magic quotes in $_REQUEST, in Setup.php
* Converted many instances of globals from the query to $_REQUEST
* Renamed near-useless Title::getURL() to Title::getPartialURL()
* Created new Title::getURL(), to replace wfLocalUrl, wfLocalUrlE, wfFullUrl and wfFullUrlE. Replaced most instances throughout the code
* In Parser.php, generalised stripping of <nowiki>, <pre> and <math> to allow more general use such as nesting
* Moved body of Article::preSaveTransform to Parser.php
* Put lots of comments in Title.php
2004-03-06 01:49:16 +00:00
Nicholas Pisarro, Jr
74a1c21d60 Implemented '$wgWhitelistRead'.
$wgWhitelistRead is now defined to be an optional array
of namespace:pages a user may see unless they login.

For example:
$wgWhitelistRead = array ( ":Main_Page", "Special:Userlogin", "Wikipedia:Help" );

will restrict an anonymous user to only those pages. They are
alerted that they must login, if the try to go to another page.

If 'false', the default, the anonymous user may see all pages,
except Sysop pages, of course.
2004-03-05 13:19:19 +00:00
Gabriel Wicke
4364a77058 allow caching for permanent redirects 2004-03-01 22:16:39 +00:00
Brion Vibber
d11bdf29ca Experimental in-place installer.
Doesn't yet do any database setup, but does produce a LocalSettings.php
that can successfully operate the wiki in the distribution directory
structure. Note that the maintenance scripts may not all be fully armored
against web access, and aren't set up to be run from the web by an actual
administrator either.
2004-03-01 12:59:45 +00:00
Brion Vibber
7f0854126d Double-check at runtime that sitename is set. Paranoia is good... if we don't do this, manual installs that are sloppy may introduce subtle bugs. 2004-02-29 08:06:49 +00:00
Erik Moeller
1dea93f758 using index.php and redirect.php instead of wiki.phtml and redirect.phtml
keeping phtml stubs around for compatibility and CVS history
2004-02-28 03:04:02 +00:00