Change file name to lower case
and codestyle [MAILPOET-4203]
This commit is contained in:
@ -105,7 +105,7 @@ class Captcha {
|
|||||||
return !empty(array_intersect($roles, (array)$user->roles));
|
return !empty(array_intersect($roles, (array)$user->roles));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function renderAudio($sessionId, $return=false) {
|
public function renderAudio($sessionId, $return = false) {
|
||||||
|
|
||||||
$audioPath = Env::$assetsPath . '/audio/';
|
$audioPath = Env::$assetsPath . '/audio/';
|
||||||
$this->captchaSession->init($sessionId);
|
$this->captchaSession->init($sessionId);
|
||||||
@ -113,8 +113,8 @@ class Captcha {
|
|||||||
|
|
||||||
$audio = null;
|
$audio = null;
|
||||||
foreach (str_split($captcha) as $character) {
|
foreach (str_split($captcha) as $character) {
|
||||||
$file = $audioPath . strtoupper($character) . '.mp3';
|
$file = $audioPath . strtolower($character) . '.mp3';
|
||||||
if (! file_exists($file)) {
|
if (!file_exists($file)) {
|
||||||
throw new \RuntimeException("File not found.");
|
throw new \RuntimeException("File not found.");
|
||||||
}
|
}
|
||||||
$audio .= file_get_contents($file);
|
$audio .= file_get_contents($file);
|
||||||
@ -127,6 +127,7 @@ class Captcha {
|
|||||||
header("Cache-Control: no-store, no-cache, must-revalidate");
|
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||||
header('Content-Type: audio/mpeg');
|
header('Content-Type: audio/mpeg');
|
||||||
|
|
||||||
|
//phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped, WordPressDotOrg.sniffs.OutputEscaping.UnescapedOutputParameter
|
||||||
echo $audio;
|
echo $audio;
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user