Version 3.4.8

This commit is contained in:
Neo committed 2025-12-19 00:42:42 -08:00
1 parent b45ea0dffb
commit c603205a25
1398 files changed
+36675 -31023

No files matched your search

+31 -35
View File
@@ -3,19 +3,19 @@
/**
* <pre>
* Invision Power Services
* IP.Board v3.4.6
* IP.Board v3.4.8
* Wrapper for retrieving file contents. Methods available for removing files and directories as well.
* Last Updated: $Date: 2013-04-23 22:13:24 -0400 (Tue, 23 Apr 2013) $
* Last Updated: $Date: 2015-04-22 12:58:04 -0400 (Wed, 22 Apr 2015) $
* </pre>
*
* @author $Author: bfarber $
* @author $Author: stuarts $
* @copyright (c) 2001 - 2009 Invision Power Services, Inc.
* @license http://www.invisionpower.com/company/standards.php#license
* @package IP.Board
* @subpackage Kernel
* @link http://www.invisionpower.com
* @since Tuesday 22nd February 2005 (16:55)
* @version $Revision: 12195 $
* @version $Revision: 12625 $
*/
if ( ! defined( 'IPS_CLASSES_PATH' ) )
@@ -312,6 +312,8 @@ class classFileManagement
// Open connection
//-------------------------------
$post_back_str = FALSE;
if ( ! $fp = @fsockopen( $url_parts['scheme'] == 'https' ? "ssl://" . $host : $host, $port, $errno, $errstr, $this->timeout ) )
{
$this->errors[] = "Could not establish a connection with {$host}";
@@ -344,11 +346,28 @@ class classFileManagement
$post_back_str = $post_array;
}
$header = "POST {$path} HTTP/1.0\r\nHost:{$host}\r\nContent-Type: application/x-www-form-urlencoded\r\nConnection: Keep-Alive{$userAgent}\r\nContent-Length: " . strlen($post_back_str) . "\r\n{$final_carriage}{$post_back_str}";
$header = "POST {$path} HTTP/1.0\r\nHost: {$host}\r\nContent-Type: application/x-www-form-urlencoded\r\nConnection: Keep-Alive{$userAgent}\r\nContent-Length: " . strlen($post_back_str) . "\r\n{$final_carriage}";
}
else
{
$header = "GET {$path} HTTP/1.0\r\nHost:{$host}\r\nConnection: Keep-Alive{$userAgent}\r\n{$final_carriage}";
$header = "GET {$path} HTTP/1.0\r\nHost: {$host}\r\nConnection: Keep-Alive{$userAgent}\r\n{$final_carriage}";
}
if ( $this->auth_req )
{
if ( $this->auth_user && $this->auth_pass )
{
$header .= "Authorization: Basic ".base64_encode("{$this->auth_user}:{$this->auth_pass}")."\r\n\r\n";
}
}
elseif ( $this->auth_raw )
{
$header .= $this->auth_raw."\r\n\r\n";
}
if ( $post_back_str !== FALSE )
{
$header .= $post_back_str;
}
if ( ! fputs( $fp, $header ) )
@@ -356,30 +375,6 @@ class classFileManagement
$this->errors[] = "Unable to send request to {$host}!";
return FALSE;
}
if ( $this->auth_req )
{
if ( $this->auth_user && $this->auth_pass )
{
$header = "Authorization: Basic ".base64_encode("{$this->auth_user}:{$this->auth_pass}")."\r\n\r\n";
if ( ! fputs( $fp, $header ) )
{
$this->errors[] = "Authorization Failed!";
return FALSE;
}
}
}
elseif ( $this->auth_raw )
{
$header = $this->auth_raw."\r\n\r\n";
if ( ! fputs( $fp, $header ) )
{
$this->errors[] = "Authorization Failed!";
return FALSE;
}
}
}
@stream_set_timeout( $fp, $this->timeout );
@@ -562,7 +557,10 @@ class classFileManagement
$data = curl_exec($ch);
}
}
/* Grab info for header removal */
$info = curl_getinfo( $ch );
curl_close($ch);
if ( stristr( $data, 'HTTP/1.0 100 Continue' ) or stristr( $data, 'HTTP/1.1 100 Continue' ) )
@@ -576,10 +574,8 @@ class classFileManagement
if ( $data )
{
$tmp = preg_split("/\r\n\r\n/", $data, 2);
$data = trim($tmp[1]);
$this->raw_headers = trim($tmp[0]);
$this->raw_headers = substr( $data, 0, $info['header_size'] );
$data = substr( $data, $info['header_size'] );
}
$this->http_status_code = substr( $this->raw_headers, 9, 3 );