Commit graph

612 commits

Author SHA1 Message Date
Niklas Laxström
cf60c784fb * Fix plural issues 2009-05-19 19:44:23 +00:00
Chad Horohoe
b645579853 (bug 18656) Use proper directory separators in wfMkdirParents(). Normalized all \ or / to DIRECTORY_SEPARATOR. 2009-05-14 20:45:14 +00:00
Andrew Garrett
155ddf6de4 Branch merge of preferences work branch. Includes fixes for several bugs. WARNING: Breaks some extensions which have not been adapted to use it properly (basically anything not used on Wikimedia). 2009-04-24 01:31:17 +00:00
Philip Tzou
f8adb054ff Follow on r49656, more comment added. 2009-04-20 04:33:37 +00:00
Philip Tzou
450585db88 Enabled LanguageConverter on CachedNotice to get a correct output. 2009-04-20 04:29:35 +00:00
Roan Kattouw
db6079a020 Fix up r49428: add missing brace 2009-04-12 18:15:09 +00:00
Roan Kattouw
fe68c7d84e Fix warning in PHP 5.1 when feeding Title objects to wfArrayToCGI(). Also enforce consistent style 2009-04-12 17:38:41 +00:00
Chad Horohoe
a0f8d5c6ea (bugs 11381, 11613) Session.save_handler issues:
* Added a new config variable, $wgSessionHandler to control what value the save_handler is set to
* Setting to null allows you to disable setting it entirely, which was the primary complaint of the two bugs, but it also allows you to set it to whatever you'd like
2009-04-10 14:53:32 +00:00
Remember the dot
e4d211703c (bug 12998) Allow <sup>, <sub>, etc. in DISPLAYTITLE 2009-04-09 05:15:43 +00:00
Robert Rohde
198cd4062b Adds fallback implementations of mb_strpos and mb_strrpos if native multi-byte support is not available.
See comments 65, 66, 68 on bug 6455.
2009-03-30 19:11:48 +00:00
Aryeh Gregor
7508ef184e Remove a couple of link() calls in enhanced RC
diff and cur links are now created using raw HTML instead of link(),
which they didn't really need anyway.  I didn't see any other obvious
candidates for conversion to raw HTML, since other things tend to need
fancy classes and have lots of other logic.  It's possible link() could
be made faster, too.
2009-03-29 17:09:47 +00:00
Andrew Garrett
63fca924cc Fast short-circuit for diffs between identical strings 2009-03-26 13:29:38 +00:00
Brion Vibber
6a55ea9598 Revert r48090 " * Modified wfMsg behaviour to do transform after substituting variables * If this works, wfMsg should now work similarly to wfMsgExt with parsemag"
While having the parser functions in the message strings work is a laudable goal, the problem here is that it'll *also* execute parser functions it finds in the replaced parameter strings, which may include, say, comment plaintext talking *about* parser functions.
A better fix for this is probably to expand the message placeholders when the parameters are passed in to the parser functions.
2009-03-25 02:07:09 +00:00
Chad Horohoe
1c4c27d3d1 Add optional $caller param to wfMkdirParents(). Should make debugging mkdir() errors easier. 2009-03-15 14:30:39 +00:00
Chad Horohoe
23fe20d4d1 (bug 17992) Revert crack-inspired r48399. 2009-03-15 13:45:41 +00:00
Chad Horohoe
49e97b4c41 Check if the path is writable before trying to mkdir(). 2009-03-14 02:17:01 +00:00
Alexandre Emsenhuber
cbe5bd26fc Don't call debug_backtrace if it's disabled to avoid a lot of E_WARNING 2009-03-09 13:57:32 +00:00
Niklas Laxström
94fff4e223 * Modified wfMsg behaviour to do transform after substituting variables
* If this works, wfMsg should now work similarly to wfMsgExt with parsemag
2009-03-06 12:19:45 +00:00
Aaron Schulz
3bdaba94c6 * Fixed $wgProfileToDatabase/$wgProfileCallTree interaction (later disabled the former)
* Made $wgProfileLimit actually work (bug 17485)
2009-02-24 09:50:22 +00:00
Aaron Schulz
f7ddb39d50 * Added titles to wfViewPrevNext() paging links
* Escape prevn/nextn messages. Other cleanup.
* Added some comments
2009-02-22 18:26:27 +00:00
Siebrand Mazeland
1093d39768 * remove forgotten case of hard coded pipe separator in Pager
* fix bug in GlobalFunctions.php introduced in r47028. pipeList() needs to be fed an array.
2009-02-09 14:31:48 +00:00
Siebrand Mazeland
a130b5b8fa * Update message 'pipe-separator' to have leading and trailing space for English and Occitan, to be able to remove some hard coded spaces
* Take out some hard coded pipe characters. Replace by message or Language::pipeList
* Take out a hard coded comma list SpecialIpblocklist.php. Replace by Language::commaList
2009-02-09 09:13:30 +00:00
Tim Starling
6237fe4bb5 * Fixed a whole lot of XSS vulnerabilities in the installer. All require a live installer, i.e. with no LocalSettings.php present.
* Implemented taint support in the installer and fixed some false positives (and false negatives)
2009-02-05 08:56:35 +00:00
Tim Starling
b45af1125c Added basic support for Wietse Venema's taint feature. Fixed a few instances of shoddy code that it turned up, no actual vulnerabilities yet. 2009-02-04 09:10:32 +00:00
Aryeh Gregor
1e24e79d0e Break off wfParseUrl() from wfMakeUrlIndex()
Should be no functional changes.
2009-01-23 18:02:48 +00:00
Leons Petrazickis
5c7431a08e (bug 17028) Added support for IBM DB2 database. config/index.php has new interface elements that only show up if PHP has ibm_db2 module enabled. AutoLoader knows about the new DB2 classes. GlobalFunctions has a new constant for DB2 time format. Revision class fixed slightly. Also includes new PHP files containing the Database and Search API implementations for IBM DB2. 2009-01-14 22:20:15 +00:00
Alex Z
6779a2cc13 adding newline to end of wfDebug calls where it was missing. 2009-01-13 20:28:54 +00:00
Tim Starling
b426115265 Test for disable_functions as well as safe_mode before attempting passthru(). For fix of bug 16902 in new-installer branch. 2009-01-07 12:20:30 +00:00
Brion Vibber
e3588da458 Revert r44978 -- breaks back-compat 2008-12-23 22:04:25 +00:00
Aaron Schulz
68d56c8731 At least disable old xml function loading per r44839. An easy ~9-10ms. 2008-12-23 21:42:42 +00:00
Brion Vibber
4e4431d76b Revert r44918 "Remove unused functions"
We keep these things for backwards compatibility, as they may be in use by extensions even if not in core code.
2008-12-23 21:30:19 +00:00
Aaron Schulz
828205ec51 Remove unused functions 2008-12-22 22:56:46 +00:00
Aaron Schulz
8f25eb1f85 (bug 16689) wfDebugLog writes an error in Apache error.log 2008-12-20 02:19:33 +00:00
Aaron Schulz
040e07acf7 Remove LogPage require 2008-12-19 07:37:07 +00:00
Ilmari Karonen
8b30615423 Add a new FileCache class to wrap RepoGroup::findFile() and findFiles(), and make wfFindFile() use it by default. This should improve performance for pages that refer to the same image several times, but the real benefit is that it allows batch file existence checks, à la LinkBatch, by collecting a set of titles (or DB keys) and calling FileCache::findFiles() on them to prefill the cache.
XXX: The code seems to more or less work, but it obviously needs more testing, regarding both stability and memory usage.  In particular, I have not tested file uploads yet -- there may be consistency issues there.
2008-12-14 05:47:48 +00:00
Brion Vibber
4e01dba6cc Revert r44254 "Cleanup to wfGetNull(): * Add override in case /dev/null isn't accessible (bug 11009)"
Doesn't seem like a proper fix here... At best, this'll be dumping random crap to some random file unless the user has a local copy of the /dev/null device file, which seems.... wrong. :)
For anything generating command lines, it probably won't make any difference (assuming exec() is enabled at all!) since open_basedir won't be searching through the command line (I think).
Assuming the core use case actually happens (open_basedir is set, but proc_open() is available to run tidy), a more correct fix is probably to go ahead and read in stderr and toss the results, or maybe better pass it through to PHP's stderr FD instead of opening /dev/null ourselves. Tidy has a -q option which should suppress random "hi i'm tidy version XYZ" if it's currently present.
2008-12-10 22:58:24 +00:00
Chad Horohoe
f36d56a2fe Cleanup to wfGetNull():
* Add override in case /dev/null isn't accessible (bug 11009)
* Use wfGetNull() in ProxyTools rather than hardcoding it
2008-12-05 17:25:22 +00:00
Andrew Garrett
c06afd56b3 Revert "Follow up on r43982. Reduce dirname(__FILE__) calls in core and extensions."
Uses $dir in extension files, and assumes that it remains unchanged in require_once( 'maintenance/commandLine.inc' ).
In fact, it is likely that '$dir' will be set when setting up command-line, as some extensions will use the same var.

