Commit graph

716 commits

Author SHA1 Message Date
Jeroen De Dauw
bf13f7ff9a Added some docs 2010-08-10 06:17:49 +00:00
Aryeh Gregor
b8ab1e25ca "$something ? false : true" is silly.
Note: not actually tested, but it's really hard to see how it will
fail . . . really!
2010-08-04 21:47:09 +00:00
Platonides
54059c04d8 Typo 2010-08-03 22:03:56 +00:00
Niklas Laxström
3481db60c3 Follow up to r69185: add documentation for wfUILang() 2010-08-03 20:39:35 +00:00
Alexandre Emsenhuber
a8921f6579 * Removed trailing whitespaces
* Moved the description comment to the very top and added "@file"
2010-08-01 12:31:50 +00:00
Platonides
8bb2b3e3bf It's very nice having a fallback iconv() function, but we should take into account that Language.php calls it with the //IGNORE making the fallback a nop.
This fixes the two phpunit tests of Revision of Legacy encoding when native iconv is not available in php.

Allow js_unescape to take advantage of our wrapper, too. (although that function seems completely unused...)
2010-07-28 13:51:42 +00:00
Sam Reed
04f68827d0 Removal of unused globals
Removal of one setting of a variable to '', then not using further
2010-07-24 19:11:52 +00:00
Platonides
8c5c696d63 Follow up r63214, and its revert r69201. The rules were more complex than a
simple "escape all carets", see 63214 CR.
Should help Bug 13518 - <math> does not work (wrong shell escaping under Windows)
2010-07-22 16:04:58 +00:00
Platonides
b450b32cc7 Follow up r69508. Mention both functions. 2010-07-18 21:40:49 +00:00
Platonides
d6c6cfd95f Fix comment. There's no tempfile function in php. 2010-07-18 13:52:30 +00:00
Brian Wolff
ab00553090 Let wfTimestamp recognize negative unix timestamp values 2010-07-17 23:29:20 +00:00
Tim Starling
7adda3bf70 Revert r63213, r63214 per CR comment on r63214, doesn't match documented cmd.exe behaviour 2010-07-09 06:54:14 +00:00
Niklas Laxström
55493f65e8 Introduce $wgBetterDirectionality that lets us work on support for rtl ui in ltr wiki and vice versa. 2010-07-08 13:34:03 +00:00
Niklas Laxström
a22f0c6f2f Simplify wfMsgGetKey 2010-07-08 09:08:03 +00:00
Niklas Laxström
facf4dad52 Avoid unstubbing in wfGetLangObj, code style 2010-07-08 08:23:35 +00:00
Chad Horohoe
18d45df092 Remove a few functions that have been labelled deprecated forever and have no callers anywhere 2010-07-06 20:56:37 +00:00
Chad Horohoe
e4429f1bb4 Throw a wfDeprecated() on this since the last usage is gone in r68836 2010-07-01 15:31:54 +00:00
Chad Horohoe
9d23eb156f Skip PHP warnings for mkdir() call. We throw our own and having essentially duplicate warnings is annoying 2010-06-20 15:41:38 +00:00
Tim Starling
1b3f9bf321 In wfGetAllCallers(): Added a limit to the stack depth, omit wfGetAllCallers itself from the list, added articles to the documentation. 2010-06-16 00:26:20 +00:00
Chad Horohoe
94a69f24fc Cleanup most of the DIY extension detection/dl() code into nice clean wfDl() 2010-06-14 18:09:19 +00:00
Ryan Kaldari
9e1b3906ce putting local sitenotices in their own div and fixing sitenotice styling issues with Vector 2010-06-10 08:01:13 +00:00
Chad Horohoe
44229b50e6 Fixed a bunch of silly instances of [^!=]==\s*(true|false) 2010-06-09 11:44:05 +00:00
Aryeh Gregor
74a21f3bd1 Remove most named character references from output
Recommit of r66254 to trunk.  This was just

