From 821a8e9c911de27a3af9eae6591f2b51312e9be5 Mon Sep 17 00:00:00 2001 From: fidian Date: Thu, 19 Apr 2001 20:58:16 +0000 Subject: [PATCH] * Potential fix for Win32 builds where 'getrusage' is a function but is not supported. I ignore the warning and check the result to make sure it is an array. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@1264 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/strings.php | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/functions/strings.php b/functions/strings.php index dea7319a..1aa09488 100644 --- a/functions/strings.php +++ b/functions/strings.php @@ -368,13 +368,17 @@ // getrusage if (function_exists('getrusage')) { - $dat = getrusage(); - $Str = ''; - foreach ($dat as $k => $v) - { - $Str .= $k . $v; - } - sq_mt_seed(md5($Str)); + // Avoid warnings with Win32 + $dat = @getrusage(); + if (isset($dat) && is_array($dat)) + { + $Str = ''; + foreach ($dat as $k => $v) + { + $Str .= $k . $v; + } + sq_mt_seed(md5($Str)); + } } // Apache-specific -- 2.25.1