Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.0] Fix blank screens in error log #8319

Open
wants to merge 3 commits into
base: release-3.0
Choose a base branch
from

Conversation

sbulen
Copy link
Contributor

@sbulen sbulen commented Oct 8, 2024

Partial for #8307

Prior to php 8.3, highlight_string() added some wrapper code before & after the requested code - code tags, spans, etc. Including line feeds... Since eols were returned as br tags within the requested code, you could easily strip the wrapper line feeds by mapping \n to ''.

With 8.3, everything comes back using newlines, both the requested code & the wrapper code, so stripping newlines broke stuff by turning the whole program into one large line...

Two tweaks needed:

  • Translate all newlines into br tags, like in php < 8.3, and as expected by downstream processing
  • Strip br tags inserted before & after the requested code, so code line numbers are still accurate when displayed

Tested in php 8.l, 8.2, and 8.3.

Signed by Shawn Bulen, bulens@pacbell.net
Signed by Shawn Bulen, bulens@pacbell.net
Signed by Shawn Bulen, bulens@pacbell.net
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant