mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-02 01:52:10 +09:00
Apply allow_indexing_format to procFileDownload()
This commit is contained in:
parent
4c73b1fa93
commit
17e14546dd
2 changed files with 33 additions and 21 deletions
|
|
@ -181,6 +181,33 @@ class FileModel extends File
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the file is indexable
|
||||
* @param object $filename
|
||||
* @param object $file_module_config
|
||||
* @return bool
|
||||
*/
|
||||
public static function isIndexable($filename, $file_module_config)
|
||||
{
|
||||
if($file_module_config->allow_indexing_format)
|
||||
{
|
||||
$allow_indexing_format_array = array();
|
||||
$allow_indexing_format_array = explode(',', $file_module_config->allow_indexing_format);
|
||||
if(!is_array($allow_indexing_format_array)) $allow_indexing_format_array[0] = $file_module_config->allow_indexing_format;
|
||||
|
||||
foreach($allow_indexing_format_array as $val)
|
||||
{
|
||||
$val = trim($val);
|
||||
if(preg_match("/\.{$val}$/i", $filename))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the file is deletable
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue