// we may as well not call htmlspecialchars().
// @todo FIXME: Verify that we actually need to
// escape \n\r\t here, and explain why, exactly.
- #
// We could call Sanitizer::encodeAttribute() for this, but we
// don't because we're stubborn and like our marginal savings on
// byte size from not having to encode unnecessary quotes.
}
// Workaround for bug that caused spaces before references
- // to disappear during processing:
- // https://phabricator.wikimedia.org/T55086
- //
- // Please replace with a better fix if one can be found.
+ // to disappear during processing: https://phabricator.wikimedia.org/T55086
+ // TODO: Please replace with a better fix if one can be found.
$html = str_replace( ' <', ' <', $html );
libxml_use_internal_errors( true );
$html = $this->fixLibXml( $html );
if ( wfIsWindows() ) {
// Cleanup for CRLF misprocessing of unknown origin on Windows.
- //
// If this error continues in the future, please track it down in the
// XML code paths if possible and fix there.
$html = str_replace( ' ', '', $html );
# Create a thumbnail. Alignment depends on the writing direction of
# the page content language (right-aligned for LTR languages,
# left-aligned for RTL languages)
- #
# If a thumbnail width has not been provided, it is set
# to the default user option as specified in Language*.php
if ( $fp['align'] == '' ) {
// curid and oldid request parameters would allow page titles to be enumerated even
// when they are not guessable. So we reset the title to Special:Badtitle before the
// permissions error is displayed.
- //
+
// The skin mostly uses $this->context->getTitle() these days, but some extensions
// still use $wgTitle.
-
$badTitle = SpecialPage::getTitleFor( 'Badtitle' );
$this->context->setTitle( $badTitle );
$wgTitle = $badTitle;
// redirecting to HTTPS. It's likely such a request is going
// to fail due to post data being lost, but let's try anyway
// and just log the instance.
- //
+
// @todo FIXME: See if we could issue a 307 or 308 here, need
// to see how clients (automated & browser) behave when we do
wfDebugLog( 'RedirectedPosts', "Redirected from HTTP to HTTPS: $oldUrl" );
# Note that the pattern requirement will always be satisfied if the
# input is empty, so we need required in all cases.
- #
+
# @todo FIXME: Bug 23769: This needs to not claim the password is required
# if e-mail confirmation is being used. Since HTML5 input validation
# is b0rked anyway in some browsers, just return nothing. When it's
if ( !preg_match( '/^[a-zA-Z0-9_-]+$/', $extension ) ) {
// Non-alphanumeric extension, unlikely to be registered.
- //
// The regex above is known to match all registered file extensions
// in a default Windows XP installation. It's important to allow
// extensions with ampersands and percent signs, since that reduces
// We're not using the normalized form of the extension.
// Normal form is lowercase, using most common of alternate
// extensions (eg 'jpg' rather than 'JPEG').
- //
+
// Check for another file using the normalized form...
$nt_lc = Title::makeTitle( NS_FILE, "{$partname}.{$normalizedExtension}" );
$file_lc = wfLocalFile( $nt_lc );
// If no key was supplied, make one. a mysql insertid would be totally
// reasonable here, except that for historical reasons, the key is this
// random thing instead. At least it's not guessable.
- //
// Some things that when combined will make a suitably unique key.
// see: http://www.jwz.org/doc/mid.html
list( $usec, $sec ) = explode( ' ', microtime() );
case 'accusative': # Հայցական հոլով
# stub
break;
- case 'instrumental': #
+ case 'instrumental':
# stub
break;
- case 'prepositional': #
+ case 'prepositional':
# stub
break;
}
$datePreference = $this->dateFormat( $format );
# ISO (YYYY-mm-dd) format
- #
# we also output this format for YMD (eg: 2001 January 15)
if ( $datePreference == 'ISO 8601' ) {
$d = substr( $ts, 0, 4 ) . '-' . substr( $ts, 4, 2 ) . '-' . substr( $ts, 6, 2 );
}
# Walloon format
- #
# we output this in all other cases
$m = substr( $ts, 4, 2 );
$n = substr( $ts, 6, 2 );
$fileName = $this->getNewTempFile();
// Converting the temporary /file/ to a /directory/
- //
// The following is not atomic, but at least we now have a single place,
// where temporary directory creation is bundled and can be improved
unlink( $fileName );
array( '', 'gopher://*.test.com/', 'gopher://gopher.test.com/0/v2/vstat' ),
array( 'telnet://', '*.test.com', 'telnet://shell.test.com/~home/' ),
- //
// The following only work in PHP >= 5.3.7, due to a bug in parse_url which eats
// the path from the url (https://bugs.php.net/bug.php?id=54180)
- //
// array( '', 'http://test.com', 'http://test.com/index?arg=1' ),
// array( 'http://', '*.test.com', 'http://www.test.com/index?arg=1' ),
// array( '' ,
// 'http://xx23124:__ffdfdef__@www.test.com:12345/dir' ,
// 'http://name:pass@www.test.com:12345/dir/dir/file.xyz.php#__se__?arg1=_&arg2[]=4rtg'
// ),
- //
- //
// Tests for false positives
- //
array( 'http://', 'test.com', 'http://www.test.com', false ),
array( 'http://', 'www1.test.com', 'http://www.test.com', false ),
array( 'http://', '*.test.com', 'http://www.test.t.com', false ),
array( '', 'http://test.com:8080/dir/', 'http://test.com:808/dir/', false ),
array( '', 'http://test.com/dir/index.html', 'http://test.com/dir/index.php', false ),
- //
// These are false positives too and ideally shouldn't match, but that
// would require using regexes and RLIKE instead of LIKE
- //
// array( null, 'http://*.test.com', 'http://www.test.com:80', false ),
// array( '', 'https://*.wikimedia.org/r/#/q/status:open,n,z',
// 'https://gerrit.wikimedia.org/XXX/r/#/q/status:open,n,z', false ),
// expectOutput[...] functions. However, the PHPUnit shipped prediactes
// do not allow to check /each/ line of the output using /readable/ REs.
// So we ...
- //
+
// 1. ... add a dummy output checking to make PHPUnit not complain
// about unchecked test output
$this->expectOutputRegex( '//' );
// instead of the MaintenanceFixup hack below. However, we cannot do
// without changing the visibility and without working around hacks in
// Maintenance.php
-//
// For the same reason, we cannot just use FakeMaintenance.
/**
// The dump (hopefully) did take long enough to produce more than one
// checkpoint file.
- //
// We now check all the checkpoint files for validity.
$files = scandir( $nameOutputDir );