scrivo / highlight.php

A port of highlight.js by Ivan Sagalaev to PHP
BSD 3-Clause "New" or "Revised" License
695 stars 45 forks source link

Add overrun protection in JsonRef #34

Closed assertchris closed 5 years ago

assertchris commented 5 years ago

This PR adds overrun protection to JsonRef; to exit from the infinite loop introduced in the javascript syntax definition (observed in https://github.com/scrivo/highlight.php/issues/33). This does not address the cause of that issue.

I had to update PHPUnit and modernise a tiny bit of code to be able to run this in PHP 7.3.

The dsconfig change addresses a change in PCRE that renders [\\w-?] invalid. The change replaces this with [-?\\w].

allejo commented 5 years ago

I'm going to put this PR on hold for a bit while we figure out what exactly is the cause of this infinite loop since only PHP 7.3 seems to be affected.

For anyone else reading this, PHP 7.2 and below does not seem to be affected by this bug. If you're running 7.3+ and are affected by this bug, you may have Composer use assertchris' repo instead of the official packagist repo in the meantime, while the bug is investigated.