Resolve simple CAPTCHA failure to locate font

This commit is contained in:
Trevor Slocum 2018-11-14 05:50:00 -08:00
parent d699e97c19
commit 6733d28ee5
1 changed files with 2 additions and 2 deletions

View File

@ -235,7 +235,7 @@ class SimpleCaptcha {
if (substr($this->wordsFile, 0, 1) == '/') {
$wordsfile = $this->wordsFile;
} else {
$wordsfile = $this->resourcesPath . '/' . $this->wordsFile;
$wordsfile = realpath(dirname(__FILE__)) . '/' . $this->resourcesPath . '/' . $this->wordsFile;
}
if (!file_exists($wordsfile)) {
@ -293,7 +293,7 @@ class SimpleCaptcha {
$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 */
$lettersMissing = $this->maxWordLength - strlen($text);