Skip to content
This repository

Fixed Zend\Math\Rand::getString() to pass the parameter $strong to ::getBytes() #2764

Closed
wants to merge 1 commit into from

2 participants

Bernhard Schussek Matthew Weier O'Phinney
Bernhard Schussek

Previously, the parameter $strong wasn't passed from getString() to getBytes() in the default chase that $charlist was empty. This PR fixes that.

Matthew Weier O'Phinney

Is there a way to test this? If so, could you please do so, @bschussek ?

Bernhard Schussek

@weierophinney I tried to figure one out. The problem is that the existing tests are very scarce, $strong in general isn't even tested. Maybe the original authors of Rand can help here?

Matthew Weier O'Phinney

@bschussek Yeah, on reflection, I'm not sure there is a way to test this. I'll merge.

Deleted user Unknown referenced this pull request from a commit
Matthew Weier O'Phinney weierophinney Merge branch 'hotfix/2764'
Close #2764
c3e5b82
Deleted user Unknown referenced this pull request from a commit
Matthew Weier O'Phinney weierophinney Merge branch 'hotfix/2764' into develop
Forward port #2764
d26b9c6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Oct 15, 2012
Bernhard Schussek webmozart Fixed Zend\Math\Rand::getString() to pass the parameter $strong to ::…
…getBytes()
41ad8de
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. +1 1  library/Zend/Math/Rand.php
2  library/Zend/Math/Rand.php
@@ -153,7 +153,7 @@ public static function getString($length, $charlist = null, $strong = false)
153 153 // charlist is empty or not provided
154 154 if (empty($charlist)) {
155 155 $numBytes = ceil($length * 0.75);
156   - $bytes = static::getBytes($numBytes);
  156 + $bytes = static::getBytes($numBytes, $strong);
157 157 return substr(rtrim(base64_encode($bytes), '='), 0, $length);
158 158 }
159 159

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.