diff --git a/src/CaptchaBuilder.php b/src/CaptchaBuilder.php index c92f0e1..65490aa 100644 --- a/src/CaptchaBuilder.php +++ b/src/CaptchaBuilder.php @@ -509,6 +509,12 @@ protected function getFontPath($font) } $tmpPath = sys_get_temp_dir() ?: '/tmp'; + if (function_exists('runtime_path')) { + $tmpPath = runtime_path('tmp'); + if (!is_dir($tmpPath)) { + mkdir($tmpPath, 0777, true); + } + } $filePath = "$tmpPath/" . basename($font); clearstatcache(); if (!isset($fontPathMap[$font]) || !is_file($filePath)) {