Commit graph

527 commits

Author SHA1 Message Date
Raimond Spekking
aeafb71568 * Added variables 'wgRestrictionEdit' and 'wgRestrictionMove' for JS to header 2007-06-04 10:09:41 +00:00
Tim Starling
ed4303922f Merged filerepo-work branch:
* Added support for configuration of an arbitrary number of commons-style file repositories.
* Split Image.php into filerepo/File.php and filerepo/LocalFile.php
* Renamed Image::getImagePath() to File::getPath()
* Added initial support for timestamp-based file fetching (OldLocalFile), to be expanded upon by aaron.
* Changed the interface for Image/File object creation: use wfFindFile() or wfLocalFile() depending on semantics
* ImageGallery::add() now accepts a title object as the first parameter
* Moved file handling operations on upload from SpecialUpload to File
* Removed path-related functions from ImageFunctions.php. Removed static path accessors from File. 
* Added a Content-Disposition header to thumb.php output
* Improved thumb.php error handling
* Updated the unit test suite to kind of partially work with modern computers. RunTests.php doesn't work just yet. Fixed an actual regression that the test suite detected -- moved some defines to Defines.php where they will be loaded consistently.
2007-05-30 21:02:32 +00:00
Ilmari Karonen
d0fcb1af79 It's dead code, Jim! 2007-05-14 07:40:10 +00:00
Ilmari Karonen
183818b0a7 Disable user scripts on Special:Preferences, to prevent a compromised
script from being able to sniff passwords etc.

(The control flow here is hopelessly tangled between OutputPage and
the skins, and it doesn't help that Skin and SkinTemplate do things
differently for no particular reason.  I haven't made any attempt to
untangle it in this commit, but hopefully I at least haven't made it
too much worse.  Cleanup is welcome.)
2007-05-08 20:48:02 +00:00
Nick Jenkins
1a60bd4c84 (bug 7958) Special:Cite of older version of an article should use old version id.
Applying Brion's patch, with one-line tweak:
 - uses the existing Skin/$wgOut-based revision ID record, rather than oldid value from WebRequest.
 - additionally sets it to the current revision for parser cache hits (where
   it was not previously needed, since it was only used to feed to parser objects
   to fill the {{REVISIONID}} variable).
 - Explicit declaration of the existing $mRevisionId data member in Skin.
 - "Permanent link" should now work too when paging through historical versions (previously it
   would be greyed out when paging backwards or forwards through old revisions).
2007-05-03 06:08:12 +00:00
Nick Jenkins
bd23ec29c6 Doc tweaks:
* Seems like an opportune time to introduce "@addtogroup Media" documentation tags.
* Merge "@addtogroup Metadata" (used by Exif.php) into "@addtogroup Media".
* Few more moving comment blocks to above classes.
2007-04-24 06:53:31 +00:00
Antoine Musso
343420d0ad Convert whitespaces to tabulations 2007-04-21 14:44:56 +00:00
Antoine Musso
be73785e8f Fix #3366 : require skins based on SkinTemplate to override the skinname property. 2007-04-16 13:23:16 +00:00
Rob Church
984e7ada40 (bug 8421) Expose current action in JavaScript globals (as 'wgAction') 2007-03-27 21:15:23 +00:00
Aryeh Gregor
a4fd25f587 (bug 9217) Balance wfProfile calls in Skin::outputPage 2007-03-08 01:40:56 +00:00
Nick Jenkins
c6c3d72563 (bug 3678) Allow disabling [[MediaWiki:aboutsite]] in the same way as
[[MediaWiki:Disclaimers]]; Also means that if any of the footer links are
disabled in the wiki's default language (by setting to "-"), they'll also
be disabled in other languages too (e.g. if the user specifies uselang=fr),
which was probably want the site admin wanted to happen anyway.
2007-02-16 03:43:40 +00:00
Niklas Laxström
a2b6b9ab69 * Some enhancements to live preview 2007-02-09 20:34:57 +00:00
Brion Vibber
6038f9ed00 * Clean up session checks to better handle the case where the session was
opened during the current request. May help with some caching corner
  cases.
