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] & [2.1]: php 8.3 - Blank screen viewing source in error log code popup window #8307

Open
sbulen opened this issue Aug 18, 2024 · 3 comments

Comments

@sbulen
Copy link
Contributor

sbulen commented Aug 18, 2024

Basic Information

The popup window to view source in the error log doesn't work in PHP 8.3.

This is true for 2.1 & 3.0. PHP 8.2 works fine.

No issue logged, in smf, php or apache error logs. Nothing in the console either.

From the forum:
https://www.simplemachines.org/community/index.php?topic=589529.0

Steps to reproduce

  1. Set php version to 8.3.
  2. Open the error log, click on the source/line link to view source.

Expected result

This is what it looks like in php 8.2:
image

Actual result

This:
image

Version/Git revision

3.0 Alpha 2 & 2.1.4

Database Engine

All

Database Version

8.4

PHP Version

8.3.8

Logs

Nothing found in any log...

Additional Information

No response

@sbulen
Copy link
Contributor Author

sbulen commented Oct 7, 2024

The root of the issue here is that in PHP 8.3, significant changes were made to php's to highlight_string()...
https://php.watch/versions/8.3/highlight_file-highlight_string-html-changes

highlight_string() is used in our highlightPhpCode() function.

In particular, highlight_string() no longer returns line feeds as <br />.

@jdarwood007
Copy link
Member

Looks like we need to version sniff to handle the output properly then.

@sbulen
Copy link
Contributor Author

sbulen commented Oct 7, 2024

There is logic there already for 8.3, but I think it needs a tweak or two.

I'm working on a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants