Commit 19a6c84f authored by Dries's avatar Dries

- Patch #480428 by JamesAn: static caching API.

parent 2e049e5b
......@@ -350,7 +350,7 @@ function _openid_dh_xorsecret($shared, $secret) {
}
function _openid_dh_rand($stop) {
static $duplicate_cache = array();
$duplicate_cache = &drupal_static(__FUNCTION__, array());
// Used as the key for the duplicate cache
$rbytes = _openid_dh_long_to_binary($stop);
......@@ -389,7 +389,7 @@ function _openid_dh_rand($stop) {
}
function _openid_get_bytes($num_bytes) {
static $f = NULL;
$f = &drupal_static(__FUNCTION__);
$bytes = '';
if (!isset($f)) {
$f = @fopen(OPENID_RAND_SOURCE, "r");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment