-2

A developer I hired told me to do this in order for a plugin to work.

Is it safe?

Punct Ulica
  • 97
  • 3
  • 12
  • If you got a plugin written like that, it's perhaps too late to concern yourself with reliability or safety. – mario Aug 19 '15 at 16:43
  • I almost went with a sarcastic answer but I figured it would be nice to actually help out. – Tyler Collins Aug 19 '15 at 16:44
  • Fix the bug in the plugin, really **bad** developers uses buffers like in your case to hide bugs in plugins. This is really really bad to hide bugs. Bugs should **always** be fixed – Pieter Goosen Aug 19 '15 at 18:22

1 Answers1

1

This function will turn output buffering on. While output buffering is active no output is sent from the script (other than headers), instead the output is stored in an internal buffer.

The contents of this internal buffer may be copied into a string variable using ob_get_contents(). To output what is stored in the internal buffer, use ob_end_flush(). Alternatively, ob_end_clean() will silently discard the buffer contents.

http://php.net/manual/en/function.ob-start.php

Yes, it is "safe". It won't compromise your data or anything, and if (at the worst) you need to revert back, all you have to do is remove the line, no problems whatsoever.

Tyler Collins
  • 127
  • 10
  • 1
    Yes, while it's not likely harmful by itself, it might interact (not as desired) with other output buffering layers (from other sloppy plugins, or a general php.ini-configured output buffer even). – mario Aug 19 '15 at 16:47
  • Right. That's how i meant "safe" as in not harmful. If it screws up his page output and gives undesired results, fixing it is as easy as removing the line that he added and he'll be right back where he was with no damage done. – Tyler Collins Aug 19 '15 at 16:49
  • At the worst, it will just make the one page render look bad, and once it's removed, it will render properly again. – Tyler Collins Aug 19 '15 at 16:49