It is said :

Leaving this area blank means all files uploaded with be protected by file access.

(with => will)

But when it's blank, the fieldset "File access" does not appear on the edit node mode.

In the function file_access_node_get_files($node) (line 375) :

375 function file_access_node_get_files($node) {
376   $files = array();
377   // Get files from Drupal's Upload module (stored as objects)
378   $uploads = file_access_node_get_uploads($node);
379   // Get files from fieldfield fields (stored as array)
380   $filefields = file_access_node_get_filefields($node);
381   // Combine the results into one array
382   $files = is_array($uploads) ? array_merge($files, $uploads) : $files;
383   $files = is_array($filefields) ? array_merge($files, $filefields) : $files;
384   // Filter out files which are not protected by file access
385   $extensions = explode(' ', variable_get('file_access_extensions', ''));
386   if (!empty($extensions)) { // debug
387     foreach ($files as $index => $settings) {
388       $ext = pathinfo($settings['filepath'], PATHINFO_EXTENSION);
389       if (!in_array($ext, $extensions)) {
390         unset($files[$index]);
391       }
392     }
393   }
394   return array_filter($files);
395 }

if (!empty($extensions)) returns TRUE when there is no extension because $extensions = array( '0' => ''), it is not an empty array. That may be the real issue.

Comments

Syg’s picture

Other occurence of this test line 182 :

179   // Default is to block access to all files protected by file access - unless granted by file access
180   $ext = pathinfo($filepath, PATHINFO_EXTENSION);
181   $extensions = explode(' ', variable_get('file_access_extensions', ''));
182   if (!empty($extensions) && !in_array($ext, $extensions)) { // debug
183     return;
184   }
185   else {
186     return -1;
187   }