Changeset 6c95b3e4 in github
- Timestamp:
- Apr 19, 2012 5:42:01 AM (13 months ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo
- Children:
- a2f896b
- Parents:
- 5d66a4b
- File:
-
- 1 edited
-
plugins/password/drivers/directadmin.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
plugins/password/drivers/directadmin.php
r48e9c14 r6c95b3e4 6 6 * Driver to change passwords via DirectAdmin Control Panel 7 7 * 8 * @version 2. 08 * @version 2.1 9 9 * @author Victor Benincasa <vbenincasa@gmail.com> 10 10 * … … 63 63 * Very, very basic usage: 64 64 * $Socket = new HTTPSocket; 65 * echo $Socket->get('http://user:pass@some site.com/somedir/some.file?query=string&this=that');65 * echo $Socket->get('http://user:pass@somehost.com:2222/CMD_API_SOMEAPI?query=string&this=that'); 66 66 * 67 67 * @author Phi1 'l0rdphi1' Stier <l0rdphi1@liquenox.net> 68 * @updates 2.7 and 2.8 by Victor Benincasa <vbenincasa @ gmail.com> 68 69 * @package HTTPSocket 69 * @version 2. 7 (Updated by Victor Benincasa <vbenincasa@gmail.com>)70 * @version 2.8 70 71 */ 71 72 class HTTPSocket { 72 73 73 var $version = '2. 7';74 74 var $version = '2.8'; 75 75 76 /* all vars are private except $error, $query_cache, and $doFollowLocationHeader */ 76 77 … … 108 109 if (!is_numeric($port)) 109 110 { 110 $port = 80;111 $port = 2222; 111 112 } 112 113 … … 167 168 $this->result_status_code = NULL; 168 169 169 // is our request a http :// ... ?170 if (preg_match(' !^http://!i',$request))170 // is our request a http(s):// ... ? 171 if (preg_match('/^(http|https):\/\//i',$request)) 171 172 { 172 173 $location = parse_url($request); 173 174 $this->connect($location['host'],$location['port']); 174 175 $this->set_login($location['user'],$location['pass']); 175 176 176 177 $request = $location['path']; 177 178 $content = $location['query']; … … 186 187 $array_headers = array( 187 188 'User-Agent' => "HTTPSocket/$this->version", 188 'Host' => ( $this->remote_port == 80 ? $this->remote_host : "$this->remote_host:$this->remote_port"),189 'Host' => ( $this->remote_port == 80 ? parse_url($this->remote_host,PHP_URL_HOST) : parse_url($this->remote_host,PHP_URL_HOST).":".$this->remote_port ), 189 190 'Accept' => '*/*', 190 191 'Connection' => 'Close' ); … … 326 327 327 328 } 328 329 329 330 list($this->result_header,$this->result_body) = preg_split("/\r\n\r\n/",$this->result,2); 330 331 … … 365 366 } 366 367 } 368 367 369 } 368 370 … … 448 450 { 449 451 $array_headers = preg_split("/\r\n/",$this->result_header); 450 452 451 453 $array_return = array( 0 => $array_headers[0] ); 452 454 unset($array_headers[0]);
Note: See TracChangeset
for help on using the changeset viewer.
