Commit graph

807 commits

Author SHA1 Message Date
Michael Dale
c601562cff * (bug 21140) Fixed Upload Form for using an Antivirus Program on Windows 2009-10-14 21:39:52 +00:00
Chad Horohoe
c5096e53cd Followup r56731, check for PHP 5.3 or greater (where it was fixed). Not a Windows issue 2009-09-30 00:38:32 +00:00
Chad Horohoe
b475a25f8d (bug 20353) wfShellExec() malfunctioning on NT builds 6002 and above. Patch by Jimmy Xu. 2009-09-21 19:50:16 +00:00
Alexandre Emsenhuber
6f9f6643d7 * indent debug output produced when both $wgShowDebug and $wgDebugFunctionEntry are enabled for better readability. In this case, unindented comment will be displayed "inline" with a yellow background
* added an id to the debug data list
* allow to use $wgShowDebug with $wgDebugComments set to false
* update HTMLFileCache to use full method name in debug output
2009-09-17 18:55:29 +00:00
Andrew Garrett
e8ea1aa080 LiquidThreads JS/AJAX updates
* Bump interval from 30s to 60s.
* Add an "update" link (text changed, sorry translators :(), which reloads the thread from the server.
* Fix bug in continuation caused by last-minute changes.
* Fix bug where only one reply per thread was being loaded.
* Fix bug where AJAX-loaded threads were loading one level too few.
* Fix bug in interpretation of API parameters.
2009-09-16 00:53:37 +00:00
Michael Dale
1e4165061b more (bug 20336)
* added json folder 
* moved Services_JSON.php there
* moved Format JSON into its own class
* updated AutoLoader
2009-09-10 14:33:25 +00:00
Tim Starling
7b7f9f0d4d Comments and whitespace fixes only. 2009-09-10 06:43:01 +00:00
Michael Dale
7efc871cba * (bug 20336) changed json_decode json_encode to static class in global functions
** we should update extensions as well
* added config for fileCheckModify date check to scriptLoader unique script id generation
2009-09-09 22:26:16 +00:00
Jack D. Pond
ad54e0bcf8 Bug 20489 Configure illegal file characters https://bugzilla.wikimedia.org/show_bug.cgi?id=20489
$wgIllegalFileChars configurable to add chars for filename automatically converted to "-".
2009-09-04 03:44:14 +00:00
Bryan Tong Minh
363375c69e Fix wfShellBackgroundExec for windows. Works in maintenance/eval.php mode, have not tested when running php as webserver module. 2009-08-28 19:32:07 +00:00
Bryan Tong Minh
05a916153f * Cleanup ApiUpload
* UploadBase::verifyUpload now always returns a status array
* Disabled async upload by url because wfShellBackgroundExec is broken
2009-08-26 19:38:38 +00:00
Brion Vibber
1505db42a2 Replace our mb_substr() fallback implementation with one which is not quite so horrible...
While not too awful on smallish strings, the way it worked was *murder* on large input:
the *entire string* would be broken up into an array of individual characters, sliced up,
then merged back together.

In my testing I couldn't even get the function to complete in a reasonable time for, say,
127k worth of text... not only did the regex split take forever, but it would eat an insane
amount of memory, likely triggering memory_limit hits in a sane world.

The new implementation counts characters from the beginning or end of a string to determine
the byte-based offsets to use for substr() start and count parameters, and only uses
a couple temporary dupes of the string in memory. For typical short offset/count cases
(take or trim one or a few characters) this performs about 3-5x worse than native mb_substr()
for in my testing.

Large offsets are optimized by first skipping the same number of bytes as characters, since all
characters take at least one byte. On primarily Latin text this made some of my test cases
actually *faster* than native mb_substr()! ;) For non-Latin texts this takes out a fair chunk
of our work, but can still leave us with very slow execution -- eg ~30ms to get through a few
dozens of kilobytes worth of offset on Japanese text. But at least it completes now!

This could probably be optimized further, perhaps skipping progressively smaller chunks in
binary-chop fashion. :)


