Skip to content

Commit

Permalink
Put file info into temporary variable. Fixes Studio-42#136
Browse files Browse the repository at this point in the history
  • Loading branch information
maskas authored and nao-pon committed Jan 23, 2013
1 parent eea54c5 commit b9df301
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions php/elFinderVolumeDriver.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -674,10 +674,13 @@ public function mount(array $opts) {
$type = strtolower($this->options['mimeDetect']);
$type = preg_match('/^(finfo|mime_content_type|internal|auto)$/i', $type) ? $type : 'auto';
$regexp = '/text\/x\-(php|c\+\+)/';



$tmpFileInfo = explode(';', @finfo_file(finfo_open(FILEINFO_MIME), __FILE__));

if (($type == 'finfo' || $type == 'auto')
&& class_exists('finfo')
&& preg_match($regexp, array_shift(($tmp = explode(';', @finfo_file(finfo_open(FILEINFO_MIME), __FILE__)))))) {
&& preg_match($regexp, array_shift($tmpFileInfo))) {
$type = 'finfo';
$this->finfo = finfo_open(FILEINFO_MIME);
} elseif (($type == 'mime_content_type' || $type == 'auto')
Expand Down

0 comments on commit b9df301

Please sign in to comment.