  |
1 | 1 | | <?php |
| |
2 | 2 | | /* |
  |
3 | | - | $Id: http_client.php 153 2005-08-04 12:57:59Z hpdl $ |
| |
| 3 | + | $Id: http_client.php 734 2006-08-20 17:56:47Z hpdl $ |
|
4 | 4 | | |
| |
5 | 5 | | osCommerce, Open Source E-Commerce Solutions |
| |
6 | 6 | | http://www.oscommerce.com |
| |
|
|
 |
… |
|
51 | 51 | | * @seeAlso connect |
| |
52 | 52 | | **/ |
| |
53 | 53 | | function httpClient($host = '', $port = '') { |
  |
54 | | - | if (tep_not_null($host)) { |
| |
| 54 | + | if (!empty($host)) { |
|
55 | 55 | | $this->connect($host, $port); |
| |
56 | 56 | | } |
| |
57 | 57 | | } |
| |
|
|
 |
… |
|
136 | 136 | | function Connect($host, $port = '') { |
| |
137 | 137 | | $this->url['scheme'] = 'http'; |
| |
138 | 138 | | $this->url['host'] = $host; |
  |
139 | | - | if (tep_not_null($port)) $this->url['port'] = $port; |
| |
| 139 | + | if (!empty($port)) $this->url['port'] = $port; |
|
140 | 140 | | |
| |
141 | 141 | | return true; |
| |
142 | 142 | | } |
| |
|
|
 |
… |
|
325 | 325 | | $port = $this->url['port']; |
| |
326 | 326 | | } |
| |
327 | 327 | | |
  |
328 | | - | if (!tep_not_null($port)) $port = 80; |
| |
| 328 | + | if (!!empty($port)) $port = 80; |
|
329 | 329 | | |
| |
330 | 330 | | if (!$this->socket = fsockopen($host, $port, $this->reply, $this->replyString)) { |
| |
331 | 331 | | return false; |
| |
332 | 332 | | } |
| |
333 | 333 | | |
  |
334 | | - | if (tep_not_null($this->requestBody)) { |
| |
| 334 | + | if (!empty($this->requestBody)) { |
|
335 | 335 | | $this->addHeader('Content-Length', strlen($this->requestBody)); |
| |
336 | 336 | | } |
| |
337 | 337 | | |
| |
|
|
 |
… |
|
344 | 344 | | } |
| |
345 | 345 | | } |
| |
346 | 346 | | |
  |
347 | | - | if (tep_not_null($this->requestBody)) { |
| |
| 347 | + | if (!empty($this->requestBody)) { |
  |
348 | 348 | | $cmd .= "\r\n" . $this->requestBody; |
| |
349 | 349 | | } |
| |
350 | 350 | | |