Giter Site home page Giter Site logo

dedalozzo / pygmentize Goto Github PK

View Code? Open in Web Editor NEW
30.0 2.0 4.0 60 KB

Pygmentize is a wrapper to `pygmentize`, the command line interface provided by Pygments, a python syntax highlighter.

License: Apache License 2.0

PHP 100.00%
pygments php syntax-highlighter wrapper

pygmentize's People

Contributors

cebe avatar dedalozzo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

pygmentize's Issues

[Security] Remote Code Execution

$highlight = Pygmentize::highlight('<?php phpinfo();', ';uname -a #');
print_r($highlight);

This will produce the following output:

Darwin Micheals-MBP 16.1.0 Darwin Kernel Version 16.1.0: Thu Oct 13 21:26:57 PDT 2016; root:xnu-3789.21.3~60/RELEASE_X86_64 x86_64

The problem lines appear to be here: https://github.com/dedalozzo/pygmentize/blob/master/src/Pygmentize/Pygmentize.php#L48-L51

This particular issue can be resolved with escapeshellcmd:

$proc = proc_open(self::PIGMENTS_BINARY.escapeshellcmd($args), $dspec, $pipes);

Package not getting installed

I am trying to install this package.
I am getting these errors.

ERROR: Could not find a version that satisfies the requirement pygmentize==2.0 (from versions: none)
ERROR: No matching distribution found for pygmentize

I've looked this issue, but the problem there was absence of pygments.

If I issue the suggested command, I'm getting this result -

Requirement already satisfied: pygments in ./.local/lib/python3.6/site-packages (2.4.2)

I've also PHP installed. (version 7.2.19)

Having these dependencies installed also is not resulting in the successful installation.

Installation instructions for Windows

The installation instructions for pygmentize are written for Linux users but there is no information about how to install Composer or pygmentize on Windows, for example. This is a problem because pygmentize is required for the minted package in LaTeX, which is otherwise easily available on Windows except for its dependency on pygmentize.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.