Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix from Stede Bonnett (iocon) for bug #14839. Net_Ping::checkHost() …

…hadn't been

adjusted after the ping output parser rewriting was accomplished.


git-svn-id: http://svn.php.net/repository/pear/packages/Net_Ping/trunk@274726 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
commit f18609792585e22ae5d04358882b49ebaf2e94e4 1 parent 41eae81
Craig Constantine authored
Showing with 4 additions and 14 deletions.
  1. +4 −14 Ping.php
View
18 Ping.php
@@ -16,7 +16,7 @@
// | Authors: Martin Jansen <mj@php.net> |
// | Tomas V.V.Cox <cox@idecnet.com> |
// | Jan Lehnardt <jan@php.net> |
-// | Kai Schr�der <k.schroeder@php.net> |
+// | Kai Schrder <k.schroeder@php.net> |
// | Craig Constantine <cconstantine@php.net> |
// +----------------------------------------------------------------------+
//
@@ -422,20 +422,10 @@ function checkHost($host, $severely = true)
if (PEAR::isError($res)) {
return false;
}
- if (!preg_match_all('|\d+|', $res[3], $matches) || count($matches[0]) < 3) {
- ob_start();
- $rep = ob_get_contents();
- ob_end_clean();
- trigger_error("Output format seems not to be supported, please report ".
- "the following to pear-dev@lists.php.net, including your ".
- "version of ping:\n $rep");
+ if ($res->_received == 0) {
return false;
}
- if ($matches[0][1] == 0) {
- return false;
- }
- // [0] => transmitted, [1] => received
- if ($matches[0][0] != $matches[0][1] && $severely) {
+ if ($res->_received != $res->_transmitted && $severely) {
return false;
}
return true;
@@ -448,7 +438,7 @@ function checkHost($host, $severely = true)
* @param mixed $error a PEAR error or a string with the error message
* @return bool false
* @access private
- * @author Kai Schr�der <k.schroeder@php.net>
+ * @author Kai Schrder <k.schroeder@php.net>
*/
function _raiseError($error)
{
Please sign in to comment.
Something went wrong with that request. Please try again.