Update vendored libs
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Binary file not shown.
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user