Jump to content

Руководство:$wgSVGNativeRendering

From mediawiki.org
This page is a translated version of the page Manual:$wgSVGNativeRendering and the translation is 38% complete.
Outdated translations are marked like this.
SVG: $wgSVGNativeRendering
Whether native rendering by the browser agent is allowed.
Введено в версии:1.41.0 (Gerrit change 921379; git #85dd5826)
Удалено в версии:всё ещё используется
Допустимые значения:(строка) или $1
Значение по умолчанию:true (1.46+)
false (1.41-1.45)

Подробности

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.

См. также