diff options
author | Andreas Fischer <bantu@phpbb.com> | 2012-08-07 02:47:18 +0200 |
---|---|---|
committer | Andreas Fischer <bantu@phpbb.com> | 2012-08-07 02:47:18 +0200 |
commit | bba348d68a3114c3c6cad6f1d92855084ce8fa64 (patch) | |
tree | 23e855e1e7d3cd584be6ea9d012ea48c120aacc4 /phpBB/includes/functions_download.php | |
parent | b6d4ee4244602183f99d57ee154757cd68c7eb75 (diff) | |
download | forums-bba348d68a3114c3c6cad6f1d92855084ce8fa64.tar forums-bba348d68a3114c3c6cad6f1d92855084ce8fa64.tar.gz forums-bba348d68a3114c3c6cad6f1d92855084ce8fa64.tar.bz2 forums-bba348d68a3114c3c6cad6f1d92855084ce8fa64.tar.xz forums-bba348d68a3114c3c6cad6f1d92855084ce8fa64.zip |
[feature/attach-dl] phpbb_check_attach_extensions: Get rid of pass-by-reference
PHPBB3-11042
Diffstat (limited to 'phpBB/includes/functions_download.php')
-rw-r--r-- | phpBB/includes/functions_download.php | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/phpBB/includes/functions_download.php b/phpBB/includes/functions_download.php index 7d21147ab5..74c8be5f7b 100644 --- a/phpBB/includes/functions_download.php +++ b/phpBB/includes/functions_download.php @@ -618,21 +618,20 @@ function phpbb_increment_downloads($db, $ids) * Checks every attachment to see if it has an allowed extension * * @param array $extensions As generated by phpbb_cache_service::obtain_attach_extensions -* @param array &$attachments An array of attachments to check +* @param array $attachments An array of attachment row to check * -* @return bool Whether any of the attachments had allowed extensions +* @return array Array of attachment rows with allowed extension */ -function phpbb_check_attach_extensions($extensions, &$attachments) +function phpbb_filter_disallowed_extensions($extensions, $attachments) { - $new_ary = array(); - foreach ($attachments as $attach) + $result = array(); + foreach ($attachments as $row) { - if (isset($extensions['_allowed_'][$attach['extension']])) + if (isset($extensions['_allowed_'][$row['extension']])) { - $new_ary[] = $attach; + $result[] = $row; } } - $attachments = $new_ary; - return !empty($attachments); + return $result; } |