find extensions phase3 -iname '*.php' \! -iname '*.i18n.php' \! -iname 'Messages*.php' \! -iname '*_Messages.php' -exec sed -i 's/&nbsp;/\&#160;/g;s/&mdash;/―/g;s/&bull;/•/g;s/&aacute;/á/g;s/&acute;/´/g;s/&agrave;/à/g;s/&alpha;/α/g;s/&auml;/ä/g;s/&ccedil;/ç/g;s/&copy;/©/g;s/&darr;/↓/g;s/&deg;/°/g;s/&eacute;/é/g;s/&ecirc;/ê/g;s/&euml;/ë/g;s/&egrave;/è/g;s/&euro;/€/g;s/&harr;//g;s/&hellip;/…/g;s/&iacute;/í/g;s/&igrave;/ì/g;s/&larr;/←/g;s/&ldquo;/“/g;s/&middot;/·/g;s/&minus;/−/g;s/&ndash;/–/g;s/&oacute;/ó/g;s/&ocirc;/ô/g;s/&oelig;/œ/g;s/&ograve;/ò/g;s/&otilde;/õ/g;s/&ouml;/ö/g;s/&pound;/£/g;s/&prime;/′/g;s/&Prime;/″/g;s/&raquo;/»/g;s/&rarr;/→/g;s/&rdquo;/”/g;s/&Sigma;/Σ/g;s/&times;/×/g;s/&uacute;/ú/g;s/&uarr;/↑/g;s/&uuml;/ü/g;s/&yen;/¥/g' {} +

followed by reading over every single line of the resulting diff and
fixing a whole bunch of false positives.  The reason for this change is
given in <http://lists.wikimedia.org/pipermail/wikitech-l/2010-April/047617.html>.
I cleared it with Tim and Brion on IRC before committing.  It might
cause a few problems, but I tried to be careful; please report any
issues.

I skipped all messages files.  I plan to make a follow-up commit that
alters wfMsgExt() with 'escapenoentities' to sanitize all the entities.
That way, the only messages that will be problems will be ones that
output raw HTML, and we want to get rid of those anyway.

This should get rid of all named entities everywhere except messages.  I
skipped a few things like &nbsp that I noticed in manual inspection,
because they weren't well-formed XML anyway.

Also, to everyone who uses non-breaking spaces when they could use a
normal space, or nothing at all, or CSS padding: I still hate you.  Die.
2010-05-30 17:33:59 +00:00
Chad Horohoe
a4393915e2 Merge new-installer branch to trunk
* This is not complete yet, and should not be used outside of testing. Using it on a production database may ruin everything. This is the reason for the second entry point of new-index.php. You've been warned. 
* Known issues are at [[mw:New-installer_issues]]. Please add new items to the list if you find them.
2010-05-07 12:25:01 +00:00
Chad Horohoe
af6f14aac5 Kill 5.0.x compat functions, we require 5.1+ anyway 2010-04-29 19:06:11 +00:00
Siebrand Mazeland
e77b3f7161 Tweak comment 2010-04-23 20:35:25 +00:00
Siebrand Mazeland
3a514a4bdf Document parameters in the correct order 2010-04-23 20:31:23 +00:00
Happy-melon
9ebb2dec9c Get message in wfEmptyMsg using the user's interface language; closer to the previous behaviour and might fix the issue reported in r64178 CR 2010-03-26 11:21:14 +00:00
Happy-melon
ae3ced88e5 Make MessageCache::get() return false if the requested message does not exist, and handle setting the '<$key>' one layer further down in wfMsgGetKey(). Allows us to get away from that horrible string comparison in wfEmptyMsg(). 2010-03-25 20:21:31 +00:00
Chad Horohoe
2b4ff9dfaa bug 18664, bug 19270: Relative URIs in interwiki table break things (in general: fix wfExpandUrl() so it handles protocol-relative URIs) 2010-03-17 00:21:52 +00:00
Happy-melon
3d24e02934 Add FIXME to wfMergeErrorArrays(), throws E_NOTICEs. 2010-03-13 15:35:09 +00:00
Chad Horohoe
0434529434 Remove wfGetHTTP(), has been deprecated for ages and has no callers. Also stop loading XmlFunctions by default. 2010-03-06 22:42:20 +00:00
Platonides
d313859b02 (Bug 22709) IIS 7 mishandles redirects generated by OutputPage::output() when
the URL contains a colon.
Avoid tinifying colons for IIS 7.

