In logs there were lines such as:
PHP Fatal error: Nesting level too deep - recursive dependency? in /home/web/prod/platal/include/security.inc.php on line 108, referer: https://www.polytechnique.org/register
More information can be found at:
- http://stackoverflow.com/questions/
12488661/is-it-possible-to-list-out-all-the-global-variables-in-php
- http://php.net/manual/fr/function.var-export.php (in the comments)
Signed-off-by: Nicolas Iooss <nicolas.iooss_git@polytechnique.org>
$mailer->setFrom("webmaster@" . $globals->mail->domain);
$mailer->addTo($globals->core->admin_email);
$mailer->setSubject("[Plat/al Security Alert] $title");
- $mailer->setTxtBody($body . "Identifiants de session :\n" . var_export($_SESSION, true) . "\n\n"
+ // Note: we can't do $session = var_export($_SESSION, true) as var_export
+ // doesn't handle circular dependency correctly.
+ ob_start();
+ var_dump($_SESSION);
+ $session = ob_get_clean();
+ $mailer->setTxtBody($body . "Identifiants de session :\n" . $session . "\n\n"
."Identifiants de connexion :\n" . var_export($_SERVER, true));
$mailer->send();
}