Skip to content
Browse files

fix for Bug #12791: Net_Ping does not properly fail when ping is not …

…located

git-svn-id: http://svn.php.net/repository/pear/packages/Net_Ping/trunk@274728 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
1 parent f186097 commit 42e69d28d0b53ab0cf395b0f2e67990f805ec1aa Craig Constantine committed Jan 27, 2009
Showing with 7 additions and 1 deletion.
  1. +7 −1 Ping.php
View
8 Ping.php
@@ -244,7 +244,13 @@ function _setPingPath($sysname)
if (0 != $status) {
return NET_PING_CANT_LOCATE_PING_BINARY;
} else {
- return $ping_path;
+ // be certain "which" did what we expect. (ref bug #12791)
+ if ( is_executable($ping_path) ) {
+ return $ping_path;
+ }
+ else {
+ return NET_PING_CANT_LOCATE_PING_BINARY;
+ }
}
}
} /* function _setPingPath() */

0 comments on commit 42e69d2

Please sign in to comment.
Something went wrong with that request. Please try again.