diff --git a/src/PWGen.php b/src/PWGen.php index eb12e7d..1194d25 100644 --- a/src/PWGen.php +++ b/src/PWGen.php @@ -291,8 +291,8 @@ private function pw_phonemes() if ($this->pwgen_flags & self::PW_UPPERS) { if (($first || $flags & self::CONSONANT) && (self::my_rand(0, 9) < 2) && - ($this->pwgen_flags & self::PW_AMBIGUOUS) && - strpos(self::$pw_ambiguous, strtoupper($this->password[$c])) === false) { + (($this->pwgen_flags & self::PW_AMBIGUOUS) || + strpos(self::$pw_ambiguous, strtoupper($this->password[$c])) === false)) { $this->password[$c] = strtoupper($this->password[$c]); $feature_flags &= ~self::PW_UPPERS; } diff --git a/tests/PWGen/PWGenTest.php b/tests/PWGen/PWGenTest.php index a387615..437721c 100644 --- a/tests/PWGen/PWGenTest.php +++ b/tests/PWGen/PWGenTest.php @@ -113,7 +113,7 @@ public function testGenerateCapitalize() public function testGenerateAmbiguous() { - $pwgen = new PWGen(20, false, false, false, true); + $pwgen = new PWGen(20, false, false, true, true); $this->assertEquals(20, $pwgen->getLength()); $this->assertTrue($pwgen->hasAmbiguous());