If enabled, apply the default restrictions and take away network access
from pygments.
Bug: T182468
Change-Id: I4e5a6e01a24229a3923642af8de880dbf9167562
We originally started using symfony/process because kzykhys/pygments
depended upon it. But that library was unmaintained and became broken,
so we stopped using it, and just used symfony/process directly.
At the time, the main reason in favor of symfony/process was that it
could pass stdin to pygments, while Shell\Command couldn't - but it can
now (T182463)! On top of that, there are downsides, like not respecting
the default MediaWiki shell limits, being incompatible with core's
firejail support, and requiring an external composer dependency.
Note that because Shell::command() will enforce MediaWiki's normal
limits, it's possible that some large pages may no longer render with
syntax highlighting if they pass those limits.
Bug: T182467
Bug: T181771
Change-Id: Ie1cb72b7eb17d943f79ecae4d94a2110546ef039
Python 2 is dying, <https://pythonclock.org/>, it's time to move on.
The create_pygmentize_bundle script now requires Python 3 to run, and will
generate a bundle with a python3 shebang. Technically the bundle is still
compatible with Python 2 as long as the shebang is modified.
Bug: T182851
Change-Id: Ifb9d0abf092e2c08d9a638a7dda3bda0bc808789
Add phan configuration for static analysis, and fix phan warnings.
`PhanDeprecatedClass` and `PhanDeprecatedFunction` rules are supressed.
Bug: T179554
Change-Id: I7cbb410ed88ba58198d0557cafd9e6df968ed885
The CSS already has this modifier prefixed with -webkit-, -ms- and
-moz-, some browsers now support this without any prefix (according to
caniuse.com: Chrome 54+, Opera 41+).
Change-Id: Icd67250c26bec61be0fb101f1db077ee13ccf6b7
The following sniffs are failing and were disabled:
* MediaWiki.Files.ClassMatchesFilename.NotMatch
* MediaWiki.Files.ClassMatchesFilename.WrongCase
Change-Id: I2781f52be104163ba58e30055bc7593da6ded29a
The following sniffs are failing and were disabled:
* MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic
* MediaWiki.Commenting.FunctionComment.MissingParamComment
* MediaWiki.Commenting.FunctionComment.MissingParamName
* MediaWiki.Commenting.FunctionComment.MissingParamTag
* MediaWiki.Commenting.FunctionComment.MissingReturn
* MediaWiki.Commenting.FunctionComment.ParamNameNoMatch
The following sniffs now pass and were enabled:
* MediaWiki.Commenting.FunctionComment
Change-Id: I6f0b55e7694cdae1fcdd68b33449db412a656e37
Don't bother checking supported languages before generating the node contents.
We always want the preview, as that's what will display on the rendered page
even if the language is invalid.
Bug: T164120
Change-Id: I8344449bbf9c9cce131d745ea5f4e54b96fe57b1