# HG changeset patch # User Matti Hamalainen # Date 1417157450 -7200 # Node ID ef0d8615ec06fb8b3d84d5894b7eacdd5bf031d1 # Parent 6549fb84a814558edd3b3124d103d8f2e78a3648 Add silent option to stProbeFileInfo() diff -r 6549fb84a814 -r ef0d8615ec06 msite.inc.php --- a/msite.inc.php Fri Nov 28 08:40:32 2014 +0200 +++ b/msite.inc.php Fri Nov 28 08:50:50 2014 +0200 @@ -1049,7 +1049,7 @@ // // Probe file type information // -function stProbeFileInfo($filename) +function stProbeFileInfo($filename, $silent = FALSE) { global $fileTypeData; @@ -1068,7 +1068,7 @@ if ($sdata === FALSE || $smime === FALSE) { stLogError("Failed to probe file '".$filename."'."); - return stError("Internal error, failed to probe file."); + return stError("Failed to probe file."); } // Match through our supported types .. @@ -1086,6 +1086,9 @@ return $fdata; } + if ($silent) + return FALSE; + stLogError("File '".$filename."' (".$smime.") did not match any defined file types [".$sdata."]."); return stError("No matching defined file type found for '".$smime."'."); }