From 95ba8a0747d83fd61aa57a89b393ba8243cd4147 Mon Sep 17 00:00:00 2001 From: "Pavel S. Pobegov" Date: Wed, 30 Nov 2022 13:53:54 +0100 Subject: [PATCH] Update InitialAvatar.php --- src/InitialAvatar.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/InitialAvatar.php b/src/InitialAvatar.php index a3b931c..565b54c 100644 --- a/src/InitialAvatar.php +++ b/src/InitialAvatar.php @@ -674,9 +674,21 @@ protected function findFontFile() { foreach ( $weightsToTry as $weight ) { $fontFile = preg_replace( '/(\-(Bold|Semibold|Regular))/', "-{$weight}", $originalFile ); - if ( file_exists( $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;