* Seeking help from a person?
** https://www.mediawiki.org/wiki/Communication
* Looking to file a bug report or a feature request?
-** https://bugs.mediawiki.org/
+** https://phabricator.wikimedia.org/
* Interested in helping out?
** https://www.mediawiki.org/wiki/How_to_contribute
$cache->makeGlobalKey( __CLASS__, 'server-read-only', $masterServer ),
self::TTL_CACHE_READONLY,
function () use ( $wiki, $conn ) {
+ $this->trxProfiler->setSilenced( true );
try {
$dbw = $conn ?: $this->getConnection( DB_MASTER, [], $wiki );
- return (int)$dbw->serverIsReadOnly();
+ $readOnly = (int)$dbw->serverIsReadOnly();
} catch ( DBError $e ) {
- return 0;
+ $readOnly = 0;
}
+ $this->trxProfiler->setSilenced( false );
+ return $readOnly;
},
[ 'pcTTL' => $cache::TTL_PROC_LONG, 'busyValue' => 0 ]
);
ContentHandler::runLegacyHooks( 'ArticleSaveComplete', $params );
Hooks::run( 'PageContentSaveComplete', $params );
}
- )
+ ),
+ DeferredUpdates::PRESEND
);
return $status;
Hooks::run( 'PageContentSaveComplete', $params );
}
- )
+ ),
+ DeferredUpdates::PRESEND
);
return $status;
protected $dbLockThreshold = 3.0;
/** @var float Seconds */
protected $eventThreshold = .25;
+ /** @var bool */
+ protected $silenced = false;
/** @var array transaction ID => (write start time, list of DBs involved) */
protected $dbTrxHoldingLocks = [];
$this->logger = $logger;
}
+ /**
+ * @param bool $value
+ * @since 1.28
+ */
+ public function setSilenced( $value ) {
+ $this->silenced = $value;
+ }
+
/**
* Set performance expectations
*
* @param string|float|int $actual [optional]
*/
protected function reportExpectationViolated( $expect, $query, $actual = null ) {
+ if ( $this->silenced ) {
+ return;
+ }
+
$n = $this->expect[$expect];
$by = $this->expectBy[$expect];
$actual = ( $actual !== null ) ? " (actual: $actual)" : "";
}
}
+ $illegalFileChars = $conf->get( 'IllegalFileChars' );
+
// Build list of variables
$vars = [
'wgLoadScript' => wfScript( 'load' ),
'wgResourceLoaderMaxQueryLength' => $conf->get( 'ResourceLoaderMaxQueryLength' ),
'wgCaseSensitiveNamespaces' => $caseSensitiveNamespaces,
'wgLegalTitleChars' => Title::convertByteClassToUnicodeClass( Title::legalChars() ),
+ 'wgIllegalFileChars' => Title::convertByteClassToUnicodeClass( $illegalFileChars ),
'wgResourceLoaderStorageVersion' => $conf->get( 'ResourceLoaderStorageVersion' ),
'wgResourceLoaderStorageEnabled' => $conf->get( 'ResourceLoaderStorageEnabled' ),
'wgResourceLoaderLegacyModules' => self::getLegacyModules(),
// If statement for paranoia
if ( $file ) {
$thumb = $file->transform( [ 'width' => 180, 'height' => 360 ] );
-
- return $thumb->toHtml( [ 'desc-link' => true ] );
+ if ( $thumb ) {
+ return $thumb->toHtml( [ 'desc-link' => true ] );
+ } else {
+ return wfMessage( 'thumbnail_error', '' )->escaped();
+ }
} else {
return htmlspecialchars( $value );
}
},
// slash, colon (not supported by file systems like NTFS/Windows, Mac OS 9 [:], ext4 [/])
{
- pattern: /[:\/#]/g,
+ pattern: new RegExp( '[' + mw.config.get( 'wgIllegalFileChars', '' ) + ']', 'g' ),
replace: '-',
fileRule: true
},
width: 39%;
}
+/* Flatlist styling for PHP widgets... */
+.mw-htmlform-flatlist .oo-ui-fieldLayout-align-inline,
+/* ...and for JS widgets */
.mw-htmlform-flatlist .oo-ui-optionWidget,
.mw-htmlform-flatlist .oo-ui-multioptionWidget {
display: inline-block;