note 37350 added to function.get-defined-constants

From: Date: Tue, 11 Nov 2003 21:00:14 +0000
Subject: note 37350 added to function.get-defined-constants
Groups: php.notes 
Request: Send a blank email to php-notes+get-60262@lists.php.net to get a copy of this message
Never define important passwords (for example: database passwords) as constants, specially if you have hosted sites within your site. Someone could include your php lib file and use this function to know the password or other information. Example: <?php include($_SERVER['DOCUMENT_ROOT'] . "/../global_settings.php"); // This file has a constant which is a password print_r(get_defined_constants()); // The password IS DISPLAYED! ?> Could this be a php security bug? ---- Manual Page -- http://www.php.net/manual/en/function.get-defined-constants.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+37350 Delete -- http://master.php.net/manage/user-notes.php?action=delete+37350&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+37350&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#60262) next »