Project

General

Profile

Actions

Feature #28095

closed

Add hashing algorithms to stdWrap

Added by Fabrizio Branca over 12 years ago. Updated almost 11 years ago.

Status:
Closed
Priority:
Should have
Category:
TypoScript
Target version:
-
Start date:
2011-07-11
Due date:
% Done:

100%

Estimated time:
PHP Version:
5.3
Tags:
Complexity:
Sprint Focus:

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 =
md5 = 1
wrap = <img src="http://www.gravatar.com/avatar/|&quot; />
}


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Feature #28230: Add support for PBKDF2 to hashingClosedStefan Neufeind2011-07-15

Actions
Actions #1

Updated by Xavier Perseguers over 12 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;
Actions #2

Updated by Fabrizio Branca over 12 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...

Actions #3

Updated by Mr. Hudson over 12 years ago

Patch set 1 of change I0673f33a1ca7bcb5784e5ab9f0def8db5ff7ea4b has been pushed to the review server.
It is available at http://review.typo3.org/3257

Actions #4

Updated by Mr. Hudson over 12 years ago

Patch set 1 of change I3967541526149d1b40b2a676307a60a39670405a has been pushed to the review server.
It is available at http://review.typo3.org/3258

Actions #5

Updated by Fabrizio Branca over 12 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...

Actions #6

Updated by Xavier Perseguers over 12 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...

Actions #7

Updated by Xavier Perseguers over 12 years ago

Do not forget either the pending documentation in wiki for stdWrap once it is merged

Actions #8

Updated by Mr. Hudson over 12 years ago

Patch set 2 of change I0673f33a1ca7bcb5784e5ab9f0def8db5ff7ea4b has been pushed to the review server.
It is available at http://review.typo3.org/3257

Actions #9

Updated by Mr. Hudson over 12 years ago

Patch set 3 of change I0673f33a1ca7bcb5784e5ab9f0def8db5ff7ea4b has been pushed to the review server.
It is available at http://review.typo3.org/3257

Actions #10

Updated by Mr. Hudson over 12 years ago

Patch set 4 of change I0673f33a1ca7bcb5784e5ab9f0def8db5ff7ea4b has been pushed to the review server.
It is available at http://review.typo3.org/3257

Actions #11

Updated by Xavier Perseguers over 12 years ago

  • Subject changed from Add md5 to stdWrap to Add hashing algorithms to stdWrap
  • PHP Version set to 5.3
Actions #12

Updated by Xavier Perseguers over 12 years ago

  • Category changed from Content Rendering to TypoScript
Actions #13

Updated by Xavier Perseguers over 12 years ago

  • Status changed from New to Under Review
Actions #14

Updated by Mr. Hudson over 12 years ago

Patch set 5 of change I0673f33a1ca7bcb5784e5ab9f0def8db5ff7ea4b has been pushed to the review server.
It is available at http://review.typo3.org/3257

Actions #15

Updated by Xavier Perseguers over 12 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

Change has been successfully cherry-picked as d2e68695fd4e55d888544d7b7b8b699544ab16ed.

Actions #16

Updated by Xavier Perseguers about 12 years ago

  • Status changed from Resolved to Closed
Actions #17

Updated by Ernesto Baschny almost 11 years ago

  • Target version deleted (1281)
Actions

Also available in: Atom PDF