Feature #28095
closedAdd hashing algorithms to stdWrap
100%
Description
Currently it is not possible to get an md5 hash for a value in stdWrap. By adding some lines we could have md5 generation e.g. enabling you to get a gravatar image without using a userfunc:
page.10 = TEXT
page.10 {
value = mail@domain.com
md5 = 1
wrap = <img src="http://www.gravatar.com/avatar/|" />
}
Updated by Xavier Perseguers over 13 years ago
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;
Updated by Fabrizio Branca over 13 years ago
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...
Updated by Mr. Hudson over 13 years ago
Patch set 1 of change I0673f33a1ca7bcb5784e5ab9f0def8db5ff7ea4b has been pushed to the review server.
It is available at http://review.typo3.org/3257
Updated by Mr. Hudson over 13 years ago
Patch set 1 of change I3967541526149d1b40b2a676307a60a39670405a has been pushed to the review server.
It is available at http://review.typo3.org/3258
Updated by Fabrizio Branca over 13 years ago
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...
Updated by Xavier Perseguers over 13 years ago
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...
Updated by Xavier Perseguers over 13 years ago
Do not forget either the pending documentation in wiki for stdWrap once it is merged
Updated by Mr. Hudson over 13 years ago
Patch set 2 of change I0673f33a1ca7bcb5784e5ab9f0def8db5ff7ea4b has been pushed to the review server.
It is available at http://review.typo3.org/3257
Updated by Mr. Hudson over 13 years ago
Patch set 3 of change I0673f33a1ca7bcb5784e5ab9f0def8db5ff7ea4b has been pushed to the review server.
It is available at http://review.typo3.org/3257
Updated by Mr. Hudson over 13 years ago
Patch set 4 of change I0673f33a1ca7bcb5784e5ab9f0def8db5ff7ea4b has been pushed to the review server.
It is available at http://review.typo3.org/3257
Updated by Xavier Perseguers over 13 years ago
- Subject changed from Add md5 to stdWrap to Add hashing algorithms to stdWrap
- PHP Version set to 5.3
Updated by Xavier Perseguers over 13 years ago
- Category changed from Content Rendering to TypoScript
Updated by Xavier Perseguers over 13 years ago
- Status changed from New to Under Review
Updated by Mr. Hudson over 13 years ago
Patch set 5 of change I0673f33a1ca7bcb5784e5ab9f0def8db5ff7ea4b has been pushed to the review server.
It is available at http://review.typo3.org/3257
Updated by Xavier Perseguers over 13 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Change has been successfully cherry-picked as d2e68695fd4e55d888544d7b7b8b699544ab16ed.
Updated by Xavier Perseguers over 12 years ago
- Status changed from Resolved to Closed