From 8c1b3464ffbd667feb005efea4969cadbb37140c Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Thu, 4 Oct 2012 01:17:46 +0200 Subject: [PATCH] Throw exception if the homedir cannot be determined --- snippets/php/path_root_validation.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/snippets/php/path_root_validation.php b/snippets/php/path_root_validation.php index 07bc79d..315e113 100644 --- a/snippets/php/path_root_validation.php +++ b/snippets/php/path_root_validation.php @@ -93,6 +93,10 @@ class PathValidator $userinfo = posix_getpwuid(posix_getuid()); $homedir = $userinfo['dir']; } + else + { + throw new Exception("Could not find a way to get the home directory of the current user."); + } $homedir = $this->RemoveTrailingSlash($homedir);