From: kink Date: Mon, 11 Nov 2002 22:02:55 +0000 (+0000) Subject: A preference-line can be of "unlimited" length now X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=710a8254ee65541ea794849eeebb59c65356e349;p=squirrelmail.git 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 --- 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);