Merge "Give a 200 response for valid user pages"
[lhc/web/wiklou.git] / includes / CryptRand.php
index 858eebf..4255d56 100644 (file)
@@ -106,7 +106,11 @@ class MWCryptRand {
                                        }
                                }
                                // The absolute filename itself will differ from install to install so don't leave it out
-                               $state .= realpath( $file );
+                               if( ( $path = realpath( $file ) ) !== false ) {
+                                       $state .= $path;
+                               } else {
+                                       $state .= $file;
+                               }
                                $state .= implode( '', $stat );
                        } else {
                                // The fact that the file isn't there is worth at least a
@@ -391,7 +395,7 @@ class MWCryptRand {
                // We hash the random state with more salt to avoid the state from leaking
                // out and being used to predict the /randomness/ that follows.
                if ( strlen( $buffer ) < $bytes ) {
-                       wfDebug( __METHOD__ . ": Falling back to using a pseudo random state to generate randomness.\n" ); 
+                       wfDebug( __METHOD__ . ": Falling back to using a pseudo random state to generate randomness.\n" );
                }
                while ( strlen( $buffer ) < $bytes ) {
                        wfProfileIn( __METHOD__ . '-fallback' );