It's a pity how it pollutes a clean function like wfUrlencode.
2010-03-03 22:01:09 +00:00
Platonides
634b81f8d0 Follow-up r63213. Move it to wfEscapeShellArg, which is the proper place. 2010-03-03 18:22:26 +00:00
Alexandre Emsenhuber
e97c055e74 Fix for r63000: remove the "!" in the check 2010-02-26 09:04:14 +00:00
Alexandre Emsenhuber
b8b254da7f Fixes to r62995:
* Avoid fatal error if $wgProfiler is either not a object (ProfilerStub.php) or an instance of Profiler
* Set $wgProfiler to null in ProfilerStub.php so that $wgProfiler doesn't need to be checked with "isset" first, updated check in GlobalFunctions.php accordingly
2010-02-26 08:53:06 +00:00
Niklas Laxström
e1065a1d57 Little docs to help developers keep track of versions... 2010-02-24 16:06:55 +00:00
Chad Horohoe
c5267bf20e Drop ancient PHP4 wrapper for cloning, completely unused 2010-02-13 02:29:59 +00:00
Chad Horohoe
4f772a5b33 Followup r61655, add sys_get_temp_dir() support to wfTempDir(), use this in HttpTest rather than duplicating code 2010-01-29 23:52:06 +00:00
Niklas Laxström
b1e2b87b95 New configuration variables $wgDebugTimestamps and $wgDebugPrintHttpHeaders for controlling debug output.
I find these useful, maybe someone else will too.
2010-01-27 17:21:18 +00:00
Chad Horohoe
b8fd924711 Fixme on r57980: Memcached would be bad here, rename variable with wg prefix. Fixes to UsabilityInitiative will follow 2010-01-25 13:57:51 +00:00
Sam Reed
d71b682cc6 Refactor array_intersect_key from ApiResult.php to GlobalFunctions.php 2010-01-23 22:31:37 +00:00
Chad Horohoe
07c5db7f40 Clarify parameters to wfFindFile and wfLocalFile, and return caveat to the "This always returns files" comment 2010-01-22 19:48:10 +00:00
Platonides
da21210211 (bug 22034) use wfClientAcceptsGzip() in wfGzipHandler instead of reimplementing it.
$wgUseGzip check on wfClientAcceptsGzip() is removed since HTMLFileCache (the only wfClientAcceptsGzip() user) already checked that before calling it. This way, $wgUseGzip stays applying only for file cache, and $wgDisableOutputCompression for  output handler.
2010-01-14 16:35:35 +00:00
Tim Starling
a8956ea2fd Reverted r59548 (reopens bug 21086).
wfWikiID() is used as a way to identify and connect to a given database in LoadBalancer and various extensions, that's why it must contain the database name and table prefix. Perhaps its use as a public identifier should be optional, but in that case the public identifier needs to be customised, not the return value of wfWikiID().
2010-01-12 05:20:31 +00:00
Siebrand Mazeland
7c27e42fb8 Revert 60864: "Use wfClientAcceptsGzip() in wfGzipHandler." Causes PHP Notice: Undefined index: HTTP_ACCEPT_ENCODING in GlobalFunctions.php on line 1175 2010-01-09 19:14:43 +00:00
Siebrand Mazeland
29e47fa366 (bug 22034) Use wfClientAcceptsGzip() in wfGzipHandler. Patch by Platonides.
wfGzipHandler should use wfClientAcceptsGzip() instead of reimplementing it. Patch does this and removes the $wgUseGzip check on wfClientAcceptsGzip() since HTMLFileCache (the only wfClientAcceptsGzip() user) already checked that before calling it. This way $wgUseGzip stays applying only for file cache, and $wgDisableOutputCompression for output handler.
2010-01-09 18:10:11 +00:00
Sam Reed
5caeb07339 Minor followup to r60744, fix for comment 2 2010-01-06 21:27:25 +00:00
Sam Reed
b6e0df246f Attempt at normalistion of comparison styles - empty string on left and right hand side normalised to it being on the rhs
Before this change, there were (? being regex 0 or 1)

"" ===? 1
'' ===? 24
"" !==? 8
'' !==? 32

== "" 14
== '' 344
!= "" 9
!== "" 4
!= '' 151
!== '' 85


Rhs was the much more common, and the preferred style by many developers.. (Was a similar discussion in #mediawiki recently.. After that lolbugreport i think)

Where there is a string (non empty) on the lhs, and variable/method call on the rhs still need normalising
2010-01-06 19:59:42 +00:00
Roan Kattouw
af3fd687db Add $maxlag parameter to LoadBalancer::getMaxLag() so it'll actually select the right DB when opening new connections. Looks like an ugly temp fix to me but I have no idea how to do it properly offhand. 2010-01-05 23:39:16 +00:00