PHP warning

finfo_file(/home/sondages.pro/htdocs/limesurvey_GIT/LimeSurvey_master/upload/themes/survey/generalfiles/monlogo.png): failed to open stream: No such file or directory

/home/sondages.pro/htdocs/limesurvey_GIT/LimeSurvey_master/framework/utils/CFileHelper.php(282)

270      * PHP extension is available. This parameter has been available since version 1.1.3.
271      * @param boolean $checkExtension whether to check the file extension in case the MIME type cannot be determined
272      * based on finfo and mime_content_type. Defaults to true. This parameter has been available since version 1.1.4.
273      * @return string the MIME type. Null is returned if the MIME type cannot be determined.
274      */
275     public static function getMimeType($file,$magicFile=null,$checkExtension=true)
276     {
277         if(function_exists('finfo_open'))
278         {
279             $options=defined('FILEINFO_MIME_TYPE') ? FILEINFO_MIME_TYPE : FILEINFO_MIME;
280             $info=$magicFile===null ? finfo_open($options) : finfo_open($options,$magicFile);
281 
282             if($info && ($result=finfo_file($info,$file))!==false)
283                 return $result;
284         }
285 
286         if(function_exists('mime_content_type') && ($result=mime_content_type($file))!==false)
287             return $result;
288 
289         return $checkExtension ? self::getMimeTypeByExtension($file) : null;
290     }
291 
292     /**
293      * Determines the MIME type based on the extension name of the specified file.
294      * This method will use a local map between extension name and MIME type.

Stack Trace

#1
+
 /home/sondages.pro/htdocs/limesurvey_GIT/LimeSurvey_master/application/core/LSYii_ImageValidator.php(28): CFileHelper::getMimeType("/home/sondages.pro/htdocs/limesurvey_GIT/LimeSurvey_master/uploa...")
23     * @return array
24     */
25     static function validateImage($path)
26     {
27         $result =[];
28         $checkImage = CFileHelper::getMimeType($path);
29         $result['debug'] = $checkImage;
30         $allowedImageFormats = array("image/png", "image/jpg", "image/jpeg", "image/gif", "image/svg+xml", "image/x-icon");
31 
32         if (!empty($checkImage) && in_array($checkImage, $allowedImageFormats)) {
33             $result['uploadresult'] = '';
#2
+
 /home/sondages.pro/htdocs/limesurvey_GIT/LimeSurvey_master/application/core/LS_Twig_Extension.php(278): LSYii_ImageValidator::validateImage("/home/sondages.pro/htdocs/limesurvey_GIT/LimeSurvey_master/uploa...")
273         } else {
274             $sFullPath = Yii::app()->getConfig('rootdir').'/'.$sImagePath;
275         }
276 
277         // check if this is a true image
278         $checkImage = LSYii_ImageValidator::validateImage($sFullPath  );
279 
280         if (!$checkImage['check']) {
281             return false;
282         }
283 
#3
+
 /home/sondages.pro/htdocs/limesurvey_GIT/LimeSurvey_master/tmp/runtime/twig_cache/07/078af9cda1e3f1ecaf43d6d3a207a8bb4ec8de94f44e4cb63b4c406b2aaa3af4.php(84): LS_Twig_Extension::image("upload/themes/survey/generalfiles/monlogo.png", "TEST_INTAKE_Kapo_2018", array("class" => "logo img-responsive"))
79                 echo " logo-container hidden-xs\"  ";
80                 echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed($this->getAttribute($this->getAttribute((isset($context["aSurveyInfo"]) ? $context["aSurveyInfo"] : null), "attr", array()), "navbarbrand", array()));
81                 echo "  >
82                 ";
83                 // line 34
84                 echo $this->env->getExtension('Twig_Extension_Sandbox')->ensureToStringAllowed(LS_Twig_Extension::image($this->getAttribute($this->getAttribute((isset($context["aSurveyInfo"]) ? $context["aSurveyInfo"] : null), "options", array()), "brandlogofile", array()), $this->getAttribute((isset($context["aSurveyInfo"]) ? $context["aSurveyInfo"] : null), "name", array()), array("class" => "logo img-responsive")));
85                 echo "
86             </div>
87         ";
88             } else {
89                 // line 37
2018-12-19 18:08:38 Apache/2.2.22 (Debian) Yii Framework/1.1.20