Opened 21 years ago
Closed 21 years ago
#2297 closed defect (bug) (fixed)
printr does not properly clean up after itself
| Reported by: | doit-cu | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | General | Version: | 2.0 |
| Severity: | normal | Keywords: | bg|has-patch bg|commit |
| Cc: | Focuses: |
Description
I'm not sure what the purpose of this funtion is (print_r accepts a bool which does the same thing...). However, this function does not properly cleanup the ob portion. You need to add ob_clean_end(); on line 47 of functions-compat.php in order to fix this. ob_starts can be nested, but ob_clean_end only ends the top most ob_start, so if you were to ob_start outside this funtion, ob_clean_end inside the function would not kill that ob_start (only the one inside the function). Not ending output buffering inside the function makes it a bloody pain to try to debug your code.
Thank you,
--Joel
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
This is a compat function, the second parameter to print_r was only added in PHP 4.3, our minimum requirements are below that. Bug valid though.