PHP notice

exif_imagetype(): Read error!

/var/www/html/LimeSurvey-develop/application/controllers/admin/LimeSurveyFileManager.php(430)

418         if (empty($realPath) || !is_dir($realPath)) {
419             return $directoryArray;
420         }
421 
422         $files = scandir($realPath);
423 
424         foreach ($files as $file) {
425             if ($file == '.' || $file == '..') {continue;}
426 
427             $fileRelativePath = $folderPath . DIRECTORY_SEPARATOR . $file;
428             $fileRealpath = dirname(Yii::app()->basePath) . DIRECTORY_SEPARATOR . $fileRelativePath;
429             $fileIsDirectoy = @is_dir($fileRealpath);
430             $isImage =  !!exif_imagetype($fileRealpath);
431             if ($fileIsDirectoy) {
432                 continue;
433             } else {
434 
435                 $fileExt = strtolower(pathinfo($fileRealpath, PATHINFO_EXTENSION));
436                 if (!$this->_extensionAllowed($fileExt)) {continue;}
437 
438                 $iconClassArray = LsDefaultDataSets::fileTypeIcons();
439                 $size = filesize($fileRealpath);
440                 if (isset($iconClassArray[$fileExt])) {
441                     $iconClass = $iconClassArray[$fileExt];
442                 } else {

Stack Trace

#0
+
 /var/www/html/LimeSurvey-develop/application/controllers/admin/LimeSurveyFileManager.php(430): exif_imagetype("/var/www/html/LimeSurvey-develop/upload/surveys/874175/files")
425             if ($file == '.' || $file == '..') {continue;}
426 
427             $fileRelativePath = $folderPath . DIRECTORY_SEPARATOR . $file;
428             $fileRealpath = dirname(Yii::app()->basePath) . DIRECTORY_SEPARATOR . $fileRelativePath;
429             $fileIsDirectoy = @is_dir($fileRealpath);
430             $isImage =  !!exif_imagetype($fileRealpath);
431             if ($fileIsDirectoy) {
432                 continue;
433             } else {
434 
435                 $fileExt = strtolower(pathinfo($fileRealpath, PATHINFO_EXTENSION));
#1
+
 /var/www/html/LimeSurvey-develop/application/controllers/admin/LimeSurveyFileManager.php(121): LimeSurveyFileManager->_collectFileList("upload/surveys/874175")
116     {
117         $folders = $this->_collectCompleteFolderList($surveyid);
118         $result = [];
119 
120         foreach ($folders as $folder) {
121             $result[$folder] = $this->_collectFileList($folder);
122         }
123 
124         $this->_printJsonResponse($result);
125         return;
126     }
#4
+
 /var/www/html/LimeSurvey-develop/application/core/Survey_Common_Action.php(86): CAction->runWithParamsInternal(LimeSurveyFileManager, ReflectionMethod, array("r" => "admin/filemanager/sa/getFilesForSurvey", "YII_CSRF_TOKEN" => "b2dpTVNxYUNyaGZyRll5VGhGWnR2S0ZPVzVLa0ltTWX51GvLzKsZIyb5tzjMVdeA...", "surveyid" => "874175", "sa" => "getFilesForSurvey", ...))
81             $oMethod = new ReflectionMethod($this, $sDefault);
82         }
83 
84         // We're all good to go, let's execute it
85         // runWithParamsInternal would automatically get the parameters of the method and populate them as required with the params
86         return parent::runWithParamsInternal($this, $oMethod, $params);
87     }
88 
89     /**
90      * Some functions have different parameters, which are just an alias of the
91      * usual parameters we're getting in the url. This function just populates
2019-09-26 11:36:41 nginx/1.16.1 Yii Framework/1.1.21