2007-02-05 21:42:48 +00:00
Antoine Musso
8baca0fdf1 Final fix for #8712 : publish effective user groups to javascript.
Patch by Carl Fürstenberg http://bugzilla.wikimedia.org/attachment.cgi?id=3126
2007-01-23 20:10:02 +00:00
Nick Jenkins
f88c771756 The war on redundant ampersand usage!
* Convert "$dbw =& wfGetDB( DB_MASTER );" --> "$dbw = wfGetDB( DB_MASTER );"
* convert "$skin =& $wgUser->getSkin();" --> "$skin = $wgUser->getSkin();"

For the time being have not changed the function definitions of wfGetDB() or User::getSkin() [i.e. they are still both return-by-ref], so as to ensure the interface does not change for extensions [some of which may still be trying to run on PHP4 environments]. However presumably at some point this can be changed too.

Also includes tiny tweak to newlines in parserTests - will show 1 rather than 2 newlines between the "Reading tests from" strings when in quiet mode.
2007-01-22 23:50:42 +00:00
Tim Starling
096eb47ffd Fix Skin::preloadExistence() for special pages. 2007-01-22 19:19:15 +00:00
Rob Church
031d38fdce * (bug 8712) Expose user groups as a JavaScript global [patch c/o AzaToth]
* Tweak release notes from hashar's last commmit
2007-01-20 19:38:51 +00:00
Antoine Musso
f5e16ebe09 userCan(Edit|Create|Move) are deprecated : do not use them 2007-01-20 17:58:38 +00:00
Antoine Musso
c771fc9c96 Use Doxygen @addtogroup instead of phpdoc @package && @subpackage 2007-01-20 15:09:52 +00:00
Antoine Musso
b144fcb85d Rename constructors to __constructor 2007-01-20 13:34:31 +00:00
Brion Vibber
de72df4032 * (bug 3000) Fall back to SCRIPT_NAME plus QUERY_STRING when REQUEST_URI is
not available, as on IIS with PHP-CGI
2007-01-16 01:45:51 +00:00
Aryeh Gregor
c7098cde76 * (bug 8643) Correctly escape the page-specific CSS class for non-Monobook skins
* Tweak a comment
* Use $this->mTitle instead of $wgTitle in SkinTemplate, I suppose, although there's no difference
2007-01-15 16:29:41 +00:00
Nick Jenkins
784e69d028 For the "includes/" directory:
* removing unused local vars
* removing used global declarations
* adding FIXMEs against extract() calls and lines that seem to be using uninitialized variables
* adding some array() declarations.
2007-01-12 10:03:51 +00:00
Brion Vibber
d507b9f57a Fix regression in MediaWiki:Monobook.js and MediaWiki:Common.js loading.
Most language files defined these messages with the initial caps, which
with the new changes to the message cache meant they didn't get loaded
properly when requested directly out of software defaults instead of
through the database... woopsie!
2007-01-08 10:58:50 +00:00
Aryeh Gregor
b3c52d88b7 Roll back workaround for Firefox link underlining: I realized that <u><u>Foo</u></u> is not necessarily supposed to display the same as <u>Foo</u>, so there will be double-underlining or similar bad stuff in some cases. Mozilla has to fix this one. 2007-01-06 23:19:33 +00:00
Aryeh Gregor
f9a8c8551b Work around a bizarre interpretation of standards by Mozilla (https://bugzilla.mozilla.org/show_bug.cgi?id=365970): when links are underlined, so should all their descendants. 2007-01-05 17:34:35 +00:00
Aryeh Gregor
69ea9bcf9b (bug 7169) Use Ajax to watch/unwatch articles. Patch by Dan Li with some modification by me. 2006-12-26 23:53:34 +00:00
Niklas Laxström
b7239f0b67 * Added wgCanonicalSpecialPageName to JavaScript variables 2006-12-25 15:03:54 +00:00
Aryeh Gregor
92ed0ffbd6 * (bug 532) Tweaked alt text for some interface messages
* (bug 8231) Gave useful alt text to the main <img> on image pages
* (bug 371) Remove alt text for "Enlarge" icon on thumbnails
2006-12-22 20:31:10 +00:00
Ilmari Karonen
c984b57a04 be safe, just in case 2006-12-18 00:46:36 +00:00
Ilmari Karonen
7d96219479 fix localized aliasing of various links from skin to special pages with subpages 2006-12-18 00:20:21 +00:00
Tim Starling
8a7a4aac72 Removed broken feature $wgBreakFramesExceptions 2006-12-15 13:45:05 +00:00
Brion Vibber
6944909a8c * (bug 8264) Fix JavaScript global vars for XHTML mode
Don't use <!-- --> to wrap JavaScript code!
This ACTUALLY MAKES THE CODE DISAPPEAR when using an XML parser.
Instead, wrapped in /*<![CDATA[*/ /*]]>*/ to ensure XML compatibility for contents.

We've long since given up on super-ancient browsers that don't
know about <script>; they're so old you can't even use name-based
virtual hosts so why bother? ;)
2006-12-14 23:24:06 +00:00
Antoine Musso
171945efed User::getOption now accept a default value to override default user values
this makes it consistent with WebRequest::get* methods. Corrected code in
various places accordingly.
2006-12-14 20:28:38 +00:00
Tim Starling
439f59fb7b * Added redirect to section feature. Use it wisely.
* Added a configuration variable allowing the "break out of framesets" feature to be switched on and off. Off by default -- there's all sorts of flashy frameset gadgets around, outright abuse is more rare, especially for small default installs.
* Refactored URL fragment handling.
* Made Title::secureAndSplit() slightly more legible.
* Refactored makeGlobalVariablesScript() -- it's not particularly convenient or maintainable to pass all global variables through the template array. The array is there for BC, not flexibility.
2006-12-08 06:09:15 +00:00
Nick Jenkins
64bf1c829f Reverting oldid parts of r18156 and r18150, as should not be taking 'oldid' out of $wgRequest as it is going to be frequently incorrect, and can contain bogus integer data.
E.g. outputs the wrong value here: http://en.wikipedia.org/w/index.php?title=Calcitriol&direction=next&oldid=71374766
and outputs a negative value here: http://en.wikipedia.org/w/index.php?title=Calcitriol&direction=next&oldid=-71374766
2006-12-04 23:29:15 +00:00
Nick Jenkins
0e2426cc65 E_STRICT minor tweaks:
* Strict Standards: Undefined index:  currevisionid in includes/Skin.php on line 287
* Strict Standards: Undefined index:  oldid in includes/Skin.php on line 288
[ Repo above with error_logging(E_ALL | E_STRICT) in LocalSettings.php, and a non-default skin, e.g: http://localhost/wiki/index.php?title=Main_Page&useskin=nostalgia ]
* Strict Standards: is_a(): Deprecated. Please use the instanceof operator in includes/UserMailer.php on line 42
2006-12-04 11:28:48 +00:00
Leon Weber
fdd4356a61 * Added js variable wgOldId which shows the oldid when viewing an old revision 2006-12-03 12:35:50 +00:00
Leon Weber
66055b27a7 * Added js variable wgCurRevisionId to the output 2006-12-03 11:44:23 +00:00
Ilmari Karonen
e0b9a317ed Use Title::newMainPage() in various places instead of calling
wfMsgForContent( 'mainpage' ) directly.  Also add release notes
for previous commit.
2006-12-03 00:22:14 +00:00
Nick Jenkins
ae8554c45b Completing code housekeeping stuff for rest of includes/ directory: removing unused local vars, removing unused globals, replacing extract() where simple to do, declaring output arrays before calling preg_match(), and so forth. 2006-11-29 11:43:58 +00:00
Nick Jenkins
74ea267553 Prevent the following strict-standards warnings - i.e. when running with error_logging(E_ALL | E_STRICT); - which seems to disable the yucky "@" operator, as well as maxing out the pedantry of warnings. Nothing major found, just nice to be as explicit and as forward-compatible as possible.
* Strict Standards: Undefined index: switch in includes/Parser.php on line 3849
* Strict Standards: Undefined index: ref in includes/Parser.php on line 3818
* Strict Standards: Non-static method OutputPage::setEncodings() should not be called statically in index.php on line 11
* Strict Standards: Only variables should be assigned by reference in includes/Skin.php on line 888
* Strict Standards: Non-static method Title::newFromURL() should not be called statically in includes/SpecialContributions.php on line 178
* Strict Standards: Only variables should be assigned by reference in includes/GlobalFunctions.php on line 2054
* Strict Standards: Undefined index:  contributions-summary in languages/Language.php on line 764
* Strict Standards: Undefined index:  trackbackhtml in skins/MonoBook.php on line 86
* Strict Standards: Undefined index:  blockip in skins/MonoBook.php on line 204
* Strict Standards: Undefined index:  tagline in skins/MonoBook.php on line 261
* Strict Standards: Undefined index: uselang in includes/SkinTemplate.php on line 1159
* Strict Standards: Non-static method CoreParserFunctions::plural() cannot be called statically in includes/Parser.php on line 2902
* Strict Standards: Undefined offset:  0 in includes/SkinTemplate.php on line 196
* Strict Standards: Undefined index:  USE INDEX in includes/Database.php on line 1015
* Strict Standards: Undefined index:  image_tests in includes/Parser.php on line 3488
* Strict Standards: Undefined offset:  0 in includes/Parser.php on line 3507
* Strict Standards: Non-static method ChangesList::newFromUser() should not be called statically in includes/SpecialWatchlist.php on line 361
* Strict Standards: Non-static method RecentChange::newFromCurRow() should not be called statically in includes/SpecialWatchlist.php on line 367
* Strict Standards: is_a(): Deprecated. Please use the instanceof operator in includes/Exception.php on line 168
* Strict Standards: Non-static method LogPage::logName() should not be called statically in includes/SpecialContributions.php on line 325
* Strict Standards: ob_end_flush(): failed to delete and flush buffer. No buffer to delete or flush. in maintenance/commandLine.inc on line 191
* Strict Standards: Undefined index:  meatball in languages/Language.php on line 234
* Strict Standards: rmdir(/tmp/mwParser-2108164586-images/thumb): Directory not empty in maintenance/parserTests.inc on line 605
* Cleaning out some new temp files left over by parserTests (there were one or two straggler dirs/files that would persist after the test run ended, due to new tests being added over time)
* Strict Standards: Non-static method CoreParserFunctions::special() cannot be called statically in includes/Parser.php on line 2902
* Strict Standards: Declaration of ListUsersPage::preprocessResults() should be compatible with that of QueryPage::preprocessResults() in includes/SpecialListusers.php on line 38
* Strict Standards: Only variables should be passed by reference in includes/SpecialBlockip.php on line 175
* Strict Standards: Skin::include_once(skins/Standard.deps.php) [<a href='function.include-once'>function.include-once</a>]: failed to open stream: No such file or directory in includes/Skin.php on line 121
* Strict Standards: Declaration of ApiMain::getResult() should be compatible with that of ApiBase::getResult() in includes/api/ApiMain.php on line 35
* Strict Standards: is_a(): Deprecated. Please use the instanceof operator in includes/WikiError.php on line 63
* Strict Standards: Non-static method WikiError::isError() should not be called statically in includes/SpecialImport.php on line 64
* Strict Standards: Non-static method ImportStreamSource::newFromInterwiki() should not be called statically in includes/SpecialImport.php on line 58<b
* Strict Standards: Only variables should be assigned by reference in includes/SpecialUndelete.php on line 501
* Strict Standards: Non-static method Image::newFromName() should not be called statically in thumb.php on line 56
* Strict Standards: Non-static method CoreParserFunctions::numberoffiles() cannot be called statically in includes/Parser.php on line 2902
* Strict Standards: Non-static method CoreParserFunctions::statisticsFunction() should not be called statically in includes/CoreParserFunctions.php on line 139
* Strict Standards: Non-static method CoreParserFunctions::isRaw() should not be called statically in includes/CoreParserFunctions.php on line 128
* Strict Standards: Non-static method CoreParserFunctions::grammar() cannot be called statically in includes/Parser.php on line 2902
* Strict Standards: Undefined offset:  1 in includes/SpecialMIMEsearch.php on line 130
* Strict Standards: Undefined index:  recentchangeslinked in skins/MonoBook.php on line 184
* Strict Standards: Declaration of DumpNotalkFilter::pass() should be compatible with that of DumpFilter::pass() in includes/Export.php on line 612
* Strict Standards: Declaration of DumpNamespaceFilter::pass() should be compatible with that of DumpFilter::pass() in includes/Export.php on line 665
* Strict Standards: Non-static method ImportStreamSource::newFromUpload() should not be called statically in includes/SpecialImport.php on line 46
* Strict Standards: Undefined offset:  5 in includes/Sanitizer.php on line 396
* Strict Standards: Undefined index:  wikidbUserName in includes/SpecialUserlogin.php on line 562
* Strict Standards: Only variables should be assigned by reference in includes/api/ApiQueryBase.php on line 95
* Strict Standards: Only variables should be assigned by reference in includes/api/ApiQueryBase.php on line 116
* Strict Standards: Only variables should be assigned by reference in includes/api/ApiQueryWatchlist.php on line 128
* Strict Standards: Undefined property:  stdClass::$rc_id in includes/api/ApiQueryBase.php on line 131
* Strict Standards: Undefined property:  stdClass::$rc_last_oldid in includes/api/ApiQueryBase.php on line 164
* Strict Standards: Undefined property:  stdClass::$rc_moved_to_ns in includes/api/ApiQueryBase.php on line 285
* Strict Standards: Undefined property:  stdClass::$rc_patrolled in includes/api/ApiQueryBase.php on line 176
* Strict Standards: Undefined index:  comment in includes/api/ApiFeedWatchlist.php on line 85
* Strict Standards: Undefined offset:  0 in includes/Skin.php on line 302
* Strict Standards: Non-static method User::SetupSession() should not be called statically in includes/SpecialUserlogin.php on line 15

... There are certain to be other things too, so this is not intended to be comprehensive, rather the above just stops most of the notifications I observed.
2006-11-29 05:45:03 +00:00
Nick Jenkins
a474761d9a Changing lines like this: "extract( $dbw->tableNames( 'page', 'archive' ) );" to be like this: "list ($page, $archive) = $dbw->tableNamesN( 'page', 'archive' );".
Three reasons for this:
1) It's better for analysis tools [which want explicit variable declaration]
2) It's easier for a human to read, as it's completely explicit where the variables came from [which is something you don't get with extract() ]
3) It makes it easier to find everywhere where a variable is used with search/grep [which you can't currently do with $tbl_page variables from things like: "extract($db->tableNames( 'page', 'revision'), EXTR_PREFIX_ALL, 'tbl');"].

Otherwise, from a functionality/efficiency perspective the two forms should be identical.

By doing this have been able run static analysis over the usages of these variables, thus eliminating 5 unneeded table names from calls, plus removing 3 unused calls entirely, and it just feels subjectively slightly nicer to me.
2006-11-27 08:36:57 +00:00
Aryeh Gregor
4620cb1ae9 Restore previous parser test with comment in response to brion on Wikitech-l. And note to self: URLENCODING URLS IS VERY VERY BAD. Even when you're tired. 2006-11-17 13:27:56 +00:00
Aryeh Gregor
ecd0b827a5 (bug 4178) MediaWiki:Common.js will now be included for all users if $wgUseSiteJs is enabled, in addition to (if applicable) MediaWiki:Monobook.js and user JS subpages.
No extra page loads, brion!
2006-11-17 02:05:34 +00:00
Brion Vibber
7ca126466e Revert 17507 and 17518; more weird screwing about with headers, messing up styles.
Can we maybe stop playing with this on trunk?
2006-11-12 15:20:21 +00:00
Aryeh Gregor
6dcead7dde Fix regression in usability per <http://mail.wikipedia.org/pipermail/wikitech-l/2006-October/039465.html>. Document structure tweaked so that <h#> tags once more contain only the header text and not the section edit links. 2006-11-09 07:06:58 +00:00
Tim Starling
36ed0cd96c Reverting 17479/17480, breaks subclassing of Linker methods by skins. See my comment on bug 7405. 2006-11-08 07:12:03 +00:00
Nick Jenkins
fa239349f2 * (bug 7405) Make Linker methods static. Patch by Dan Li. 2006-11-08 05:21:15 +00:00
Aryeh Gregor
2ce87d20da (bugs 461, 7547) Allow "Categories:" link at bottom of pages to be customized via pagecategorieslink message. Note that this also removes an unused parameter, Special:Categories?article=thisarticle. If that's supposed to do something, someone should revert this and make it do something. 2006-11-03 05:50:55 +00:00