Feature #28095
closed
I don't like the idea of adding md5 alone. Better would be to support sha1 too and possibly lots of other hashing algorithms.
Have a look at http://ch.php.net/manual/en/function.hash-algos.php, PHP 5.3 has a lot of supported hashing algorithms. For me supporting md5, sha1, sha256 seems a must have if we implement this feature.
What about:
page.10 = TEXT
page.10 {
value = mail@domain.com
hash = md5
wrap = <img src="http://www.gravatar.com/avatar/|" />
}
Just add stdWrap on hash (to let us do whatever we want) and then the implementation is basically this one:
if (function_exists('hash') && in_array($algo, hash_algos())) {
$hash = hash($algo, $plain);
// elseif parts even optional I guess
} elseif ($algo === 'md5') {
$hash = md5($plain);
} elseif ($algo === 'sha1') {
$hash = sha1($plain)
} else {
$hash = $plain;
}
return $hash;
That looks good. I'm still struggling with setting up git/gerrit to push this patch. I'll create an updated patch for that and push that to Gerrit, if you don't mind...
Patch set 1 of change I0673f33a1ca7bcb5784e5ab9f0def8db5ff7ea4b has been pushed to the review server.
It is available at http://review.typo3.org/3257
Patch set 1 of change I3967541526149d1b40b2a676307a60a39670405a has been pushed to the review server.
It is available at http://review.typo3.org/3258
I tried to update my first path for a whitespace fix, but it seems that I did not create a new patchset but a complete new patch by removing the Change-Id line. Sorry for that...
Just abandone one of them, possibly the one without my review...
and possibly update commit message to describe what it does without saying that it was not possible before...
Do not forget either the pending documentation in wiki for stdWrap once it is merged
Patch set 2 of change I0673f33a1ca7bcb5784e5ab9f0def8db5ff7ea4b has been pushed to the review server.
It is available at http://review.typo3.org/3257
Patch set 3 of change I0673f33a1ca7bcb5784e5ab9f0def8db5ff7ea4b has been pushed to the review server.
It is available at http://review.typo3.org/3257
Patch set 4 of change I0673f33a1ca7bcb5784e5ab9f0def8db5ff7ea4b has been pushed to the review server.
It is available at http://review.typo3.org/3257
- Subject changed from Add md5 to stdWrap to Add hashing algorithms to stdWrap
- PHP Version set to 5.3
- Category changed from Content Rendering to TypoScript
- Status changed from New to Under Review
Patch set 5 of change I0673f33a1ca7bcb5784e5ab9f0def8db5ff7ea4b has been pushed to the review server.
It is available at http://review.typo3.org/3257
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Change has been successfully cherry-picked as d2e68695fd4e55d888544d7b7b8b699544ab16ed.
- Status changed from Resolved to Closed
- Target version deleted (
1281)
Also available in: Atom
PDF