For fun, my profiling results (profiling & test scripts are in a little git repo which I would
push to gitorious to poke at, but gitorious hates me right now and won't finish my repo setup):

strlen       mb_strlen short ascii - 0.0019ms - 19
strlen      xmb_strlen short ascii - 0.0672ms - 19

strlen       mb_strlen short unicode - 0.0019ms - 19
strlen      xmb_strlen short unicode - 0.0657ms - 19

strlen       mb_strlen long ascii - 0.0826ms - 20000
strlen      xmb_strlen long ascii - 0.1236ms - 20000

strlen       mb_strlen long unicode - 0.0774ms - 20000
strlen      xmb_strlen long unicode - 0.1901ms - 20000

strlen       mb_strlen san francisco - 0.4775ms - 126700
strlen      xmb_strlen san francisco - 0.4474ms - 126700


substr       mb_substr short ascii first - 0.0022ms - 1-byte string ("s") <- native
substr      xmb_substr short ascii first - 0.0168ms - 1-byte string ("s") <- old fallback
substr     xmb_substr3 short ascii first - 0.0069ms - 1-byte string ("s") <- new fallback

substr       mb_substr short ascii last - 0.0023ms - 1-byte string ("s")
substr      xmb_substr short ascii last - 0.0171ms - 1-byte string ("s")
substr     xmb_substr3 short ascii last - 0.0113ms - 1-byte string ("s")

substr       mb_substr short ascii trim last 9 - 0.0023ms - 10-byte string ("short asci")
substr      xmb_substr short ascii trim last 9 - 0.0183ms - 10-byte string ("short asci")
substr     xmb_substr3 short ascii trim last 9 - 0.0119ms - 10-byte string ("short asci")

substr       mb_substr short ascii middle 3 - 0.0022ms - 3-byte string ("sci")
substr      xmb_substr short ascii middle 3 - 0.0171ms - 3-byte string ("sci")
substr     xmb_substr3 short ascii middle 3 - 0.0149ms - 3-byte string ("sci")

substr       mb_substr short unicode first - 0.0022ms - 1-byte string ("s")
substr      xmb_substr short unicode first - 0.0184ms - 1-byte string ("s")
substr     xmb_substr3 short unicode first - 0.0071ms - 1-byte string ("s")

substr       mb_substr short unicode last - 0.0026ms - 2-byte string ("ß")
substr      xmb_substr short unicode last - 0.0187ms - 2-byte string ("ß")
substr     xmb_substr3 short unicode last - 0.0130ms - 2-byte string ("ß")

substr       mb_substr short unicode trim last 9 - 0.0024ms - 14-byte string ("short áéíó")
substr      xmb_substr short unicode trim last 9 - 0.0200ms - 14-byte string ("short áéíó")
substr     xmb_substr3 short unicode trim last 9 - 0.0137ms - 14-byte string ("short áéíó")

substr       mb_substr short unicode middle 3 - 0.0022ms - 6-byte string ("éíó")
substr      xmb_substr short unicode middle 3 - 0.0188ms - 6-byte string ("éíó")
substr     xmb_substr3 short unicode middle 3 - 0.0189ms - 6-byte string ("éíó")

substr       mb_substr san fran first - 0.0022ms - 1-byte string ("{")
substr     xmb_substr3 san fran first - 0.0069ms - 1-byte string ("{")

substr       mb_substr san fran last - 0.8914ms - 1-byte string ("\n")
substr     xmb_substr3 san fran last - 0.0109ms - 1-byte string ("\n")

substr       mb_substr san fran non-first - 0.5995ms - 127318-byte string (c00cabc812ac347bd2e81a3e3f04e23d)
substr     xmb_substr3 san fran non-first - 0.0213ms - 127318-byte string (c00cabc812ac347bd2e81a3e3f04e23d)

substr       mb_substr san fran middle 1k - 0.2218ms - 1025-byte string (c42eb5c511670f72ff4593a39219682c)
substr     xmb_substr3 san fran middle 1k - 0.3883ms - 1025-byte string (c42eb5c511670f72ff4593a39219682c)

substr       mb_substr boston-ja first - 0.0021ms - 1-byte string ("{")
substr     xmb_substr3 boston-ja first - 0.0068ms - 1-byte string ("{")

substr       mb_substr boston-ja last - 0.5497ms - 1-byte string ("\n")
substr     xmb_substr3 boston-ja last - 0.0110ms - 1-byte string ("\n")

substr       mb_substr boston-ja non-first - 0.4128ms - 127637-byte string (933e70d1d10f4d64cdfbd69b58592cd4)
substr     xmb_substr3 boston-ja non-first - 0.0216ms - 127637-byte string (933e70d1d10f4d64cdfbd69b58592cd4)

substr       mb_substr boston-ja middle 1k - 0.2237ms - 2006-byte string (1eaa8554ff4507109b1cba7a597d82bf)
substr     xmb_substr3 boston-ja middle 1k - 30.6811ms - 2006-byte string (1eaa8554ff4507109b1cba7a597d82bf)
2009-08-26 05:51:21 +00:00
Chad Horohoe
ba7d16a410 Merge r53381 from wmf-deployment. Throw more informational error on creation failure. 2009-08-22 16:50:03 +00:00
Alexandre Emsenhuber
4d2ccdcfdd Document wfWarn() function 2009-08-20 21:35:22 +00:00
Tim Starling
831b6d2bf7 * Per my CR comments on r44560: merged FileCache into RepoGroup and fixed wfFindFile() global function bloat. Did not port unused functions such as the batch loading functions.
* Fixed the formal parameter bloat in the file finding functions by making wfFindFile(), RepoGroup::findFile() and FileRepo::findFile() take an associative array of options instead of a rapidly growing collection of formal parameters. Maintained backwards compatibility for the $time parameter, which was the only one used in an extension.
* Took the advice of the todo comment on FileRepo::findFiles() and implemented a calling convention for specifying times (and other options)
* Removed the file object cache from Parser, redundant with the RepoGroup file cache
* Deleted clueless and non-functional LocalRepo::findFiles(). Does not respect redirects, deletion bitfields, or anything else nuanced about FileRepo::findFile(). Does not have the same calling convention as FileRepo::findFiles().
2009-08-15 09:59:59 +00:00
OverlordQ
ab8c557b78 Followup to r54416
Dont log messages when you 'increase' the limit from a number to itself.
2009-08-05 02:34:41 +00:00
OverlordQ
30e44a06fc Follow up to r54414 and r54356. Hopefully catches all of the edge cases of erroneous input. On a side note, if PHP is configured with too low a limit it can die before it even reaches the code in Setup.php 2009-08-05 01:33:18 +00:00
Andrew Garrett
8daea0e131 Fix syntax error 2009-08-04 15:08:56 +00:00
Chad Horohoe
2b0d981500 Better patch for parsing PHP's memory limits from OverlordQ. 2009-08-04 11:18:05 +00:00
Chad Horohoe
1d5874a8c7 (bug 16084) Default memory limit should be increased 2009-08-04 02:47:39 +00:00
Niklas Laxström
45130adc36 Memcached does not like spaces in keys 2009-08-03 11:36:47 +00:00
Chad Horohoe
3eafc7fe53 Http::get() doesn't return an object, it already returns the results or null anyway. BTW: is anyone actually still using this? *stab* 2009-08-01 18:44:28 +00:00
Aryeh Gregor
45785d0eb9 Comment on limitations of wfExpandUrl 2009-07-28 00:07:03 +00:00
Shinjiman
cfe959606e Tweak to use lowercase on other cases, which follows r53720 and r53722. 2009-07-25 07:23:03 +00:00
Shinjiman
1f47196eca fix another typo on documentation :P 2009-07-24 19:42:56 +00:00
Shinjiman
a68af638f5 fix E_NOTICE on r53720 and r53721. 2009-07-24 18:35:09 +00:00
Shinjiman
c9e410a392 fix typo on documentation 2009-07-24 17:51:44 +00:00
Shinjiman
0a114fd1ea Tweak the language code display more comply with the BCP 47 standards, using a new global function wfBCP47(). 2009-07-24 17:41:01 +00:00
Alexandre Emsenhuber
1bd4757375 * fix doxygen warnings
* fix wfReportTime()'s identation
2009-07-23 17:14:07 +00:00
Aaron Schulz
6988ca0c35 Extra quotes are breaking wfShellExecute() for me...need to look into this more to see what changed (PHP or cmd?) 2009-07-20 02:04:54 +00:00
Michael Dale
2d5154e634 * addressed r53282#c3209 moved conditional inclusion of $wgExtensionMessages in mwScriptLoader.php to Setup.php
* put a @ in front of get_headers() should hopefully avoid errors where allow_url_fopen=0
* combined $wgPhpCliPath into the similar used $wgPhpCli var
* minor js & example file mwEmbed fixes
2009-07-15 22:41:56 +00:00
Michael Dale
aefc40d749 here it is ... the upload-api, script-server, js2 (javascript phase2) branch merge 1st attempt.
Here is a short overview of changes and associated default configuration variables (most everything is off by default) also see ~soon to be updated~: http://www.mediawiki.org/wiki/Media_Projects_Overview

= Upload Improvements =
==Upload API ==
* Based on the early work of Bryan Tong and others it adds the upload option to the api.
* We rewrite Special:Upload page to include use the new refactoring
* Added in token checks in both the SpecialUpload.php page so avoids DOS / xss copy-by-url JavaScript based cross site POST file submissions

== Copy by URL==
$wgAllowCopyUploads = false;
* http class rewrite includes a new http background download see: includes/HttpFunctions.php

* spins off a php process that calls: maintenance/http_session_download.php
* pushes updates to the session and gives the user a progress bar on http copy uploads from other server progress (using js2 upload interface) (if not using the js2 upload interface it does the request in-place but the download is limited to the php ini timeout time)

== Firefogg ==
* Firefogg enables resumable upload by chunks
* progress indicators and conditional invokation (js2 system)
* and of-course client side transcoding.

= Script Server =
$wgEnableScriptLoader = false;
* off by default if $wgEnableScriptLoader is turned on script files are grouped, gziped, cached etc.
for more info see: http://www.mediawiki.org/wiki/Extension:ScriptLoader

* Includes some early skin js include fixes (skin/script system still lots of love)
* Includes a "javascript class autoloader" this is packaged into mwEmbed so that the mwEmbed library can work in stand alone mode (while retaining localization and script serving) (one such application is the make page for firefogg.org : http://www.firefogg.org/make/index.html  )
* The file that contains the autojavascript loading classes is: js2/php/jsAutoloadLocalClasses.php
* One can use this auto class loading dependency system with extensions and add-ons but I need to better document that.

= js2 system  / mwEmbed=
$wgEnableJS2system = false

* includes initial rewrite towards more jquery based javascript code
* especially for the Special:Upload page.
* Also the edit page include support for the "add-media-wizard"
* includes dependency loader for javascript that optionally takes advantage of the script-loader
* remote embedding of javascript interfaces (like embedding video, or commons media searching)

* $wgDebugJavaScript = false; .. .this variable lets you always get "always fresh javascript". When used with the script-loader it does not minify the script-loader output.

= mwEmbed =
* Will commit a separate patch to oggHandler that conditionally outputs  <video tag> to use the new javascript video player.
** mv_embed player includes: play-head, volume control, remote embedding, oggz-chop support across plugins.
* add-media-wizard adds easy inserts of media to pages (with import)

== jQuery==
* we include a base install of jQuery, jQuery ui and some plugins.
* all the javascript classes are in the scriptloader so its easy to load any set of jquery ui components that you may need using the script-server. You get a callback so you can then execute js with dependencies loaded.

== other stuff ==
there is a bit more code in js2 that pertains to sequence editing, timed text display and basic image editing. We include a base import of pixastic-lib & pixastic-editor... will work with the pixastic developer to try and ensure upstream compatibility on our usage of the library for in-browser photo and sequence manipulation.
2009-07-14 23:52:14 +00:00
Tim Starling
1f79ae389d * Re-added $wgMessageCache->addMessages(), there are still some extensions (in and out of subversion) that rely on it. Call wfDeprecated().
* Made wfDeprecated() issue a notice only once for each function name instead of every time the function is called.
* Added exceptions for malformed keys input to $wgMessageCache->get(), per CR comments on r52503
* Fixed notice from MWException::useMessageCache()
2009-07-03 06:19:39 +00:00
Tim Starling
23cfebd3d2 * Introduced a new system for localisation caching. The system is based around fast fetches of individual messages, minimising memory overhead and startup time in the typical case. It handles both core messages (formerly in Language.php) and extension messages (formerly in MessageCache.php). Profiling indicates a significant win for average throughput.
* The serialized message cache, which would have been redundant, has been removed. Similar performance characteristics can be achieved with $wgLocalisationCacheConf['manualRecache'] = true;
* Added a maintenance script rebuildLocalisationCache.php for offline rebuilding of the localisation cache.
* Extension i18n files can now contain any of the variables which can be set in Messages*.php. It is possible, and recommended, to use this feature instead of the hooks for special page aliases and magic words. 
* $wgExtensionAliasesFiles, LanguageGetMagic and LanguageGetSpecialPageAliases are retained for backwards compatibility. $wgMessageCache->addMessages() and related functions have been removed. wfLoadExtensionMessages() is a no-op and can continue to be called for b/c. 
* Introduced $wgCacheDirectory as a default location for the various local caches that have accumulated. Suggested $IP/cache as a good place for it in the default LocalSettings.php and created this directory with a deny-all .htaccess.
* Patched Exception.php to avoid using the message cache when an exception is thrown from within LocalisationCache, since this tends to fail horribly.
* Removed Language::getLocalisationArray(), Language::loadLocalisation(), Language::load()
* Fixed FileDependency::__sleep()
* In Cdb.php, fixed newlines in debug messages

In MessageCache::get(): 
* Replaced calls to $wgContLang capitalisation functions with plain PHP functions, reducing the typical case from 99us to 93us. Message cache keys are already documented as being restricted to ASCII.
* Implemented a more efficient way to filter out bogus language codes, reducing the "foo/en" case from 430us to 101us
* Optimised wfRunHooks() in the typical do-nothing case, from ~30us to ~3us. This reduced MessageCache::get() typical case time from 93us to 38us.
* Removed hook MessageNotInMwNs to save an extra 3us per cache hit. Reimplemented the only user (LocalisationUpdate) using the new hook LocalisationCacheRecache.
2009-06-28 07:11:43 +00:00
Roan Kattouw
f3892257db Self-revert r52011 per CR comments 2009-06-17 11:01:11 +00:00
Tim Starling
6cba5762b7 Bug 19240 (bad image list performance regression):
* Don't connect to the commons DB on cache hits, in order to determine the cache key name. Removed remnants of that bright idea from GlobalFunctions.php.
* Fixed total failure of negative caching in checkRedirect() due to memcached stripping trailing spaces from string values. Probably never worked.

Also:
* Respect hasSharedCache in foreign repos. Recently-added code was apparently ignorant of this setting.
* Renamed getMemcKey() to getSharedCacheKey() to make its function more clear, introduced getLocalCacheKey() to do the other thing. Fixed its parameters to be like wfMemcKey() and used it in more places.
* Used getLocalCacheKey() in various places instead of wfMemc(), to avoid having multiple repositories overwrite each others' caches. 
* Fixed the BagOStuff bug that the FIXME in LocalRepo::checkRedirect() appears to refer to.
* Removed getMasterDB() and getSlaveDB() from FileRepo, it's incorrect to assume that a repo other than a LocalRepo has an associated database.
* Made FileRepo::invalidateImageRedirect() a stub, to match FileRepo::checkRedirect(). Moved the functionality to LocalRepo where checkRedirect() is concretely implemented.
2009-06-17 07:31:00 +00:00
Roan Kattouw
f6ed098d04 Adding wfParsePHP() to GlobalFunctions.php for use in the LocalisationUpdate extension (will update tomorrow). 2009-06-16 22:56:06 +00:00
Tim Starling
9177887791 Changes related to update.php:
* Removed counter.php. Whoever heard of adding a file for a single line of code? Refactored the callers to GlobalFunctions.php wfCountDown().
* Removed the requirement for $wgDBadminuser to be set in update.php. There really is no security benefit, it's just there to annoy users and cause bugs like #19127. Just use $wgDBuser, commandLine.inc will automatically set it to $wgDBadminuser if it's available.
* Since we're using $wgDBuser now, we may as well just use wfGetDB(DB_MASTER) instead of the rubbish special-case code that was already there. There's no need for special-case error handling, there's already special-case code for command line connection errors, if you don't think that message is informative enough then you can change it there.
* Don't set $options before including commandLine.inc, it doesn't do anything.
* Use require not require_once
2009-06-09 17:04:16 +00:00
Alexandre Emsenhuber
ae4026c182 changed wfMsgExt()'s warnings to use the new wfWarn() so that the caller function is also displayed 2009-06-06 10:55:04 +00:00
Jure Kajzer
da53ed0501 Oracle database abstraction updated.
Rewriten tables.sql, added user.sql (creating db user with privileges)
Fixed epoch in Special Ancientpages and Unusedimages
Timestamp default format altered in db abstraction and changed wfTimestamp function 
SearchOracle changed to return empty resultset on empty term search (query error in oracle)
TODO: Maintenance scripts update
2009-06-05 11:45:32 +00:00
Niklas Laxström
a03687f4d6 Revert part of r50883, superseded by Tim's r51453 2009-06-04 07:38:00 +00:00
Andrew Garrett
e2700a6071 Per comments on code review, use JSON instead of PHP serialization for Abuse Filter data interchange. PHP's unserialize() can expose remote code execution vulnerabilities with some input. 2009-06-02 12:59:05 +00:00
Tim Starling
323c74c734 Reverted r49855, r49656, r49401, r49399, r49397. The language converter cannot be used outside the parser at present without generating a large number of bugs, due to global lifetime state variables, inappropriate $wgParser references, etc. Some refactoring needs to be done before it can be used in this way. 2009-05-26 07:46:29 +00:00
Niklas Laxström
98aa14bc87 * $wgDevelopmentWarnings can be set to true to show warnings about deprecated
functions and other potential errors when developing.
* (bug 14118) SpecialPage::getTitleFor does not return a localised name
2009-05-23 10:14:24 +00:00
Niklas Laxström
16bba5546c * Unescape two entities when transforming. Motivation is to allow to use "Foo&nbsp;:" with escaping, like Xml::label( wfMsg('daa') ...
* Escaping fix
2009-05-22 09:38:27 +00:00
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
Tim Starling
9e3b81e321 Use a variable for max shell time, don't use php.ini, like we do for memory and file size. 2008-10-16 11:32:44 +00:00
Tim Starling
0ca52a920d Revert merge of DismissableSiteNotice into the core (r41679 and subsequent edits). We should have higher standards than this for core code. This is largely my own crap code and there's a reason I didn't commit it to the core in the first place.
* The sitenotice_id hack is virtually unusable and needs to be replaced with a dedicated message update interface. 
* There's a need for automatic message expiry. 
* The Wikimedia-specific "spite the anons" feature, preventing anonymous users from dismissing site notices because they allegedly don't contribute to the wiki enough to deserve it, needs to be made optional.
2008-10-11 04:31:15 +00:00
Antoine Musso
45081512a1 Document wfVarDump() 2008-10-09 21:11:10 +00:00
Alex Z
098f276067 Fix some profiling errors in wfGetSiteNotice() if no sitenotice is defined 2008-10-09 21:08:42 +00:00
Aaron Schulz
59ba5e575b Revert r41788 and make flaggedrevs do the findFile call itself 2008-10-07 21:42:23 +00:00
Alexandre Emsenhuber
a8925f9747 Revert r41792, broke uploads. Note that RepoGroup::findFile() returns false if no file was found, which might be the case when uploading new files ;) (see bug 15883) 2008-10-07 20:14:55 +00:00
Aaron Schulz
56fac0c47d Tweak r41788 - Use findFile() to check current version if $time given 2008-10-07 02:22:37 +00:00
Aaron Schulz
ff4db4a3eb Add handy $time parameter to wfLocalFile() 2008-10-07 00:30:18 +00:00
Alexandre Emsenhuber
5c8a1938da Fix XHTML error (url not escaped) 2008-10-06 18:56:14 +00:00
Tim Starling
90ed80443e (bug 12586) Use wfHostname() everywhere, remove $wguname and $wgNodeName. Use getenv('COMPUTERNAME') on Windows. 2008-10-06 07:30:38 +00:00
Tim Starling
0d322a394e * Allow $wgDiff3=false
* Don't call quickUserCan('edit') unless section edit is enabled
* In DatabasePostgres and DatabaseSqlite: throw an exception on connection error
* In DatabasePostgres: don't send an invalid connection string whenever one of the fields is empty. Use quoting.
* In Database: make the captured PHP error prettier
* Display a descriptive error message when the user navigates to index.php with PHP 4, not a parse error. Check to see if the *.php5 extension works, using file_get_contents().
* The default port number for PostgreSQL is 5432, not blank.
* Better default for $wgDBname
2008-10-06 00:45:18 +00:00
Ryan Schmidt
a235f130a6 * fixing DismissSiteNotice so that it works properly with javascript-disabled browsers
* make DismissSiteNotice honor cookie configuration variables
* adding missing name to CREDITS
2008-10-05 21:28:11 +00:00
Ryan Schmidt
2861a4862c * fixing bugs with DismissableSitenotice merge:
** [dismiss] link does not show up if sitenotice is blank
** [dismiss] link is in line with notice instead of under
2008-10-05 19:53:49 +00:00
Jack Phoenix
e1b9d8b91a Merging DismissableSiteNotice extension into core. 2008-10-04 23:46:06 +00:00
Alexandre Emsenhuber
5167cf4cad Fix for r41430: wfMsgExt() now accepts a Language object in the language key of $options 2008-09-30 17:15:11 +00:00
Tim Starling
dc935786a3 Hostnames are allowed to have dots in them 2008-09-30 08:45:52 +00:00
Tim Starling
c69d5d46e8 Proposed fix for bug 14944, specifically the reports that some servers do not have en_US.UTF-8. Make the locale configurable via $wgShellLocale. Detect available locales and set $wgShellLocale to an appropriate value on install. Also fixes safe_mode putenv() warnings. RELEASE-NOTES entry will go to 1.13. 2008-09-29 10:19:11 +00:00
Aryeh Gregor
695161a6f1 Fix totally broken last commit, misread the existing code 2008-09-26 21:35:03 +00:00
Aryeh Gregor
3fe917dc68 Remove unnecessary conditional 2008-09-26 21:31:17 +00:00
Aryeh Gregor
82d21903e6 Fix for 41288, don't raise errors for language parameter
The documentation didn't make it clear that the wfMsgExt() array can take a single associative parameter.  I've clarified this, and fixed error-checking for that.  Also adjusted indentation in the comment for clarity (one space isn't enough).
2008-09-26 21:31:10 +00:00
Aryeh Gregor
70f83843e0 Raise E_USER_WARNING if bad option passed to wfMsgExt() 2008-09-26 17:25:17 +00:00
Tim Starling
80a610618c Fix unnecessary GlobalFunctions.php bloat from r41148 2008-09-24 08:36:44 +00:00
Tim Starling
aab518cf78 * Add a simple log demultiplexer, written in python, for low-volume MediaWiki logs
* in wfErrorLog(): clean up log text so that it works properly with the multiplexer
2008-09-24 08:17:35 +00:00
Tim Starling
b77387ca89 Implemented UDP logging. 2008-09-24 07:11:41 +00:00
Aaron Schulz
9894dfb363 Refactor RC2UDP code some 2008-09-22 12:22:18 +00:00
Tim Starling
9b8782aaa8 Don't run hour-long, unlimited row-count DB queries with set_time_limit(0) in response to unauthenticated web requests on the master. Run them on the slave instead. Maybe we can crash the whole cluster instead of just a master or two.
Don't use DB_LAST, ever again.
2008-09-20 15:00:53 +00:00
Brion Vibber
37dded29d1 Revert r40953 '(bug 7509) Don't hardcode separation strings, make them configurable'
This seems to make code much uglier and harder to maintain -- there are a bajillion new calls to "wfMsgExt( 'pipe-separator' , 'escapenoentities' )" which is not trivial or easy to remember. This makes code uglier, harder to read, harder to maintain, and more prone to error.
2008-09-18 17:11:51 +00:00
Siebrand Mazeland
0057d58e09 (bug 7509) Don't hardcode separation strings, make them configurable
* Introduced message 'pipe-separator' to replace many occurrence of " | ". No changes made in skin "Nostalgia".
2008-09-17 09:41:51 +00:00
Brion Vibber
11132c0edb * (bug 10463) Apply $wgRenderHashAppend to sitenotice cache keys so SSL and non-SSL sites get separate notice caches.
This seems to be a little funny, though, at least on commons -- the commonswiki:sitenotice:https=1 key is just storing 'false' so it presumably gets reparsed on each run. I can't see any way that this should be happening, which is a little intimidating...
2008-09-16 21:14:25 +00:00
Tim Starling
a549004e6d In wfDebugLog(): log the hostname if $wgShowHostnames is true. Cache the hostname. 2008-09-05 03:46:07 +00:00
Tim Starling
a76bedb1a8 In wfShellExec(), log return code 127 to a special log file, to check for missing executables on the Wikimedia cluster. 2008-09-05 03:32:09 +00:00
Tim Starling
fde6099061 header() replaces by default, there's no need to pass a second parameter 2008-09-01 04:32:36 +00:00
Antoine Musso
8ec6021ab7 wfDebugMem() to report memory usage 2008-08-28 16:22:10 +00:00
Greg Sabino Mullane
2f217035e2 Once we reset, no need to keep looping. 2008-08-28 14:18:13 +00:00
Aaron Schulz
d1902b0d39 Set replace flag for headers 2008-08-27 20:44:43 +00:00
Andrew Garrett
5a2a85a1b4 *ahem* self-revert. Something weird happened with getAll() 2008-08-20 14:12:52 +00:00
Andrew Garrett
4b5d8c21a8 Use a nice fancy deep-merge function for merging arrays in SiteConfiguration (newly written), and move the merging of config options and globals deeper into get(), so we don't need to duplicate the same functionality in the entry points. 2008-08-20 14:08:50 +00:00
Aryeh Gregor
c7a50892d6 Re-committing 37663 for the new release, per old Wikitech-l discussion.
* (bug 13815) In the comment for page moves, use the colon-separator message instead of a hardcoded colon.
* So that this works properly, don't escape HTML entities in edit summaries.  I don't see any good reason for them to be escaped there.  Of course, this may result in old edit summaries displaying slightly differently if for some reason they included an entity, but in that case there's at least a 50% chance that they intended it to not be escaped in the first place.
2008-08-18 18:15:47 +00:00
Aryeh Gregor
6b1a9d4e4e Unescape more "safe" characters when producing URLs, for added prettiness. Checked against RFC 1738; should cause no problems if wfUrlencode() is only applied to bits of the URL after the domain name. And if it is applied to the domain name or protocol as well, this is probably less broken, if anything, not more, since hex escapes aren't permitted in the domain name or protocol part. 2008-08-08 15:45:52 +00:00
Fran Rogers
851eaecd50 Wrapped certain tricky constructs in @cond/@endcond to prevent Doxygen
from choking on them and segfaulting.
2008-08-06 03:55:49 +00:00
Aryeh Gregor
81d611bcac Re-commit turning makeKnownLinkObj(), makeBrokenLinkObj(), makeLinkObj() into link() wrappers. This should mean that all link processing now goes through link(). Per Brion's advice, remove the BrokenLink hook and replace it with LinkBegin and LinkEnd hooks. All parser tests pass except the usual suspects. 2008-08-05 17:05:59 +00:00
Aryeh Gregor
280afa8af2 Last commit contained errors. Revert most of it, keep only the tweaks to link() itself (and relevant parser test changes). 2008-08-03 17:05:17 +00:00
Aryeh Gregor
b83553af8b * Output title before class in Linker::link() to match behavior of makeLink() and friends, so as not to have to change old parser tests.
* Do not add action=edit to nonexistent special pages.
* Add profiling point for the bit where we add classes in linkAttribs().
* Turn makeLinkObj(), makeKnownLinkObj(), makeBrokenLinkObj() into wrappers for link().  This requires the creation of two new functions to turn query strings/attribute strings into arrays, but still results in fewer LOC (-11 lines) due to less code duplication.  This should be well-tested by the parser tests, because pretty much all link creation now goes through link(), but the only changes are encoding single quotes in attributes, which is a good change.  I find no additional database queries, so since this isn't a CPU bottleneck, there should be no performance issues.
2008-08-03 16:52:55 +00:00
Alexandre Emsenhuber
a4cfa79ea8 * factorize common code
* allow to pass directly a Language object
2008-07-26 20:41:52 +00:00
Chad Horohoe
9ec4162d33 Add some docs on how far back wfLoadExtensionMessages() goes 2008-07-25 13:39:00 +00:00
Alexandre Emsenhuber
e66e5e2416 Use the internal diff engine if the diff excutable is not found 2008-07-21 16:24:39 +00:00
Brion Vibber
b006e95852 Cleanup for r37830 & earlier ($wgDirectoryMode default to wfMkdirParents()):
Just check is_null() here. is_int() isn't necessarily safe, as numbers frequently get passed around in what are really strings. :)
2008-07-19 07:29:43 +00:00
Chad Horohoe
65517fd5ff $wgDefaultDirectoryChmod -> $wgDirectoryMode. Less crappy name + docs I should've written on the original commit. 2008-07-18 18:03:50 +00:00
Alexandre Emsenhuber
335b860fb5 fix in debug output 2008-07-17 16:55:21 +00:00
Andrew Garrett
34ba79f969 Fix handling of non-unified diffs in wfDiff 2008-07-17 12:30:40 +00:00
Andrew Garrett
d1e81fec8b Add wfDiff function, similar to wfMerge (some copied), used in AbuseFilter extension to generate a line-by-line machine-readable diff between two texts. Shells out to diff utility. 2008-07-17 12:19:51 +00:00
Chad Horohoe
21a76ba181 Add $wgDefaultDirectoryChmod, allows customizing the default chmod value. Set to 0777 by default to keep current behavior. 2008-07-16 18:36:40 +00:00
Brion Vibber
f9a9047219 Revert r37663 for now:
"* (bug 13815) In the comment for page moves, use the colon-separator message instead of a hardcoded colon."
"* So that this works properly, don't escape HTML entities in edit summaries.  I don't see any good reason for them to be escaped there.  Of course, this may result in old edit summaries displaying slightly differently if for some reason they included an entity, but in that case there's at least a 50% chance that they intended it to not be escaped in the first place."

This breaks the ability to easily discuss entities in summaries such as "add &nbsp;".
2008-07-15 21:13:34 +00:00
Aryeh Gregor
32e0e290a6 * (bug 13815) In the comment for page moves, use the colon-separator message instead of a hardcoded colon.
* So that this works properly, don't escape HTML entities in edit summaries.  I don't see any good reason for them to be escaped there.  Of course, this may result in old edit summaries displaying slightly differently if for some reason they included an entity, but in that case there's at least a 50% chance that they intended it to not be escaped in the first place.
2008-07-14 21:43:27 +00:00
Brion Vibber
4aedae2126 Revert r37567 for nwo ("(bug 8604) padright: and similar functions fail with non-ASCII arguments")
This implements an mb_str_pad fallback function, but there is no mb_str_pad in PHP documentation, and the doc comments are really weird -- it says it returns an integer!
If this function is created from whole cloth and doesn't exist in PHP, it should be given a MediaWiki style name and not be done with a function_exists check as though it were a compat function.
2008-07-12 14:05:04 +00:00
Niklas Laxström
9ba65533b5 * (bug 8604) padright: and similar functions fail with non-ASCII arguments 2008-07-11 18:08:18 +00:00
Aryeh Gregor
12b4eba6ef Revert r37299. It's causing some extremely strange behavior that I can't pin down. Try copying the text =={{[[Navbox]]}}== into a page, where [[Template:Navbox]] is copied from enwiki. An exhibit is up at <http://en.wikipedia.org/wiki/User:Simetrical/Tl_test> until this fix goes live. This was reported at <http://en.wikipedia.org/wiki/Wikipedia:Village_pump_(technical)#Problem_with_.7B.7Btl.7D.7D_in_section_headers> by CapitalR; thanks to RockMFR for tracking down the revision that was causing it.
As a general rule, it would be a good idea to first split the functions off into their own file without changing them, and then refactor them in a separate commit.  Otherwise it's very hard to follow what's actually being changed.  (git actually tracks changes to functions when they're moved across files, incidentally, which is quite awesome.)
2008-07-10 19:18:00 +00:00
Victor Vasiliev
0c6e06d583 Fix previous commit (removed accidentally commited wfVarDump change + whitespace fix) 2008-07-10 08:32:34 +00:00
Victor Vasiliev
b9c4d8d7a7 * (bug 14772) Disallow moving images to invalid titles 2008-07-10 08:16:58 +00:00
Brion Vibber
1fd0e2db0c Revert r37443 for the moment:
* Code duplication of validity checks between wfIsValidFileName() and UploadForm::internalProcessUpload() -- this guarantees behavior will become inconsistent over time. Move the normalization into a single place.
* The additional chars excluded for Windows don't cover the entire set of illegal chars. There are several more punctuation characters, plus general issues such as all non-ASCII characters.
* Application of filesystem rules based on OS could result in strange inconsistent behavior; alternate filestore backends could support different sets of legal characters.
* No clear reason for the change to wfVarDump(); var_export works just fine and doesn't use the fragile output buffering
2008-07-10 04:47:25 +00:00
Victor Vasiliev
e7487c0789 * Forbid files with * and ? to be uploaded under Windows (it caused internal errors since such characters are illegal there)
* Forbid files to be moved to invalid filenames
* wfVarDump() should use var_dump(), not var_export()
2008-07-09 21:11:08 +00:00
Niklas Laxström
60f3e72328 * Move message functions to own file
* Improve documentation
* Reduce code duplication
* Fix the braindamage that wfMsg and friends were doing transform, but in the wrong language
2008-07-08 08:05:54 +00:00
Ryan Schmidt
a070873551 * Add new hook NormalizeMessageKey to allow extensions to change what system message is being shown before any queries are made 2008-07-07 22:37:42 +00:00
Brion Vibber
c0edae192b Revert r37281 "Split Compatibility functions to own file"
This would make maintenance harder by duplicating information between GlobalFunctions.php and CompatibilityFunctions.php. If you forget to add a function to the list, the compat functions might not get loaded and you'll run into surprise errors.
2008-07-07 20:15:16 +00:00
Niklas Laxström
51c0a9fe2e * Split Compatibility functions to own file 2008-07-07 19:54:43 +00:00
Siebrand Mazeland
badc7f7d7a Trying to resolve commit r37017/revert r37018: Throw an E_USER_NOTICE saying that function is deprecated for wfGetHTTP() and wfIsLocalURL() 2008-07-04 06:47:47 +00:00
Tim Starling
90a1018148 Revert r37017. Please do not remove functions unless you have a really really good reason, say because you actually want to break all extensions that use them because the underlying functionality needs to be removed. There are more extensions out of Wikimedia version control than in it, and many sysadmins will not update their extensions simultaneously with the core. 2008-07-04 02:52:44 +00:00
Chad Horohoe
9bbd9c2f53 Remove wfGetHTTP() and wfIsLocalUrl(). Unused wrapper functions for stuff in the Http class. 2008-07-04 02:25:38 +00:00
Daniel Friesen
50a69c753f Partial revert of r36804:
Removing the wfSharedTable function.
The function uses a $wgExternalSharedDB which is not part of Core, and has not been defined in default settings. The variable itself has no apparent purpose and is likely to make the existing use of $wgSharedDB even more complex and prone to breakage.

The function wfSharedTable itself, appears more like a Wikia made function to support transition of 1.12 wiki in which $wgSharedTables did not exist over to 1.13 in which it does exist.
If this is the actual point of it, then it serves no point in being added to core. 1.13 already has $wgSharedTables and it serves better to append to that, than to use wfSharedTable. This is something that extensions should be defining themselves if they need it for transition from old 1.12 wiki to 1.13.
2008-06-30 09:22:00 +00:00
Jack Phoenix
599b5a42d0 Two new hooks and one new global function from Wikia codebase 2008-06-30 08:42:09 +00:00
Niklas Laxström
c671129ee2 * Fail fast 2008-06-27 12:17:05 +00:00
Roan Kattouw
140ff5b2fc Re-add wfEncryptPassword() (removed in r35923 in favor of User::crypt() and User::oldCrypt()) for extension compatibility, so old extensions don't go around and throw fatal errors all over the place. 2008-06-11 22:20:26 +00:00
Niklas Laxström
418f0faafe * Cache debug messages until $wgOut is initialised 2008-06-07 12:57:59 +00:00
Tim Starling
461a770a6f * Changed password hash format, see wikitech-l
* Made the PasswordReset and Maintenance extensions, and maintenance/changePassword.php work with CentralAuth, by calling User::setPassword() instead of updating the database directly. They work now even if you use an object cache.
* Don't automatically log in as the user in question when CentralAuthUser::setPassword() is called, it's kind of uncool when an administrator is setting the password of another user.
* Fix bug 14330 by setting the local passwords on demerge
2008-06-05 12:58:02 +00:00
Tim Starling
b5c2e1b4ed Fix and revert revert of 35819. is_writable() should apply to the parent, not the nonexistent new directory. 2008-06-04 00:14:13 +00:00
Brion Vibber
0da2c4cc39 Revert r35819 -- broke thumbnailing.
10 previously passing test(s) now FAILING! :(
      * Thumbnail image caption with a free URL  [Introduced between 03-Jun-2008 19:49:16, 1.13alpha (r35816) and 03-Jun-2008 23:42:22, 1.13alpha (r35827)]
      * BUG 1887: A ISBN with a thumbnail  [Introduced between 03-Jun-2008 19:49:16, 1.13alpha (r35816) and 03-Jun-2008 23:42:22, 1.13alpha (r35827)]
      * BUG 1887: A RFC with a thumbnail  [Introduced between 03-Jun-2008 19:49:16, 1.13alpha (r35816) and 03-Jun-2008 23:42:22, 1.13alpha (r35827)]
      * BUG 1887: A mailto link with a thumbnail  [Introduced between 03-Jun-2008 19:49:16, 1.13alpha (r35816) and 03-Jun-2008 23:42:22, 1.13alpha (r35827)]
      * BUG 1887: A <math> with a thumbnail- we don't render math in the parsertests by default,
so math is not stripped and turns up as escaped &lt;math&gt; tags.  [Introduced between 03-Jun-2008 19:49:16, 1.13alpha (r35816) and 03-Jun-2008 23:42:22, 1.13alpha (r35827)]
      * BUG 1887, part 2: A <math> with a thumbnail- math enabled  [Introduced between 03-Jun-2008 19:49:16, 1.13alpha (r35816) and 03-Jun-2008 23:42:22, 1.13alpha (r35827)]
      * Image caption containing another image  [Introduced between 03-Jun-2008 19:49:16, 1.13alpha (r35816) and 03-Jun-2008 23:42:22, 1.13alpha (r35827)]
      * Bug 3090: External links other than http: in image captions  [Introduced between 03-Jun-2008 19:49:16, 1.13alpha (r35816) and 03-Jun-2008 23:42:22, 1.13alpha (r35827)]
      * Width + Height sized image (using px) (height is ignored)  [Introduced between 03-Jun-2008 19:49:16, 1.13alpha (r35816) and 03-Jun-2008 23:42:22, 1.13alpha (r35827)]
      * <references> after <gallery> (bug 6164)  [Introduced between 03-Jun-2008 19:49:16, 1.13alpha (r35816) and 03-Jun-2008 23:42:22, 1.13alpha (r35827)]
2008-06-03 23:46:56 +00:00
Niklas Laxström
e9ccdd29ca * When passing invalid or nonexistent language code to wfMsgExt, fallback to English instead of some random interface language we are currently using 2008-06-03 20:32:13 +00:00
Niklas Laxström
30831d808b * Revert wfMkdirParents back to old method not using recursive mkdir
* mkdir is affected by umask
 * modifying umask is not thread safe
 * work around is to use chmod... which the old code already did
2008-06-03 20:28:28 +00:00
Roan Kattouw
7c1e050219 Fixing regression from r35298: wasn't adding enough ampersands. 2008-06-03 10:58:45 +00:00
Tim Starling
f3bffd7ca9 Revert r35478, r35264, r35262: $wgPerLanguageCaching feature. Bug found with $wgPerLanguageCaching=false. Nikerabbit, please see me for a detailed code review. 2008-06-01 03:27:48 +00:00
Brion Vibber
d9d9843f65 * (bug 14273) Fix for HTTP Accept header parsing with spaces as from Konqueror
Also went ahead and had it normalize all values to floats rather than a mix of ints and strings.
2008-05-28 19:17:02 +00:00
Robert Leverington
7c9094176d * Revert r35469.
* For some reason PHP doesn't always report errors even when error reporting is set to maxmium.
* The date\time system needs some sort of work doing to it, there is stuff for it spread everywhere and no definite timezone.
* Regardless, an E_STRICT level error does not constitute a major severity and High priority bug.
2008-05-28 17:54:12 +00:00
Robert Leverington
8e41f42b67 Fix bug 7715:
* Add two conditional functions date_default_timezone_get() and date_default_timezone_set()
  which are created if they are not available (PHP <5.1.0).
* Replace setenv( TZ= ) and getenv( TZ ) calls with date_default_timezone_get( TZ ) and
  date_default_timezone_set( TZ ).
* Remove some warning supression calls, they were suppressing an E_STRICT level error that
  is thrown in PHP >5.1.0, however the above changes stop that error from ever occurring
  in the first place.
* Alter comment in DefaultSettings.php to refer to this function rather than the old
  method of using setenv().
* Add item to RELEASE-NOTES bug fixes section and fix line width of one item.
Based on attachment 2577 by nekocue.
2008-05-28 07:40:55 +00:00
Roan Kattouw
a8cfb856c4 Add array support to wfArrayToCGI(): when receiving parameters in the form of &foo[]=bar&foo[]=baz, PHP automatically sets $_GET['foo'] = array(bar, baz); When feeding the original query back to wfArrayToCGI(), it used to choke on that. Now wfArrayToCGI() actually converts array('bar', 'baz'); back to the &foo[]=bar&foo[]=baz form. 2008-05-24 21:54:57 +00:00
Niklas Laxström
0f5e68b417 * New option $wgPerLanguageCaching, for wikies with many translated system messages in MediaWiki namespace.
* Sidebar is now cached for all languages
2008-05-23 22:14:32 +00:00
Tim Starling
349f8d7fce Clarify behaviour of wfGetDB(DB_SLAVE) 2008-05-23 08:54:19 +00:00
Brion Vibber
ff4b2c0342 Kill r34826's unnecessary boolval() per yesterday's IRC discussion (thought vasilievv was going to revert himself, but guess not :D) 2008-05-15 15:38:51 +00:00
Victor Vasiliev
b6d72cfeb2 * Move $var ? true : false check to boolval function
* Introduce $wgLogActionsHandlers
2008-05-14 19:12:00 +00:00
Brion Vibber
fc9c516328 Reverting 34794 for the moment; some bad whitespace, and seems to add bunches of stuff without obvious reason yet. 2008-05-14 18:28:52 +00:00
Daniel Friesen
5dd203bf9a Support Array input in Title::getLocalURL and Title::getFullURL.
GlobalFunctions.php now has 2 new functions:
wfBuildQuery and wfParseQuery.
These are similar to the PHP http_build_query and parse_str for query handling. However they don't have the issues which those ones suffer from.
2008-05-14 10:25:09 +00:00
Greg Sabino Mullane
dfbb03c690 Refactor duplicated code into one area.
Remove unneeded parens in regexes, don't set matches array if not needed.
Add warning about odd gmmktime() behavior.
2008-05-11 20:39:43 +00:00
Victor Vasiliev
50a581996a * Fix image redirect caching so it doesn't break image redirects on shared repositories 2008-05-10 19:22:14 +00:00
Brion Vibber
7df3adb9ae Revert r34541 for the moment pending further review & discussion...
There's some kind of crazy magic_quotes stuff in here which screams RED ALERT, something's weird going on! :)
2008-05-09 23:52:04 +00:00
Daniel Friesen
4ee7da5b09 Fixing up a variety of GlobalFunctions and also improving queries in Titke.php.
* getFullURL and getLocalUrl now accept arrays and objects as valid input.
* Use wfAppendQuery in getLocalUrl to match up with getFullURL.
* wfArrayToCgi is now a alias to wfBuildQuery (Parameters are in the OPPOSITE order so wfBuildQuery takes defaults as second param and wfArrayToCgi takes them as first parameter like it always did)
* New function wfBuildQuery.
** The code moved here from what once was wfArrayToCgi has been changed from a set of plain loops to a wrapper around http_build_query so that complex data is handled correctly.
** We now support strings and objects as input, and we even parse strings when necessary to merge queries.
* New function wfForeignWikiID to pair with wfWikiID like wfForeignMemcKey. The foreign id can take 2 parameters, if omitted it falls back to the shared db, then to the local db if not set.
* wfMemcKey and wfForeignMemcKey now call the respective wf(Foreign)WikiID function, this simplifies the functions, and avoids code duplication making sure things always match even if for some strange reason it's changed.

I'll likely be using the forign functions later to improve the use of a shared interwiki map to avoid redundant caches.

I could always make the local MemcKey and WikiID functions depend on the foreign ones in a sane way
2008-05-09 23:36:21 +00:00
Bryan Tong Minh
581554c080 * Add new flag FIND_IGNORE_REDIRECT to wfFindFile and functions it depends on
* Follow redirects on image pages if the redirect is actually an image redirect
* Add comments to the check for redirect code in MediaWiki::initializeArticle so that I actually understand what it does
2008-05-08 20:15:09 +00:00
Tim Starling
451e87a875 * Rename wfGetAvailableRights() to User::getAllRights()
* Reintroduce $wgAvailableRights so that the above function is not so terribly slow and broken
2008-05-07 06:42:16 +00:00
Tim Starling
fef24bc6ff Send wfDeprecated notices to the debug log only. We don't actually want to fix all of these occurrences. 2008-05-06 00:59:16 +00:00
Brion Vibber
32936ec833 Revert r34260, r34261. Comments add flavor to the source code!
Remember that expletives aren't used just for fun; they indicate the severity of the problem that had to be worked around.
2008-05-05 20:50:40 +00:00
Siebrand Mazeland
f98138ce14 Remove some emotional outbursts 2008-05-05 18:00:45 +00:00
Robert Leverington
6ffebab03d * Wrong variable in last commit. 2008-05-05 14:17:31 +00:00
Robert Leverington
1cb51c3fc2 * Missed the extension name array key. 2008-05-05 14:14:28 +00:00
Robert Leverington
deca107b90 * wfLoadExtensionMessages() now accepts a language code as its second argument, rather than a boolean indicating whether or not to load all messages. This allows extension developers to be more discriminate with regards to which languages they load, avoiding the problem of loading lots of message localisations and fall backs not being merged in. 2008-05-05 13:29:51 +00:00
Brion Vibber
6b16f44108 * (bug 13905) Blacklist Mac IE from HttpOnly cookies; it eats them sometimes
God I wish this browser would finish dying. :D

The particular situation was that the session cookie was getting eaten as "disabled", thus not sent back to the server so your session state never quite happened. Other cookies on submit seemed to come in intact, but without the session cookie you'd get a big fat error message, even if you set the long-term login cookie option.

Mac/IE seems to always *see* the HttpOnly cookies, but it sometimes marks them as "disabled". It seems to be incorrectly parsing the options after the path, sometimes seeing "/;" as the path instead of "/". Failure is more likely if there's no expiration option (as with the session cookie), or if there *is* a secure option set.

Anyway, just set up a user-agent blacklist $wgHttpOnlyBlacklist and copied the Mac/IE entry over. The HttpOnly setting now gets ignored for blacklist hits as well as for old PHP versions, the check being encapsulated into wfHttpOnlySafe().

Also added some logging for cookie settings, around the setcookie() and session_set_cookie_params() calls.
2008-05-01 20:25:17 +00:00
Robert Leverington
225c34df76 Revert r33918, no longer works given new fallback caching and there are alternate methods for determining message fallback. 2008-04-27 14:50:55 +00:00
Alexandre Emsenhuber
4d3e46bfd1 tweaks for r33917:
* use level 1 to get file and line, this from where the deprecated function was called
* added class if available
2008-04-26 19:09:04 +00:00