Recommended fix: Use $CentralAuth_dir, $EmailPage_dir, etc.
2008-11-30 03:15:22 +00:00
Siebrand Mazeland
daaa7f37a1 Follow up on r43982. Reduce dirname(__FILE__) calls in core and extensions. 2008-11-26 23:17:15 +00:00
Ilmari Karonen
4051abe715 Turn wfMkdirParents() into just a thin wrapper around mkdir( $dir, $mode, true ); this won't work in PHP4, but we don't support that, do we?
NOTE: the old code used to ignore the umask by explicitly forcing the permissions with chmod().  If this is desired behavior, it can be achieved by temporarily setting the umask to 0, as in:

$oldmask = umask( 0 );
$rv = mkdir( $dir, $mode, true );
umask( $oldmask );
return $rv;

However, I can't see why we'd want to do this.  In the worst case, users with excessively tight umasks can find themselves with unusable directories, but the proper solution to that is to fix the umask rather than to 
ignore it.  In the best case, we've just plugged a security hole the user didn't realize they had (because they assumed their umask would Just Work).
2008-11-21 12:52:36 +00:00
Brion Vibber
7b972ea1a0 Use strict parameter on in_array() checks in wfMsgExt(). In PHP 5.1.6 this was whinging when a Language object was passed as 'language' parameter, trying to convert it to an int (!?).
Since we're only checking for exact strings, an exact match is just fine and it stops the whinging. (Saw no such problem on 5.2.6.)

Example whinge:
Notice: Object of class Language could not be converted to int in /Library/WebServer/Documents/trunk/includes/GlobalFunctions.php on line 742
2008-11-14 00:46:53 +00:00
Aaron Schulz
59c45b5cbe Revert r43329, r43330 due to said performance issues 2008-11-13 08:15:23 +00:00
Brion Vibber
76f9b0b973 Run parsemag stuff through the proper language when wfMsgExt() asks for a specific one.
Previously we only passed on if we were interface or content, but if we're rendering for some third alternative it didn't get used.
Note that parse and parseinline are probably still wrong.... some better model may be required here.
Also it may be wrong in the case of fallbacks ... if you get an English message, is it right to use the Czech magic word parsing?
Hmm.
Might back it out if there's a better way. :)
2008-11-13 01:02:17 +00:00
Victor Vasiliev
f5021e2274 * Add class "disambiguationpage" to body tag
* Split off MediaWiki:Disambiguationspage parsing to
  wfGetDisambiguationTemplates()
2008-11-09 18:21:42 +00:00
Tim Starling
2b4c3cd654 * Rewrote wfArrayMerge() in terms of array plus
* Two callers of wfArrayMerge() were bugs, both assuming strange and complex behaviour in wfArrayMerge() which has never been present or documented.
* Introduced wfMergeErrorArrays() to remove duplicates from merged error arrays, e.g. from getUserPermissionsErrors().
* Rewrote the remaining callers of wfArrayMerge() to use array plus. It makes the code clearer, assuming the reader knows more about basic PHP operators than GlobalFunctions.php. Considering the two bugs discussed above, this seems like a fair assumption. If you don't know PHP, you shouldn't be writing MediaWiki code.
2008-11-01 23:20:25 +00:00
Brion Vibber
4fd26b6b8a Update doc comment for wfArrayMerge() to note the behavior difference between array_merge() with string keys and the + operator on arrays. Now with less cursing. :) 2008-11-01 22:30:56 +00:00
Tim Starling
38707d9565 * Added $wgDebugLogPrefix, to allow users (or in this case, multiprocess command-line scripts) to set a debug log line prefix
* Improved blob_tracking.sql docs
* Allow testCompression.php to run until happy instead of a specified revision count
* Added docs for some debugging globals in DefaultSettings.php

In experimental script recompressTracked.php:
* Fixed crippling bugs, seems to work now. Needs more testing.
* Improved usage documentation
* Use DiffHistoryBlob by default if available
* Set a process-specific log prefix, added more debugging output
* Optimised commit() slightly by merging the locking read queries using IN()
* Fixed finishIncompleteMoves() so doPage() acts on only that page. Also run finishIncompleteMoves() for orphan lists.
2008-11-01 12:06:23 +00:00
Bryan Tong Minh
8e046be4a5 ISO 8601 timestamps can have decimal seconds 2008-10-31 15:53:15 +00:00
Greg Sabino Mullane
547cb9858c Postgres timestamps can have decimals. 2008-10-25 20:35:14 +00:00
Niklas Laxström
36ea5821d1 * Unused global 2008-10-21 15:05:10 +00:00