Manual:$wgSVGNativeRendering
| SVG: $wgSVGNativeRendering | |
|---|---|
| Whether native rendering by the browser agent is allowed. |
|
| Introduced in version: | 1.41.0 (Gerrit change 921379; git #85dd5826) |
| Removed in version: | Still in use |
| Allowed values: | (string) or (boolean) |
| Default value: | true (1.46+)false (1.41-1.45) |
| Other settings: Alphabetical | By function | |
Details
Whether native rendering by the browser agent is allowed.
$wgSVGNativeRendering now defaults to true.
This means that uploaded SVGs are rendered directly by the browser most of the time.
MediaWiki applies several filters on uploaded SVGs to protect against malicious SVGs.
The browser adds restrictions on the SVG when included as an <img> for additional protection.
We do advise configuring CSP headers to protect users in case they open a SVG file directly in the browser.
Setting it to true disables all SVG conversion, always serving native SVGs to browsers, unless the SVG file is equal to or over the size limit. In that case, the SVG will still be converted (rasterized) to PNG server-side.
Setting to the string 'partial' will only allow native rendering when the file size is below $wgSVGNativeRenderingSizeLimit and if the file contains at most 1 language.