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

Output buffering changed on display? #187

Closed
machavity opened this issue Feb 18, 2016 · 1 comment
Closed

Output buffering changed on display? #187

machavity opened this issue Feb 18, 2016 · 1 comment

Comments

@machavity
Copy link

I was updating our internal development server to PHP 7 and found that Smarty 3.1.17 didn't play well with it, but 3.1.29 did. No problem, I updated. Afterwards, I noticed a problem with FirePHP saying that headers had been sent. I assumed it was a PHP7 issue but when it went to production it was doing the same thing so no redirects were working. After rolling it back I solved some of the problems by rolling my development up to the latest unreleased in the GitHub repo, but the problem with display() still remained.

After playing with it, I changed to echo $smarty->fetch(); and it works again.
I'm not sure what changed here but does anyone know what changed in display() to make it output headers? Even running ob_start wouldn't fix it

uwetews added a commit that referenced this issue Feb 19, 2016
…e possible problems when PHP files had

    characters (newline} after ?> at file end #187
@uwetews
Copy link
Contributor

uwetews commented Feb 19, 2016

I suspect that you have PHP files which do have some characters like newline after the ?> at file end.
These could cause the header send problems as for performance we did flush() the output buffers instead of echoing its content.
Better remove all ?> tags at files end as it is not needed.
However reverted the code to echo the output again on echo.

The fix is now in the master branch.

@uwetews uwetews closed this as completed Feb 19, 2016
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

No branches or pull requests

2 participants