Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions src/InitialAvatar.php
Original file line number Diff line number Diff line change
Expand Up @@ -737,9 +737,21 @@ protected function findFontFile()
foreach ($weightsToTry as $weight) {
$fontFile = preg_replace('/(\-(Bold|Semibold|Regular))/', "-{$weight}", $originalFile);

if (file_exists($fontFile)) {
return $fontFile;
}
/*
- with php 8.1 AND
- with open_basedir restriction enabled where /fonts/ is not present (is there a linux/unix box where
there is a directory on root level called /fonts/? I do not know any)

THEN

- the below file_exists check will throw a warning, which is wrong :)
*/

/*
if ( file_exists( $fontFile ) ) {
return $fontFile;
}
*/

if (file_exists(__DIR__.$fontFile)) {
return __DIR__.$fontFile;
Expand Down