Permalink
Browse files

fix #6199: no longer pass nul to System::which() from which()

git-svn-id: http://svn.php.net/repository/pear/packages/System_Command/trunk@202922 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
1 parent 0aa6d97 commit fc96bc2938bbfe72d915a99912a3176c52e28b3c Craig Constantine committed Dec 15, 2005
Showing with 7 additions and 1 deletion.
  1. +7 −1 Command.php
View
@@ -429,7 +429,13 @@ function execute()
*/
function which($in_cmd)
{
- return System::which($in_cmd);
+ // only pass non-empty strings to System::which()
+ if (!is_string($in_cmd) || '' === $in_cmd) {
+ return(false);
+ }
+
+ // explicitly pass false as fallback value
+ return System::which($in_cmd, false);
}
// }}}

0 comments on commit fc96bc2

Please sign in to comment.