Line 213 | Line 213 |
---|
*/ static public function get_extension($filename) {
|
*/ static public function get_extension($filename) {
|
| $filename = utf8_basename($filename);
|
if (strpos($filename, '.') === false) { return '';
| if (strpos($filename, '.') === false) { return '';
|
Line 773 | Line 775 |
---|
}
$url = parse_url($upload_url);
|
}
$url = parse_url($upload_url);
|
| $default_port = 80; $hostname = $url['host'];
if ($url['scheme'] == 'https') { $default_port = 443; $hostname = 'tls://' . $url['host']; }
|
$host = $url['host']; $path = $url['path'];
|
$host = $url['host']; $path = $url['path'];
|
$port = (!empty($url['port'])) ? (int) $url['port'] : 80;
| $port = (!empty($url['port'])) ? (int) $url['port'] : $default_port;
|
$upload_ary['type'] = 'application/octet-stream';
| $upload_ary['type'] = 'application/octet-stream';
|
Line 816 | Line 827 |
---|
$errno = 0; $errstr = '';
|
$errno = 0; $errstr = '';
|
if (!($fsock = @fsockopen($host, $port, $errno, $errstr)))
| if (!($fsock = @fsockopen($hostname, $port, $errno, $errstr)))
|
{ $file = new fileerror($user->lang[$this->error_prefix . 'NOT_UPLOADED']); return $file;
| { $file = new fileerror($user->lang[$this->error_prefix . 'NOT_UPLOADED']); return $file;
|
Line 917 | Line 928 |
---|
return $file; }
|
return $file; }
|
$tmp_path = (!@ini_get('safe_mode') || strtolower(@ini_get('safe_mode')) == 'off') ? false : $phpbb_root_path . 'cache';
| $tmp_path = (!@ini_get('safe_mode') || strtolower(@ini_get('safe_mode')) == 'off') ? sys_get_temp_dir() : $phpbb_root_path . 'cache';
|
$filename = tempnam($tmp_path, unique_id() . '-');
if (!($fp = @fopen($filename, 'wb')))
| $filename = tempnam($tmp_path, unique_id() . '-');
if (!($fp = @fopen($filename, 'wb')))
|