From 710a8254ee65541ea794849eeebb59c65356e349 Mon Sep 17 00:00:00 2001 From: kink Date: Mon, 11 Nov 2002 22:02:55 +0000 Subject: [PATCH] A preference-line can be of "unlimited" length now git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@4137 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/file_prefs.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/functions/file_prefs.php b/functions/file_prefs.php index eadf3fad..75b919c3 100644 --- a/functions/file_prefs.php +++ b/functions/file_prefs.php @@ -49,9 +49,15 @@ function cachePrefValues($data_dir, $username) { /* Read in the preferences. */ $highlight_num = 0; while (! feof($file)) { - // Make sure that this fgets is larger than any of the pref strings - // could ever be. 1024 is too short - $pref = trim(fgets($file, 65536)); + $pref = ''; + /* keep reading a pref until we reach an eol (\n (or \r for macs)) */ + while($read = fgets($file, 1024)) + { + $pref .= $read; + if(strpos($read,"\n") || strpos($read,"\r")) + break; + } + $pref = trim($pref); $equalsAt = strpos($pref, '='); if ($equalsAt > 0) { $key = substr($pref, 0, $equalsAt); -- 2.25.1