Update vendored libs

This commit is contained in:
Frédéric Guillot
2020-06-08 22:46:20 -07:00
parent dfb0a2d915
commit f60e4a0c59
292 changed files with 9402 additions and 9487 deletions

View File

@@ -26,7 +26,7 @@ class CaptchaBuilder implements CaptchaBuilderInterface
/**
* @var array
*/
protected $textColor = null;
protected $textColor = array();
/**
* @var array
@@ -135,12 +135,8 @@ class CaptchaBuilder implements CaptchaBuilderInterface
} else {
$this->builder = $builder;
}
if ($phrase === null) {
$phrase = $this->builder->build();
}
$this->phrase = $phrase;
$this->phrase = is_string($phrase) ? $phrase : $this->builder->build($phrase);
}
/**

View File

@@ -21,7 +21,7 @@ class PhraseBuilder implements PhraseBuilderInterface
/**
* Constructs a PhraseBuilder with given parameters
*/
public function __construct($length = 5, $charset = 'abcdefghijklmnpqrstuvwxyz123456789')
public function __construct($length = 5, $charset = 'abcdefghijklmnpqrstuvwxyz123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ')
{
$this->length = $length;
$this->charset = $charset;
@@ -53,7 +53,23 @@ class PhraseBuilder implements PhraseBuilderInterface
* "Niceize" a code
*/
public function niceize($str)
{
return self::doNiceize($str);
}
/**
* A static helper to niceize
*/
public static function doNiceize($str)
{
return strtr(strtolower($str), '01', 'ol');
}
/**
* A static helper to compare
*/
public static function comparePhrases($str1, $str2)
{
return self::doNiceize($str1) === self::doNiceize($str2);
}
}