Changeset 8089
- Timestamp:
- Dec 12, 2010, 11:14:16 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.1/admin/include/functions.php
r8086 r8089 1708 1708 $method = empty($post_data) ? 'GET' : 'POST'; 1709 1709 $request = empty($post_data) ? '' : http_build_query($post_data, '', '&'); 1710 $src = add_url_params($src, $get_data, '&'); 1710 if (!empty($get_data)) 1711 { 1712 $src .= strpos($src, '?') === false ? '?' : '&'; 1713 $src .= http_build_query($get_data, '', '&'); 1714 } 1711 1715 1712 1716 // Initialize $dest … … 1724 1728 { 1725 1729 @curl_setopt($ch, CURLOPT_POST, 1); 1726 @curl_setopt($ch, CURLOPT_POSTFIELDS, $ post_data);1730 @curl_setopt($ch, CURLOPT_POSTFIELDS, $request); 1727 1731 } 1728 1732 $content = @curl_exec($ch); … … 1748 1752 'http' => array( 1749 1753 'method' => $method, 1750 'content' => $request,1751 1754 'user_agent' => $user_agent, 1752 1755 ) 1753 1756 ); 1757 if ($method == 'POST') 1758 { 1759 $opts['http']['content'] = $request; 1760 } 1754 1761 $context = @stream_context_create($opts); 1755 1762 $content = @file_get_contents($src, false, $context); … … 1774 1781 $http_request = $method." ".$path." HTTP/1.0\r\n"; 1775 1782 $http_request .= "Host: ".$host."\r\n"; 1776 $http_request .= "Content-Type: application/x-www-form-urlencoded;\r\n"; 1777 $http_request .= "Content-Length: ".strlen($request)."\r\n"; 1783 if ($method == 'POST') 1784 { 1785 $http_request .= "Content-Type: application/x-www-form-urlencoded;\r\n"; 1786 $http_request .= "Content-Length: ".strlen($request)."\r\n"; 1787 } 1778 1788 $http_request .= "User-Agent: ".$user_agent."\r\n"; 1779 1789 $http_request .= "Accept: */*\r\n";
Note: See TracChangeset
for help on using the changeset viewer.