Swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.
Also added some missing @param.
Change-Id: I8804ebe0922d3a414863b162a2110e0b9e49b80f
Also swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.
Change-Id: Ic36c8c7820a6c2d603f1138130670c6bf6a1ca59
In the event of a bad filename warning record the relavent variables
so that we can figure out what is causing the failure.
See also change I532f8ee7c7455e43862b0204a7fff23d6792412e
Bug: 62241
Change-Id: If5d8b9e7f34c0f9bd09684d7dada8fafd7f5f7c2
- Added spaces after if/foreach/catch
- Added new line before end of file
- Added or removed spaces before/after parenthesis, comma
- Added spaces around string concat
Change-Id: I0590070f1b3542108e242730e8d9a3ba9831e94f
When we are doing blacklisted extensions, we count all extensions
as some programs (like apache sometimes) consider extensions that
aren't the final extension. However when doing whitelists we need
to only count the last extension, otherwise people can name files
foo.goodExt.BadExt. For example [[commons:File:Deamado ko.png.bmp]]
I do not believe this represents a security risk as bad files are
still filtered out. However it does allow unwanted files to be
uploaded.
Bug: 62451
Change-Id: Ie27c15f749812710571f432bc5915e498f8017e3
Disallow uploading non-whitelisted namespaces. Also disallow iframe
elements.
User will get an error including the namespace name if they use a non-
whitelisted namespace.
Bug: 60771
Change-Id: Id5c022543184b19b77ad32d9a8a0c2dbbc5e9038
Return an error from UploadBase::detectScriptInSvg when the svg has
XML that cannot be parsed. Usually the XML is invalid, or the parser has
run out of memory trying to parse the file.
This patch is rebased on top of bug 57550.
Bug: 58553
Change-Id: I32661a27d7417cc2c69b844c805b190d6486d17a
When an file is being uploaded, we tell the user if it has been
uploaded and deleted in the past. But we shouldn't reveal the title
under which that was done if the file was suppressed via RevDel.
Note this introduces a breaking API change: clients may now receive a
"deleted-archive" warning with an empty value if the title was
suppressed.
Bug: 59167
Change-Id: I01a3ac2ba0cbac6b28de26a7f1a1d09b6b02097e
Split the variable assignment and the return statement in two lines for
better readability.
When there was two return statements in one method the logic was swapped
to have only one return statement.
Change-Id: Id7a01b4a2df96036435f9e1a9be5678dd124b0af
Make it a little harder for the developer to leak files in the temp
directory by managing the temporary file with a TempFSFile instance.
Change-Id: I8bafc3a6e6212781d9e2e4f8f370ce7c446f1fd5
The Line continuation Coding conventions prefers the closing parenthesis
on the same line than the beginning curly braces. This is done for ifs
and functions.
Also move some boolean operator from the end of a line to the beginning
and changed some indentation to make the condition hopefully better
readable.
Change-Id: Id0437b06bde86eb5a75bc59eefa19e7edb624426
- Removed double spaces
- Added space after if/switch/foreach
- Removed space on elseif
- Added space around parentheses
- Added newline at end of file
- Removed space before semicolon at end of line
Change-Id: Id40b87e04786c6111e6686d7f7eea1e588bdf37d
The former is only really used to refer to the older hphp compiler.
Now all docs pretty much exclusively are referring to HHVM and
that's the project's name going forward.
While we're here, swap HPHP_VERSION for HHVM_VERSION. Either work,
but the latter is more correct.
Only affected extension (in Git or SVN) is GWToolset, fixing in
I3a490ef.
Change-Id: I81e4ce5d14e344e67045050261f91b3c0159f222
UploadStash::getFile has a "noAuth" parameter, which should be set true
when this is called from UploadStash::removeFileNoAuth.
Callers should already be doing their own auth checking, or calling
UploadStash::removeFile.
Bug: 56298
Change-Id: Ic70c4e2bc6df5cb9b139a3631766f8ff0ec4ef02
This adds an option to wfShellExec (and convenience function
wfShellExecWithStderr), to make sure all stderr is duplicated
to stdout. The previous method of doing this was to include
2>&1 on the command line. However this did not redirect errors
from limit.sh (For example cgroups not set up, or if a command
reached the file size limit set by ulimit).
Not sure if this is the best approach, but it seems to work well,
and compared to most other approaches I considered, actually gets
the ulimit errors redirected too.
Currently some files fail to render with no error whatsoever,
hopefully this patch will make what went wrong more obvious.
Also fix a comment in wfShellExec that was incorrect (trailing \n),
and make the initial value of the return value variable be 200, so
if there's ever a bug in php where its not being set properly, it
would be immediately obvious what is happening.
Bug: 53824
Change-Id: I833aeb3ab9da726ecb97331369ea187daad7e795
If a file type was added to $wgFileExtensions by both local configuration
and defaults in an extension (eg TimedMediaHandler and LocalSettings.php
both adding 'ogg' and 'ogv') it was being listed twice in the UI messages
listing acceptable types.
Runs array_unique() over the array on various outputs.
Bug: 54378
Change-Id: I14cd098d8b27099f8f803630535f33549740295c
Previously if a file had a format, where we didn't have an
extension associated with it in mime.types, people could upload
it with any extension that is in $wgFileExtensions. This meant
people could upload a non-allowed file type if it had an allowed
extension, and the non-allowed file type didn't have a canonical
extension in mime.types
Bug: 39012
Change-Id: Ib373fafdfceceed65fbd23cf468f3c19196545c9
Add $wgCopyUploadTimeout and $wgCopyUploadAsyncTimeout to control
the timeout for the http request used to fetch the file during upload
by url. People reasonably may want to make this higher than $wgHTTPTimeout
for the case where very large files are being downloaded.
Also add the ability for callers of UploadFromUrl::fetchFile
to override the timeout as they please (and set any other HTTP opts).
This patch was inspired by conversation with dan-nl about gwtoolset.
Change-Id: Ia85a97434c14adcdaafc0802cbe0530bfa57a435
These are needed for OAuth grants.
Note that, even if 'editmywatchlist' is not granted, various actions
will still allow for adding but not removing of pages.
Change-Id: Ie33446a228dd6ed0114730935c1bf65667f5ce01
Some browsers will interpret obscure xml encodings as UTF-8, while
PHP/expat will interpret the given encoding in the xml declaration.
bug: 47304
Change-Id: I3b311a7078d977ae89c51e95e625d79fba183cfc
And added/removed spaces around some other tokens,
like +, -, *, /, <, >, =, !
Fixed windows newline style
Change-Id: I0b9c8c408f3f6bfc0d685a074d7ec468fb848fc8
ERROR: Closing brace must be on a line by itself
Squiz.WhiteSpace.ScopeClosingBrace.ContentBefore
- For non-empty scopes it means the closing brace must be on a separate
line. This is already the case in most classes in some cases the "lazy
closing" is still used.
array(
'x' ); // Moved } to next line
function () { return 'x'; } // Moved } to next line
case 1:
stuff; break; // Moved break to next line
- For empty function it serves as a visual distinction between there not
being a scope block / function body and there being an empty function
body.
function foo(); // No body
function foo() {} // Empty body - violation
function bar() { // Empty body corrected
}
Change-Id: I0310ec379c6d41cc7d483671994d027a49f32164
*Any class that is not part of the UploadBase class
(so it can't call protected functions or members on an UploadBase object).
If you, for example,build an extension that uses an UploadBase instance,
there is no way to get the title validation error.
Bug: 38221
Change-Id: Ie6c3f95a09ef84777313c3ec2edd31c50c397e28
* Removed spaces around array index
* Removed double spaces or added spaces to begin or end of function
calls, method signature, conditions or foreachs
* Added braces to one-line ifs
* Changed multi line conditions to one line conditions
* Realigned some arrays
Change-Id: Ia04d2a99d663b07101013c2d53b3b2e872fd9cc3
Strict Standards: Declaration of UploadFromChunks::stashFile() should be
compatible with UploadBase::stashFile(User $user = NULL)
Change-Id: If14d7aeacb23df16bff94c5989cde4ee31c1d105