Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

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

Closed
wants to merge 1 commit into from

2 participants

@webmozart

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

@weierophinney

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

@webmozart

@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?

@weierophinney

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

@ghost Unknown referenced this pull request from a commit
@weierophinney weierophinney Merge branch 'hotfix/2764'
Close #2764
c3e5b82
@ghost Unknown referenced this pull request from a commit
@weierophinney weierophinney Merge branch 'hotfix/2764' into develop
Forward port #2764
d26b9c6
@weierophinney weierophinney referenced this pull request from a commit in zendframework/zend-math
@weierophinney weierophinney Merge branch 'hotfix/2764' 4eb371b
@weierophinney weierophinney referenced this pull request from a commit in zendframework/zend-math
@weierophinney weierophinney Merge branch 'hotfix/2764' into develop 9456eac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  library/Zend/Math/Rand.php
View
2  library/Zend/Math/Rand.php
@@ -153,7 +153,7 @@ public static function getString($length, $charlist = null, $strong = false)
// charlist is empty or not provided
if (empty($charlist)) {
$numBytes = ceil($length * 0.75);
- $bytes = static::getBytes($numBytes);
+ $bytes = static::getBytes($numBytes, $strong);
return substr(rtrim(base64_encode($bytes), '='), 0, $length);
}
Something went wrong with that request. Please try again.