From 1071ae953d0cb4bf7aff1d0e714b987e8abd9ab0 Mon Sep 17 00:00:00 2001 From: fidian Date: Wed, 31 Jan 2001 16:55:05 +0000 Subject: [PATCH] Apparently usort() REQUIRES a user-defined function instead of a PHP built-in function. Worked fine on my machine, killed the server on another. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@1003 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/imap_mailbox.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/functions/imap_mailbox.php b/functions/imap_mailbox.php index cb4237c6..e2c843dd 100755 --- a/functions/imap_mailbox.php +++ b/functions/imap_mailbox.php @@ -162,6 +162,16 @@ return $boxes; } + + /* Apparently you must call a user function with usort instead + * of calling a built-in directly. Stupid. + * Patch from dave_michmerhuizen@yahoo.com + * Allows case insensitivity when sorting folders + */ + function user_strcasecmp($a, $b) + { + return strcasecmp($a, $b); + } /****************************************************************************** @@ -204,7 +214,7 @@ } $sorted_lsub_ary = $new_ary; if (isset($sorted_lsub_ary)) { - usort($sorted_lsub_ary, "strcasecmp"); + usort($sorted_lsub_ary, "user_strcasecmp"); //sort($sorted_lsub_ary); } -- 2.25.1