- First commit to issue fork.
- Merge request !7511Issue #2745013: drupal_random_key() documentation for length of returned string is wrong → (Closed) created by apaderno
- last update
8 months ago 2,179 pass - Status changed to Needs review
8 months ago 7:33pm 15 April 2024 - Status changed to Needs work
7 months ago 11:42am 31 May 2024 - 🇸🇰Slovakia poker10
Thanks for working on this. I see that D10 is replacing the characters (https://git.drupalcode.org/project/drupal/-/blob/11.x/core/lib/Drupal/Co...), but D7 does not seems to do it (https://git.drupalcode.org/project/drupal/-/blob/7.x/includes/bootstrap....). So is the comment correct?
* A base-64 encoded string, with + replaced with -, / with _ and any = * padding characters removed.
- Status changed to Needs review
7 months ago 3:17pm 31 May 2024 - 🇮🇹Italy apaderno Brescia, 🇮🇹
Those characters are replaced by
drupal_base64_encode()
.function drupal_random_key($byte_count = 32) { return drupal_base64_encode(drupal_random_bytes($byte_count)); }
function drupal_base64_encode($string) { $data = base64_encode($string); // Modify the output so it's safe to use in URLs. return strtr($data, array( '+' => '-', '/' => '_', '=' => '', )); }
- Status changed to RTBC
7 months ago 5:58pm 31 May 2024 - 🇸🇰Slovakia poker10
Oh, sorry, I overlooked that the function is calling
drupal_base64_encode()
instead of standardbase64_encode()
. Then I think this is correct and the same as we have in D10. RTBC, thanks! - Status changed to Fixed
7 months ago 2:52pm 3 June 2024 Automatically closed - issue fixed for 2 weeks with no activity.