mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/SyntaxHighlight_GeSHi
synced 2024-11-23 22:13:40 +00:00
Use shell restrictions to contain pygments
If enabled, apply the default restrictions and take away network access from pygments. Bug: T182468 Change-Id: I4e5a6e01a24229a3923642af8de880dbf9167562
This commit is contained in:
parent
15b894bdbc
commit
dc4e684056
|
@ -294,6 +294,7 @@ class SyntaxHighlight {
|
|||
'-O', implode( ',', $optionPairs )
|
||||
)
|
||||
->input( $code )
|
||||
->restrict( Shell::RESTRICT_DEFAULT | Shell::NO_NETWORK )
|
||||
->execute();
|
||||
|
||||
if ( $result->getExitCode() != 0 ) {
|
||||
|
|
|
@ -44,7 +44,9 @@ class UpdateCSS extends Maintenance {
|
|||
'-f', 'html',
|
||||
'-S', 'default',
|
||||
'-a', '.' . SyntaxHighlight::HIGHLIGHT_CSS_CLASS
|
||||
)->execute();
|
||||
)
|
||||
->restrict( Shell::RESTRICT_DEFAULT | Shell::NO_NETWORK )
|
||||
->execute();
|
||||
|
||||
if ( $result->getExitCode() != 0 ) {
|
||||
throw new \RuntimeException( $result->getStderr() );
|
||||
|
|
|
@ -46,7 +46,9 @@ class UpdateLexerList extends Maintenance {
|
|||
$result = Shell::command(
|
||||
SyntaxHighlight::getPygmentizePath(),
|
||||
'-L', 'lexer'
|
||||
)->execute();
|
||||
)
|
||||
->restrict( Shell::RESTRICT_DEFAULT | Shell::NO_NETWORK )
|
||||
->execute();
|
||||
|
||||
if ( $result->getExitCode() != 0 ) {
|
||||
throw new \RuntimeException( $result->getStderr() );
|
||||
|
|
Loading…
Reference in a new issue