Whole file

terryyin/lizard

The author described this change as fix php code without closing ?>. It counts as a record because the check below fails on the code as it stood at 03fe2f28d and passes on f3ed0658d, with nothing else changed between the two runs.

Fix saved2016-06-08
Sharing licenceMIT · LICENSE.txt
Change size+3 1

What the code was meant to do, written into the code itself as a save note

fix php code without closing ?>

The change

2121 extra += r"|(?:\$\w+)"
2222 extra += r"|(?:\<{3}(?P<quote>\w+).*?(?P=quote))"
2323 current_pos = 0
24- code_block_pattern = re.compile(r"\<\?(?:php)?(.*?)\?\>", re.M | re.S)
24+ code_block_pattern = re.compile(
25+ r"\<\?(?:php)?(.*?)(?:(\?\>)|\Z)",
26+ re.M | re.S)
2527 for match in code_block_pattern.finditer(source_code):
2628 if source_code[current_pos:match.start()]:
2729 yield '"' + source_code[current_pos:match.start()] + '"'

The check that tells the two apart

failpass·test/test_languages/testPHP.py::Test_tokenizing_PHP::test_code_block_without_closing

Check file test/test_languages/testPHP.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.

Origin and history

The code before it03fe2f28d0872dc482d2e5242cce8fdd052f4039
Broken version dated2016-06-08
Modulelizard_languages.php
Units changedPHPReader
Fingerprint457faa52ab792a16
Checked2026-08-18 by goldset/0.1

Every field above is generated by our program. None of it is written by hand.

Other bugs found in terryyin/lizard