Commit graph

499 commits

Author SHA1 Message Date
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
Robert Leverington
8e3967d0a9 * Add parameter to MessageCache::get() to allow prevention of using a fallback language (default: false).
* Add option to wfMsgExt() 'nofallback' as an interface to the new parameter added to MessageCache::get().
2008-04-26 18:05:43 +00:00
Niklas Laxström
87e9fc6034 * Print caller if possible in deprecated warnings 2008-04-26 17:57:29 +00:00
Alexandre Emsenhuber
6a6482ab0c * Simplify a bit MessageCache::get(), don't load all valid languages name if the value passed is boolean
* do the same in wfMsgGetKey()
2008-04-24 13:02:32 +00:00
Robert Leverington
932aa091c7 * MessageCache::get $forContent parameter replaced with $langcode parameter so
that messages can be retreieved for any language.
* wfLoadExtensionMessages() now has the option to load messages for all the
  languages it contains.
* 'language' option added to wfMsgExt() so that a message can be retreieved from
  a specific language.
2008-04-24 11:59:32 +00:00
Andrew Garrett
34ee5d8675 By suggestion of NikeRabbit, move wfBuildForm into Xml.php 2008-04-24 11:46:20 +00:00
Andrew Garrett
eee9c290db Various final compatibility additions to work with global groups, which is ready for review 2008-04-24 11:36:47 +00:00
Brion Vibber
31e80b39fb Apply $wgCookieHttpOnly setting to the session cookie as well 2008-04-16 23:06:51 +00:00
Siebrand Mazeland
79d5225c0e * remove end of line whitespace
* remove empty lines at end of file
* remove "?>" where still present
2008-04-14 07:45:50 +00:00