The documentation page for CsrfTokenGenerator::computeToken() describes the return value using the following phrase.
A 43-character URL-safe token for validation, based on the token seed, the hash salt provided by Settings::getHashSalt(), and the 'drupal_private_key' configuration variable.
The drupal_private_key configuration variable doesn't exist anymore; it was a persistent variable used in Drupal 7. The private key is stored in the system.private_key state key.
I would rather change the description to the following one.
A 43-character URL-safe token for validation, based on the token seed, the hash salt provided by Settings::getHashSalt(), and the site private key.
At the same time, the method description should say site private key instead of simply private key.
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | fix-documentation-comment3004281-12.patch | 720 bytes | avpaderno |
| #11 | fix-documentation-comment-3004281-11.patch | 1.3 KB | dhirendra.mishra |
| #5 | fix-documentation-comment-3004281-5.patch | 1.75 KB | avpaderno |
| #3 | 3004281-3.patch | 720 bytes | hardikpandya |
Comments
Comment #2
avpadernoComment #3
hardikpandya commentedComment #4
joachim commentedLGTM.
Comment #5
avpadernoThere are other places in the CsrfTokenGenerator.php file where private key is used. This patch fixed those too, without touching private key service, which is the correct service name.
Comment #6
prashantgajare commentedComment #8
avpadernoThe last test failed because the CI job was missing, not because an error in the patch.
Comment #9
borisson_This makes the method description run over 80 cols (in 2 lines). According to our coding standards that's not allowed, the first line of documention is only allowed to be one line long.
Comment #10
dhirendra.mishra commentedworking on it.
Comment #11
dhirendra.mishra commentedCorrection from #9. Please follow the patch.
Comment #12
avpadernoI left the short descriptions of the methods as they were, otherwise they would get on two lines, or a single line with more than 80 characters, which I understand #9 suggests it is wrong.
Comment #13
borisson_That seems a lot better. Thanks!
Comment #15
avpadernoComment #16
dhirendra.mishra commentedComment #18
avpadernoComment #19
bramdriesenQueued for testing. Patch itself looks good.
Comment #20
catchCommitted e52debb and pushed to 8.7.x. Thanks!