Commit graph

108 commits

Author SHA1 Message Date
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
631e737c7f added {{ to wfEscapeWikiText, so that the deletion log looks nicer (requested on #wikipedia) 2004-08-12 01:27:31 +00:00
Arne Heizmann
b28ab61f58 With &debugmsg=1, PHP output a warning because the link trail no longer
constituted a valid regular expression; fix that
2004-08-10 22:48:02 +00:00
Arne Heizmann
57fae72421 If &debugmsg=1 is passed as part of the request parameters, display all
the message keys instead of the actual messages.  I think this will be
very useful to sysops trying to find out what message in the MediaWiki
namespace to edit.  I hope this does not incur too much of a server
performance degradation, since this function is used pretty frequently.
2004-08-10 20:17:55 +00:00
Arne Heizmann
63a52404cb expand comment 2004-08-10 16:51:26 +00:00
Domas Mituzas
5af42946aa Add internal timestamp wrapper wfTimestamp($outputtype,$timestamp);
Obsoletes: wfTimestamp2Unix, wfUnix2Timestamp, wfTimestampNow;
Autodetects database, mediawiki and unix timestamps

to be done: inverted timestamp support
2004-08-10 08:28:43 +00:00
Brion Vibber
a55d07c1ef Suppress notices 2004-08-08 09:39:16 +00:00
Arne Heizmann
0b99c990f9 remove commented-out code. We have CVS for archiving it 2004-08-04 00:28:56 +00:00
Magnus Manske
6cd83364ec bug 964201 fix 2004-08-03 20:01:52 +00:00
Brion Vibber
b2ce8e4306 Fix typo in reference to sql file that needs to be run 2004-08-02 04:58:54 +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
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
Tim Starling
3c4d38faee Removed arbitrary change in timestamp formats between MySQL and PostgreSQL, moved global functions to GlobalFunctions 2004-06-29 12:23:59 +00:00
Tim Starling
524d56a6f1 DB error log 2004-06-29 07:09:00 +00:00
Tim Starling
05703f122b Nicer looking errors in command line mode 2004-06-26 03:28:58 +00:00
Brion Vibber
d66d9bd492 Fix for the is_a() reimplementation on old PHP versions. I swear I thought
this had been checked in ages ago...
2004-06-24 05:52:27 +00:00
Tim Starling
5cc5b123cd fixed bug for PHP <4.3.0 2004-06-14 08:58:10 +00:00
Antoine Musso
ae8a5e31ab fix isWindows to wfIsWindows. 2004-06-12 21:32:18 +00:00
Tim Starling
49749f3091 wfSetRef doesn't work, making isWindows() function which I was going to use somewhere else but decided against it 2004-06-12 06:05:02 +00:00
Antoine Musso
e73f3d2a28 replace several double quotes by single quotes. 2004-06-08 20:06:01 +00:00
Tim Starling
727d419e7e Support for database profiling, profiling bracket in ParserCache.php 2004-05-28 05:45:13 +00:00
Gabriel Wicke
018a2eead0 use ?, not \& for top-level wikis 2004-05-17 20:04:50 +00:00
Tim Starling
98f45933ed bug fix in wfUtf8ToHTML 2004-05-15 14:03:00 +00:00
Tim Starling
f8bbc61b42 Various board vote enhancements, moving to the BoardVote directory 2004-05-15 10:36:59 +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
Brion Vibber
33f1e77c11 PHP 4.1.2 compatibility fixes (based on patch submission by Asheesh Laroia)
Also, urlencode anchor names for non-ascii compatibility. This is the
recommendation of HTML 4.01 standard in B.2.1, as far as I can tell.
Works in UTF-8 at least for IE6/win, Firefox, Safari.
2004-05-10 01:54:56 +00:00
Tim Starling
0fb5ad60b1 Board of Trustees vote 2004-05-09 02:32:04 +00:00
Brion Vibber
1571a7c4c3 Suppress PHP warnings on failure to create thumbnail subdirectories. This should be checked at file save time and a human-friendly error message listed instead 2004-05-08 04:41:54 +00:00
Tim Starling
8f22cb45b1 include_once -> require_once 2004-05-07 13:43:10 +00:00
Jens Frank
144e0c2ed1 moved some more functions from GlobalFunctions to Image 2004-05-04 20:35:37 +00:00
Jens Frank
42f39da880 wfImageUrl moved from Globalfunctions to Image
Preferred access via $image->getUrl(), but for compatibility
Image::wfImageUrl() still works
2004-04-24 23:45:11 +00:00
Brion Vibber
f171bd0f88 Fix notices 2004-04-10 10:02:16 +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
Tim Starling
5104b9f29c more debugging rubbish, sorry 2004-04-03 07:49:26 +00:00
Tim Starling
27a4c0aee2 oops, debug output 2004-04-03 07:03:34 +00:00
Tim Starling
a134fab3c7 Made wfMerge() work on Windows, and fixed some merge-related comments in EditPage 2004-04-03 05:55:37 +00:00
Tim Starling
c10b49adf4 refactoring and $wgRequest use 2004-04-01 12:37:45 +00:00
Tim Starling
e9aa758d7a Removed dependence on register_globals from everything except the special pages. Fixed miscellaneous bugs. 2004-03-29 14:48:07 +00:00
Tim Starling
f4a210165c fixed notice 2004-03-23 10:25:16 +00:00
Tim Starling
2ca258fd03 * Changed inclusion syntax to allow e.g. {{stub}}
* Split MediaWiki namespace into MediaWiki and Template (requires changes to all language files)
* Purge links to on edit of Template namespace
* General refactoring of purging and cache invalidation code
2004-03-20 15:03:26 +00:00
Mr. E23
eacbec8220 Fixed problem with merging of identical changes 2004-03-14 21:34:03 +00:00
Mr. E23
525092fa9f Experimental merging of edit conflicts 2004-03-14 15:05:52 +00:00
Gabriel Wicke
69782d650f purge first url only once 2004-03-09 14:00:37 +00:00
Gabriel Wicke
ce031abd74 bug fixes and indentation in purge function 2004-03-09 12:07:35 +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
b59ce22943 Replace the random boolean parameters on Title::getURL() with a set of
practical, clear methods:
  Title::getLocalURL() - "/wiki/index.php/Foobar" or "/wiki/index.php?title=Foobar&action=edit"
  Title::getFullUrl() - ditto with $wgServer on the front
  Title::getInternalUrl() - ditto with $wgInternalServer on the front (for some squid-related functions)
  Title::escapeLocalUrl() - local URL escaped for HTML output
  Title::escapeFullUrl() - full URL escaped for HTML output

All take an optional query parameter.

Title::getURL(), wfFullUrl() and wfFullUrlE() are now officially
deprecated and will result in instant death. wfLocalUrl() and wfLocalUrlE()
will be killed shortly; they are still used in the language files.
2004-03-07 07:26:56 +00:00
Brion Vibber
4dac4d85c6 Add digit transformation function Language::formatNum() for Arabic and other
languages which need to use localized (decimal) digits. Sample implementation
for Arabic.
2004-03-06 03:03:14 +00:00