Ask a Question related to PHP Development, Design and Development.
-
icecube at fr dot fm #1
#17874 [Com]: var_export prints to screen
ID: 17874
Comment by: icecube at fr dot fm
Reported By: che at atlantic dot net
Status: Bogus
Bug Type: Output Control
Operating System: Windows 2000
PHP Version: 4.2.0
New Comment:
<?
$foo=var_export($GLOBALS,TRUE);
?>
(whithout or not output buffering).
It's the same problem: var_export outputs to the screen $GLOBALS and
then die with an error message.
So that's not a bug...
Ok now imagine you're using a this script in in your website, and you
haven't noticed that error.
With an example it's more easy to understand:
<?
function save_anywhere($foo) {
$save=var_export($foo,TRUE);
/* ... */
}
save_anywhere(&$GLOBALS);
?>
You wish to save $GLOBALS for a any reason (log, ...) and what's the
result ? var_export produces an error and outputs ALL your variables
directly to the user, wich now can hack your site just because he has
your $mdp = "..." :)
It's maybe not necessary to output a variable that was destinated (with
the second parameter TRUE) to be stocked anywhere except in the user
HD.
Previous Comments:
------------------------------------------------------------------------
[2002-06-20 12:12:32] [email]sander@php.net[/email]
Not a b. var_export() dies in recursive arrays. var_export() uses
output buffering internally to deal with the second parameter. The
(internal) ob_end_clean() call will never make it because PHP dies
before it reaches that point and then it just outputs all buffers.
------------------------------------------------------------------------
[2002-06-20 12:02:27] che at atlantic dot net
This is because GLOBALS is recursively linked to itself and it is
causing var_export to die.
------------------------------------------------------------------------
[2002-06-20 11:47:02] che at atlantic dot net
The code below outputs to the screen. (Even with output buffering)
ob_start();
$v = var_export($GLOBALS, TRUE);
ob_end_clean();
------------------------------------------------------------------------
--
Edit this bug report at [url]http://bugs.php.net/?id=17874&edit=1[/url]
icecube at fr dot fm Guest
-
Prints ok in Reader 8, but looks lousy on screen
I installed Acrobat Reader 8 today, hoping it would address display issues in PDFs that I simply never encounter when I use Preview. Here’s the... -
Acrobat 6.01: Screen Version Incorrect But Prints Correctly?
Acrobat 6.01/Win -- InDesign CS to Acrobat using Export for Print. The publication is B/W. A black line behind the page numbers is "correctly"... -
Button1 prints frame1, button2 prints frame2?
In short: Clicking Button1 should print Picture1, and clicking Button2 should print Picture2, but both buttons print the same picture OR (if I... -
Picture package prints incorrect sized prints
I tried to print a package using the template that includes 2 4x5 (why not 4x6?) and 8 2.5x3 (I may be off on the latter dimensions). When I went to...



Reply With Quote

