Really sorry if this has been reported. I am trying to code something, while working ran across a warning that I corrected per the following.
Setup is this:
I have an includes/configure.php file in a sub-directory off of my localhost, so localhost/sub-directory/includes/configure.php file does exist. I have also a includes/local/configure.php file that I am using to override the default configure.php file.
Customer trying to login, but forgot password. selected forgot password, provided email address.
During the attempt to send the new password received 15 iterations of the following message: path slightly obscured
Code:
PHP Warning: sha1_file(/includes/configure.php): failed to open stream: No such file or directory in PATH_TO_SUBDIRECTORY\includes\functions\password_funcs.php on line 118
line 118 of password_funcs.php contained:
Code:
$entropy = sha1_file('/includes/configure.php');
Complete code for this section:
Code:
if (strlen($entropy) < 16)
{
$entropy = sha1_file('/includes/configure.php');
$entropy .= microtime() . mt_rand() . $seed;
//echo "USING FALLBACK" . "<br>";
}
return sha1($entropy);
When the line was changed to:
Code:
$entropy = sha1_file('includes/configure.php'); // mc12345678
No warnings were observed when the customer requested a new/forgotten password.
This problem has not been seen using the same code on an apache server. Just before this section there is some work done if the server is on a windows platform. Perhaps the code that follows into the windows area and if not a windows server to use the default above version, or to provide some sort of warning check as part of the above to mitigate this response/behavior.
Okay I'm off to returning to my coding.
Bookmarks