forked from GithubBackups/tinyib
Resolve simple CAPTCHA failure to locate font
This commit is contained in:
parent
d699e97c19
commit
6733d28ee5
@ -235,7 +235,7 @@ class SimpleCaptcha {
|
|||||||
if (substr($this->wordsFile, 0, 1) == '/') {
|
if (substr($this->wordsFile, 0, 1) == '/') {
|
||||||
$wordsfile = $this->wordsFile;
|
$wordsfile = $this->wordsFile;
|
||||||
} else {
|
} else {
|
||||||
$wordsfile = $this->resourcesPath . '/' . $this->wordsFile;
|
$wordsfile = realpath(dirname(__FILE__)) . '/' . $this->resourcesPath . '/' . $this->wordsFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!file_exists($wordsfile)) {
|
if (!file_exists($wordsfile)) {
|
||||||
@ -293,7 +293,7 @@ class SimpleCaptcha {
|
|||||||
$fontcfg = $this->fonts[array_rand($this->fonts)];
|
$fontcfg = $this->fonts[array_rand($this->fonts)];
|
||||||
}
|
}
|
||||||
|
|
||||||
$fontfile = $fontcfg['font'];
|
$fontfile = realpath(dirname(__FILE__)) . '/' . $this->resourcesPath . '/' . $fontcfg['font'];
|
||||||
|
|
||||||
/** Increase font-size for shortest words: 9% for each glyph missing */
|
/** Increase font-size for shortest words: 9% for each glyph missing */
|
||||||
$lettersMissing = $this->maxWordLength - strlen($text);
|
$lettersMissing = $this->maxWordLength - strlen($text);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user