- Timestamp:
- Dec 12, 2010, 11:16:12 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/2.1 merged: 8089
- Property svn:mergeinfo changed
-
trunk/admin/include/functions.php
r8084 r8090 1726 1726 $method = empty($post_data) ? 'GET' : 'POST'; 1727 1727 $request = empty($post_data) ? '' : http_build_query($post_data, '', '&'); 1728 $src = add_url_params($src, $get_data, '&'); 1728 if (!empty($get_data)) 1729 { 1730 $src .= strpos($src, '?') === false ? '?' : '&'; 1731 $src .= http_build_query($get_data, '', '&'); 1732 } 1729 1733 1730 1734 // Initialize $dest … … 1742 1746 { 1743 1747 @curl_setopt($ch, CURLOPT_POST, 1); 1744 @curl_setopt($ch, CURLOPT_POSTFIELDS, $ post_data);1748 @curl_setopt($ch, CURLOPT_POSTFIELDS, $request); 1745 1749 } 1746 1750 $content = @curl_exec($ch); … … 1766 1770 'http' => array( 1767 1771 'method' => $method, 1768 'content' => $request,1769 1772 'user_agent' => $user_agent, 1770 1773 ) 1771 1774 ); 1775 if ($method == 'POST') 1776 { 1777 $opts['http']['content'] = $request; 1778 } 1772 1779 $context = @stream_context_create($opts); 1773 1780 $content = @file_get_contents($src, false, $context); … … 1792 1799 $http_request = $method." ".$path." HTTP/1.0\r\n"; 1793 1800 $http_request .= "Host: ".$host."\r\n"; 1794 $http_request .= "Content-Type: application/x-www-form-urlencoded;\r\n"; 1795 $http_request .= "Content-Length: ".strlen($request)."\r\n"; 1801 if ($method == 'POST') 1802 { 1803 $http_request .= "Content-Type: application/x-www-form-urlencoded;\r\n"; 1804 $http_request .= "Content-Length: ".strlen($request)."\r\n"; 1805 } 1796 1806 $http_request .= "User-Agent: ".$user_agent."\r\n"; 1797 1807 $http_request .= "Accept: */*\r\n";
Note: See TracChangeset
for help on using the changeset viewer.