aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_compress.php
diff options
context:
space:
mode:
authorFyorl <gaelreth@gmail.com>2012-08-05 11:29:02 +0100
committerFyorl <gaelreth@gmail.com>2012-08-05 11:29:02 +0100
commit3390712ed7097fb11d564fb6bd82d74c6b8e3731 (patch)
tree10e8c7e8c5b921336086f311f7395b8150ce20bf /phpBB/includes/functions_compress.php
parent70d9c02aae2ae357deb5ab415469fbbf965d0177 (diff)
downloadforums-3390712ed7097fb11d564fb6bd82d74c6b8e3731.tar
forums-3390712ed7097fb11d564fb6bd82d74c6b8e3731.tar.gz
forums-3390712ed7097fb11d564fb6bd82d74c6b8e3731.tar.bz2
forums-3390712ed7097fb11d564fb6bd82d74c6b8e3731.tar.xz
forums-3390712ed7097fb11d564fb6bd82d74c6b8e3731.zip
[ticket/11044] Minor adjustments as per PR comments
Changed private to protected, renamed check_name to unique_filename. PHPBB3-11044
Diffstat (limited to 'phpBB/includes/functions_compress.php')
-rw-r--r--phpBB/includes/functions_compress.php13
1 files changed, 7 insertions, 6 deletions
diff --git a/phpBB/includes/functions_compress.php b/phpBB/includes/functions_compress.php
index 2d8ad84657..869ed21cea 100644
--- a/phpBB/includes/functions_compress.php
+++ b/phpBB/includes/functions_compress.php
@@ -26,7 +26,7 @@ class compress
/**
* @var array
*/
- private $filelist = array();
+ protected $filelist = array();
/**
* Add file to archive
@@ -132,11 +132,12 @@ class compress
* returns a new, unique name.
*
* @param string $name The filename
- * @return string A unique string
+ * @return string A unique filename
*/
- private function check_name($name)
+ protected function unique_filename($name)
{
- if (isset($this->filelist[$name])) {
+ if (isset($this->filelist[$name]))
+ {
$this->filelist[$name]++;
return $name . '.' . $this->filelist[$name];
}
@@ -384,7 +385,7 @@ class compress_zip extends compress
function data($name, $data, $is_dir = false, $stat)
{
$name = str_replace('\\', '/', $name);
- $name = $this->check_name($name);
+ $name = $this->unique_filename($name);
$hexdtime = pack('V', $this->unix_to_dos_time($stat[9]));
@@ -657,7 +658,7 @@ class compress_tar extends compress
*/
function data($name, $data, $is_dir = false, $stat)
{
- $name = $this->check_name($name);
+ $name = $this->unique_filename($name);
$this->wrote = true;
$fzwrite = ($this->isbz && function_exists('bzwrite')) ? 'bzwrite' : (($this->isgz && @extension_loaded('zlib')) ? 'gzwrite' : 'fwrite');