From: <abe...@us...> - 2015-12-07 17:29:07
|
Revision: 7380 http://sourceforge.net/p/astlinux/code/7380 Author: abelbeck Date: 2015-12-07 17:29:04 +0000 (Mon, 07 Dec 2015) Log Message: ----------- web interface, fix a sloppy conditional from 8 years ago that got replicated over the years, previously a line containing only '0' (among others) would be treated as an empty line. Most likely did not effect any users. Modified Paths: -------------- branches/1.0/package/webinterface/altweb/admin/cdrlog.php branches/1.0/package/webinterface/altweb/admin/confbridge.php branches/1.0/package/webinterface/altweb/admin/edit.php branches/1.0/package/webinterface/altweb/admin/fossilcmd.php branches/1.0/package/webinterface/altweb/admin/meetme.php branches/1.0/package/webinterface/altweb/admin/monitor.php branches/1.0/package/webinterface/altweb/admin/phoneprov.php branches/1.0/package/webinterface/altweb/admin/users.php branches/1.0/package/webinterface/altweb/admin/view.php branches/1.0/package/webinterface/altweb/admin/voicemail.php branches/1.0/package/webinterface/altweb/common/functions.php branches/1.0/package/webinterface/altweb/common/license.inc branches/1.0/package/webinterface/altweb/common/status.inc branches/1.0/package/webinterface/altweb/common/users-password.php Modified: branches/1.0/package/webinterface/altweb/admin/cdrlog.php =================================================================== --- branches/1.0/package/webinterface/altweb/admin/cdrlog.php 2015-12-07 01:40:00 UTC (rev 7379) +++ branches/1.0/package/webinterface/altweb/admin/cdrlog.php 2015-12-07 17:29:04 UTC (rev 7380) @@ -313,7 +313,7 @@ } $ph = @fopen($tmpfile, "r"); while (! feof($ph)) { - if ($line = trim(fgets($ph, 1024))) { + if (($line = trim(fgets($ph, 1024))) !== '') { $i = $map['commasafe']; $linetokens = explode('",', $line, ($i + 1)); if (isset($linetokens[$i])) { @@ -585,7 +585,7 @@ $last = (getPREFdef($global_prefs, 'cdrlog_last_show') === 'yes') ? getPREFdef($global_prefs, 'cdrlog_last_cmd') : ''; $map = mapCDRvalues($default, $extra, $last); while (! feof($fp)) { - if ($line = trim(fgets($fp, 1024))) { + if (($line = trim(fgets($fp, 1024))) !== '') { if (($line = parseCDRline($line, $format, $match, $map)) !== FALSE) { echo $line, "\n"; } Modified: branches/1.0/package/webinterface/altweb/admin/confbridge.php =================================================================== --- branches/1.0/package/webinterface/altweb/admin/confbridge.php 2015-12-07 01:40:00 UTC (rev 7379) +++ branches/1.0/package/webinterface/altweb/admin/confbridge.php 2015-12-07 17:29:04 UTC (rev 7380) @@ -144,7 +144,7 @@ if ($status == 0) { $ph = @fopen($tmpfile, "r"); while (! feof($ph)) { - if ($line = trim(fgets($ph, 1024))) { + if (($line = trim(fgets($ph, 1024))) !== '') { if (preg_match('/^([0-9]+) +([0-9]+) +([0-9]+) +([a-z]+).*$/', $line, $ips)) { $rooms[$id]['room'] = $ips[1]; $rooms[$id]['locked'] = ($ips[4] === 'locked') ? '1' : '0'; @@ -174,14 +174,14 @@ if ($status == 0) { $ph = @fopen($tmpfile, "r"); while (! feof($ph)) { // Skip through a line beginning with a = - if ($line = fgets($ph, 1024)) { + if (($line = fgets($ph, 1024)) != '') { if ($line[0] === '=') { break; } } } while (! feof($ph)) { - if ($line = trim(fgets($ph, 1024))) { + if (($line = trim(fgets($ph, 1024))) !== '') { if ($ast13) { if (preg_match('/^([^ ]+) .* ([^ ]+) *$/', $line, $ips)) { $db['data'][$id]['room'] = $room_list[$i]['room']; Modified: branches/1.0/package/webinterface/altweb/admin/edit.php =================================================================== --- branches/1.0/package/webinterface/altweb/admin/edit.php 2015-12-07 01:40:00 UTC (rev 7379) +++ branches/1.0/package/webinterface/altweb/admin/edit.php 2015-12-07 17:29:04 UTC (rev 7380) @@ -729,7 +729,7 @@ if ($openfile !== '') { if (($ph = @fopen($openfile, "rb")) !== FALSE) { while (! feof($ph)) { - if ($line = fgets($ph, 1024)) { + if (($line = fgets($ph, 1024)) != '') { $line = str_replace(chr(10), chr(13), $line); echo htmlspecialchars($line); } Modified: branches/1.0/package/webinterface/altweb/admin/fossilcmd.php =================================================================== --- branches/1.0/package/webinterface/altweb/admin/fossilcmd.php 2015-12-07 01:40:00 UTC (rev 7379) +++ branches/1.0/package/webinterface/altweb/admin/fossilcmd.php 2015-12-07 17:29:04 UTC (rev 7380) @@ -132,7 +132,7 @@ echo "<strong>----- Result too large to display, showing the end of the output -----</strong>\n"; } while (! feof($fp)) { - if ($line = fgets($fp, 1024)) { + if (($line = fgets($fp, 1024)) != '') { echo htmlspecialchars($line); } } Modified: branches/1.0/package/webinterface/altweb/admin/meetme.php =================================================================== --- branches/1.0/package/webinterface/altweb/admin/meetme.php 2015-12-07 01:40:00 UTC (rev 7379) +++ branches/1.0/package/webinterface/altweb/admin/meetme.php 2015-12-07 17:29:04 UTC (rev 7380) @@ -173,7 +173,7 @@ if ($status == 0) { $ph = @fopen($tmpfile, "r"); while (! feof($ph)) { - if ($line = trim(fgets($ph, 1024))) { + if (($line = trim(fgets($ph, 1024))) !== '') { if ($isASTERISKv1_4) { if (preg_match('/^([0-9][0-9]*) .*$/', $line, $ips)) { $rooms[$id]['room'] = $ips[1]; @@ -209,7 +209,7 @@ if ($status == 0) { $ph = @fopen($tmpfile, "r"); while (! feof($ph)) { - if ($line = trim(fgets($ph, 1024))) { + if (($line = trim(fgets($ph, 1024))) !== '') { if (strpos($line, '!') !== FALSE) { $ips = explode('!', $line); $db['data'][$id]['room'] = $room_list[$i]['room']; Modified: branches/1.0/package/webinterface/altweb/admin/monitor.php =================================================================== --- branches/1.0/package/webinterface/altweb/admin/monitor.php 2015-12-07 01:40:00 UTC (rev 7379) +++ branches/1.0/package/webinterface/altweb/admin/monitor.php 2015-12-07 17:29:04 UTC (rev 7380) @@ -30,7 +30,7 @@ if (($db['status'] = $status) == 0) { $ph = @fopen($tmpfile, "r"); while (! feof($ph)) { - if ($line = trim(fgets($ph, 1024))) { + if (($line = trim(fgets($ph, 1024))) !== '') { if (substr($line, 0, $ldir) === $dir) { if (($value = substr($line, $ldir)) !== '') { if (($stat = @stat($dir.$value)) !== FALSE) { Modified: branches/1.0/package/webinterface/altweb/admin/phoneprov.php =================================================================== --- branches/1.0/package/webinterface/altweb/admin/phoneprov.php 2015-12-07 01:40:00 UTC (rev 7379) +++ branches/1.0/package/webinterface/altweb/admin/phoneprov.php 2015-12-07 17:29:04 UTC (rev 7380) @@ -400,7 +400,7 @@ return(3); } while (! feof($fp)) { - if ($line = trim(fgets($fp, 1024))) { + if (($line = trim(fgets($fp, 1024))) !== '') { if ($line[0] !== '#') { if (preg_match('/^([^ \t]+)[ \t]+([^ \t]+)[ \t]+([^ \t]+)[ \t]+([^ \t]+)(.*)$/', $line, $tokens)) { $mac = strtolower($tokens[2]); Modified: branches/1.0/package/webinterface/altweb/admin/users.php =================================================================== --- branches/1.0/package/webinterface/altweb/admin/users.php 2015-12-07 01:40:00 UTC (rev 7379) +++ branches/1.0/package/webinterface/altweb/admin/users.php 2015-12-07 17:29:04 UTC (rev 7380) @@ -33,7 +33,7 @@ @exec('sed -n "/^\['.$context.'\]/,/^\[/ s/^[0-9][0-9]*[ ]*[=][> ]*[-*0-9]*,/&/p" '.$fname.' >'.$tmpfile); $ph = @fopen($tmpfile, "r"); while (! feof($ph)) { - if ($line = trim(fgets($ph, 1024))) { + if (($line = trim(fgets($ph, 1024))) !== '') { $linetokens = explode(',', $line); $boxtokens = explode('=', $linetokens[0]); $db['data'][$id]['mbox'] = trim($boxtokens[0], ' '); Modified: branches/1.0/package/webinterface/altweb/admin/view.php =================================================================== --- branches/1.0/package/webinterface/altweb/admin/view.php 2015-12-07 01:40:00 UTC (rev 7379) +++ branches/1.0/package/webinterface/altweb/admin/view.php 2015-12-07 17:29:04 UTC (rev 7380) @@ -77,7 +77,7 @@ echo "<strong>----- File too large to display, showing the end of the file -----</strong>\n"; } while (! feof($fp)) { - if ($line = fgets($fp, 1024)) { + if (($line = fgets($fp, 1024)) != '') { echo htmlspecialchars($line); } } Modified: branches/1.0/package/webinterface/altweb/admin/voicemail.php =================================================================== --- branches/1.0/package/webinterface/altweb/admin/voicemail.php 2015-12-07 01:40:00 UTC (rev 7379) +++ branches/1.0/package/webinterface/altweb/admin/voicemail.php 2015-12-07 17:29:04 UTC (rev 7380) @@ -80,7 +80,7 @@ $vm['cidnum'] = ''; $vm['duration'] = 0; while (! feof($ph)) { - if ($line = trim(fgets($ph, 1024))) { + if (($line = trim(fgets($ph, 1024))) !== '') { if ($line[0] !== ';' && $line[0] !== '[') { if (($pos = strpos($line, '=')) !== FALSE) { $var = trim(substr($line, 0, $pos), ' '); @@ -117,7 +117,7 @@ if (($db['status'] = $status) == 0) { $ph = @fopen($tmpfile, "r"); while (! feof($ph)) { - if ($line = trim(fgets($ph, 1024))) { + if (($line = trim(fgets($ph, 1024))) !== '') { if (substr($line, 0, $ldir) === $dir) { if (($value = substr($line, $ldir, -4)) !== '') { $path = $dir.$value.'.txt'; @@ -193,7 +193,7 @@ if (getPREFdef($global_prefs, 'voicemail_extern_notify') === 'yes') { if (($ph = popen("grep -m 1 '^externnotify' /etc/asterisk/voicemail.conf", "r")) !== FALSE) { if (! feof($ph)) { - if ($line = trim(fgets($ph, 1024))) { + if (($line = trim(fgets($ph, 1024))) !== '') { if (($pos = strpos($line, '=')) !== FALSE) { $value = trim(substr($line, ($pos + 1)), '" '); if (($pos = strpos($value, ' ')) !== FALSE) { Modified: branches/1.0/package/webinterface/altweb/common/functions.php =================================================================== --- branches/1.0/package/webinterface/altweb/common/functions.php 2015-12-07 01:40:00 UTC (rev 7379) +++ branches/1.0/package/webinterface/altweb/common/functions.php 2015-12-07 17:29:04 UTC (rev 7380) @@ -321,7 +321,7 @@ @exec($cmd); $ph = @fopen($tmpfile, "r"); while (! feof($ph)) { - if ($line = trim(fgets($ph, 1024))) { + if (($line = trim(fgets($ph, 1024))) !== '') { if (($pos = strpos($line, ':')) !== FALSE) { $linetokens = explode(':', $line); if ($linetokens[1] === '0') { @@ -502,7 +502,7 @@ @exec("sed -e 's/^#.*//' -e '/^$/ d' ".$conffile.' >'.$tmpfile); $ph = @fopen($tmpfile, "r"); while (! feof($ph)) { - if ($line = trim(fgets($ph, 1024))) { + if (($line = trim(fgets($ph, 1024))) !== '') { if (($pos = strpos($line, '=')) !== FALSE) { $var = trim(substr($line, 0, $pos), ' '); $line = substr($line, ($pos + 1)); @@ -510,7 +510,7 @@ if (($end = strrpos($line, '"')) !== FALSE) { if ($begin == $end) { // multi-line definition, single quote while (! feof($ph)) { - if ($qstr = rtrim(fgets($ph, 1024))) { + if (($qstr = rtrim(fgets($ph, 1024))) !== '') { if (($end = strrpos($qstr, '"')) !== FALSE && ! ($end > 0 && substr($qstr, $end - 1, 1) === '\\')) { if (($pos = strpos($qstr, '#', $end)) !== FALSE) { $qstr = substr($qstr, 0, $pos); @@ -729,7 +729,7 @@ if (($db['status'] = $status) == 0) { $ph = @fopen($tmpfile, "r"); while (! feof($ph)) { - if ($line = trim(fgets($ph, 1024))) { + if (($line = trim(fgets($ph, 1024))) !== '') { if (($pos = strpos($line, ': ')) !== FALSE) { $keystr = substr($line, 0, $pos); $valuestr = substr($line, ($pos + 2)); @@ -949,7 +949,7 @@ if (is_file($pfile)) { if (($ph = @fopen($pfile, "r")) !== FALSE) { while (! feof($ph)) { - if ($line = trim(fgets($ph, 1024))) { + if (($line = trim(fgets($ph, 1024))) !== '') { if ($line[0] !== '#') { if (($pos = strpos($line, '=')) !== FALSE) { $var = trim(substr($line, 0, $pos), ' '); Modified: branches/1.0/package/webinterface/altweb/common/license.inc =================================================================== --- branches/1.0/package/webinterface/altweb/common/license.inc 2015-12-07 01:40:00 UTC (rev 7379) +++ branches/1.0/package/webinterface/altweb/common/license.inc 2015-12-07 17:29:04 UTC (rev 7380) @@ -28,7 +28,7 @@ $id = 0; if (($fh = @fopen($file, "r")) !== FALSE) { while (! feof($fh)) { - if ($line = trim(fgets($fh, 1024))) { + if (($line = trim(fgets($fh, 1024))) !== '') { $linetokens = explode('~', $line); if (isset($linetokens[0]) && ($linetokens[0][0] !== '#')) { $status['data'][$id]['package'] = $linetokens[0]; @@ -66,7 +66,7 @@ putHtml('<tr><td class="dialogText" style="text-align: left;">'); if (($fp = @fopen($LICENSEFILE, "rb")) !== FALSE) { while (! feof($fp)) { - if ($line = fgets($fp, 1024)) { + if (($line = fgets($fp, 1024)) != '') { $line = str_replace('(c)', '<big>©</big>', htmlspecialchars($line)); echo $line; putHtml("<br />"); Modified: branches/1.0/package/webinterface/altweb/common/status.inc =================================================================== --- branches/1.0/package/webinterface/altweb/common/status.inc 2015-12-07 01:40:00 UTC (rev 7379) +++ branches/1.0/package/webinterface/altweb/common/status.inc 2015-12-07 17:29:04 UTC (rev 7380) @@ -106,7 +106,7 @@ $cid = 0; if (($ph = @fopen($log, "r")) !== FALSE) { while (! feof($ph)) { - if ($line = rtrim(fgets($ph, 1024))) { + if (($line = rtrim(fgets($ph, 1024))) !== '') { if (preg_match('/^([a-z][a-z.]*)[ :]*(.*)$/', $line, $ips)) { switch ($ips[1]) { case 'ups.model': @@ -133,7 +133,7 @@ $cid = -1; if (($ph = @fopen($log, "r")) !== FALSE) { while (! feof($ph)) { - if ($line = rtrim(fgets($ph, 1024))) { + if (($line = rtrim(fgets($ph, 1024))) !== '') { if (preg_match('/^([0-9a-fA-F][0-9a-fA-F.:]*).* ([0-9a-fA-F][0-9a-fA-F.:]*)/', $line, $ips)) { $cid++; $status['states'][$cid]['src'] = $ips[1]; @@ -186,7 +186,7 @@ $cid = 0; if (($ph = @fopen($log, "r")) !== FALSE) { while (! feof($ph)) { - if ($line = trim(fgets($ph, 1024))) { + if (($line = trim(fgets($ph, 1024))) !== '') { $linetokens = preg_split('/ +/', $line); if (isset($linetokens[3]) && isset($proto[$linetokens[3]])) { $bytes = 0; @@ -334,7 +334,7 @@ $cid = 0; if (($ph = @fopen($log, "r")) !== FALSE) { while (! feof($ph)) { - if ($line = trim(fgets($ph, 1024))) { + if (($line = trim(fgets($ph, 1024))) !== '') { $linetokens = explode(':', $line); if (isset($linetokens[4])) { $status['clients'][$cid]['proto'] = $linetokens[0]; @@ -366,7 +366,7 @@ $cur_time = time(); if (($ph = @fopen($log, "r")) !== FALSE) { while (! feof($ph)) { - if ($line = trim(fgets($ph, 1024))) { + if (($line = trim(fgets($ph, 1024))) !== '') { $linetokens = explode(' ', $line); if (isset($linetokens[0]) && ($linetokens[0] > $cur_time)) { $status['clients'][$cid]['expire'] = $linetokens[0]; @@ -399,7 +399,7 @@ if (($ph = @fopen($log, "r")) !== FALSE) { while (! feof($ph)) { - if ($line = trim(fgets($ph, 1024))) { + if (($line = trim(fgets($ph, 1024))) !== '') { $linetokens = explode(',', $line); if (strncasecmp($linetokens[0], 'UPDATED', 7) == 0) { $status['updated'] = $linetokens[1]; @@ -431,7 +431,7 @@ $cid = 0; if (($ph = @fopen($log, "r")) !== FALSE) { while (! feof($ph)) { - if ($line = trim(fgets($ph, 1024))) { + if (($line = trim(fgets($ph, 1024))) !== '') { $linetokens = explode(',', $line); if ($linetokens[0] === "TITLE") { $status['title'] = $linetokens[1]; @@ -528,7 +528,7 @@ $rconf = is_file('/etc/resolv-extern.conf') ? '/etc/resolv-extern.conf' : '/etc/resolv.conf'; if (($fp = @fopen($rconf, 'r')) !== FALSE) { while (! feof($fp)) { - if ($line = trim(fgets($fp, 1024))) { + if (($line = trim(fgets($fp, 1024))) !== '') { echo '<tr ', ($i++ % 2 == 0) ? 'class="dtrow0"' : 'class="dtrow1"', '>'; echo '<td class="dialogText" style="text-align: right; font-weight: bold;">', 'DNS:', '</td>'; echo '<td style="text-align: left;" colspan="3">', $line, '</td>'; @@ -627,7 +627,7 @@ if ($status == 0) { $ph = @fopen($tmpfile, "r"); while (! feof($ph)) { - if ($line = trim(fgets($ph, 1024))) { + if (($line = trim(fgets($ph, 1024))) !== '') { putText($line); } } @@ -646,7 +646,7 @@ $ph = @fopen($tmpfile, "r"); while (! feof($ph)) { - if ($line = trim(fgets($ph, 1024))) { + if (($line = trim(fgets($ph, 1024))) !== '') { putText($line); } } @@ -675,7 +675,7 @@ @exec('df -h | grep "^/dev/[sh]d[a-h][0-9]" | sort -k 1,1 >>'.$tmpfile); $ph = @fopen($tmpfile, "r"); while (! feof($ph)) { - if ($line = trim(fgets($ph, 1024))) { + if (($line = trim(fgets($ph, 1024))) !== '') { putText($line); } } @@ -708,7 +708,7 @@ if ($status == 0) { $ph = @fopen($tmpfile, "r"); while (! feof($ph)) { - if ($line = rtrim(fgets($ph, 1024))) { + if (($line = rtrim(fgets($ph, 1024))) !== '') { putText($line); } } @@ -899,7 +899,7 @@ putHtml('<pre>'); $ph = @fopen($tmpfile, "r"); while (! feof($ph)) { - if ($line = trim(fgets($ph, 1024))) { + if (($line = trim(fgets($ph, 1024))) !== '') { if (strncasecmp($line, 'verbosity ', 10) && stripos($line, 'command is deprecated') === FALSE) { putText($line); } @@ -922,7 +922,7 @@ asteriskCMD('sip show registry', $tmpfile); $ph = @fopen($tmpfile, "r"); while (! feof($ph)) { - if ($line = trim(fgets($ph, 1024))) { + if (($line = trim(fgets($ph, 1024))) !== '') { if (strncasecmp($line, 'verbosity ', 10)) { putText($line); } @@ -940,7 +940,7 @@ asteriskCMD('sip show peers', $tmpfile); $ph = @fopen($tmpfile, "r"); while (! feof($ph)) { - if ($line = trim(fgets($ph, 1024))) { + if (($line = trim(fgets($ph, 1024))) !== '') { if (strncasecmp($line, 'verbosity ', 10) && ((getPREFdef($global_prefs, 'status_exclude_extensions') !== 'yes') || !preg_match('/^[1-9]...\/[1-9].../', $line))) { putText($line); @@ -959,7 +959,7 @@ asteriskCMD('iax2 show registry', $tmpfile); $ph = @fopen($tmpfile, "r"); while (! feof($ph)) { - if ($line = trim(fgets($ph, 1024))) { + if (($line = trim(fgets($ph, 1024))) !== '') { if (strncasecmp($line, 'verbosity ', 10)) { putText($line); } @@ -977,7 +977,7 @@ asteriskCMD('iax2 show peers', $tmpfile); $ph = @fopen($tmpfile, "r"); while (! feof($ph)) { - if ($line = trim(fgets($ph, 1024))) { + if (($line = trim(fgets($ph, 1024))) !== '') { if (strncasecmp($line, 'verbosity ', 10) && ((getPREFdef($global_prefs, 'status_exclude_extensions') !== 'yes') || !preg_match('/^[1-9]...\/[1-9].../', $line))) { putText($line); @@ -999,7 +999,7 @@ asteriskCMD($cmd, $tmpfile); $ph = @fopen($tmpfile, "r"); while (! feof($ph)) { - if ($line = trim(fgets($ph, 1024))) { + if (($line = trim(fgets($ph, 1024))) !== '') { if (strncasecmp($line, 'verbosity ', 10) && stripos($line, 'command is deprecated') === FALSE) { putText($line); } @@ -1024,7 +1024,7 @@ } $ph = @fopen($tmpfile, "r"); while (! feof($ph)) { - if ($line = trim(fgets($ph, 1024))) { + if (($line = trim(fgets($ph, 1024))) !== '') { if (strncasecmp($line, 'verbosity ', 10)) { putText($line); } @@ -1045,7 +1045,7 @@ asteriskCMD($cmd, $tmpfile); $ph = @fopen($tmpfile, "r"); while (! feof($ph)) { - if ($line = trim(fgets($ph, 1024))) { + if (($line = trim(fgets($ph, 1024))) !== '') { if (strncasecmp($line, 'verbosity ', 10)) { putText($line); } @@ -1067,7 +1067,7 @@ asteriskCMD($cmd, $tmpfile); $ph = @fopen($tmpfile, "r"); while (! feof($ph)) { - if ($line = trim(fgets($ph, 1024))) { + if (($line = trim(fgets($ph, 1024))) !== '') { if (strncasecmp($line, 'verbosity ', 10)) { putText($line); } @@ -1114,12 +1114,12 @@ $ph = @fopen($tmpfile, "r"); if (! feof($ph)) { - if ($line = rtrim(fgets($ph, 1024))) { + if (($line = rtrim(fgets($ph, 1024))) !== '') { putText('Prosody Version: '.$line); } } while (! feof($ph)) { - if ($line = rtrim(fgets($ph, 1024))) { + if (($line = rtrim(fgets($ph, 1024))) !== '') { putText($line); } } @@ -1140,7 +1140,7 @@ $ph = @fopen($tmpfile, "r"); while (! feof($ph)) { - if ($line = trim(fgets($ph, 1024))) { + if (($line = trim(fgets($ph, 1024))) !== '') { putText($line); } } @@ -1232,7 +1232,7 @@ $ph = @fopen($tmpfile, "r"); while (! feof($ph)) { - if ($line = trim(fgets($ph, 1024))) { + if (($line = trim(fgets($ph, 1024))) !== '') { putText($line); } } @@ -1295,7 +1295,7 @@ } $ph = @fopen($tmpfile, "r"); while (! feof($ph)) { - if ($line = trim(fgets($ph, 1024))) { + if (($line = trim(fgets($ph, 1024))) !== '') { putText($line); } } Modified: branches/1.0/package/webinterface/altweb/common/users-password.php =================================================================== --- branches/1.0/package/webinterface/altweb/common/users-password.php 2015-12-07 01:40:00 UTC (rev 7379) +++ branches/1.0/package/webinterface/altweb/common/users-password.php 2015-12-07 17:29:04 UTC (rev 7380) @@ -27,7 +27,7 @@ if (($fp = @fopen($HTPASSWD,"rb")) !== FALSE) { while (! feof($fp)) { - if ($line = trim(fgets($fp, 1024))) { + if (($line = trim(fgets($fp, 1024))) !== '') { if (strncmp($line, 'admin:', 6) == 0) { $oldpass['admin'] = $line; } elseif (strncmp($line, 'staff:', 6) == 0) { @@ -117,7 +117,7 @@ if (($fp = @fopen($HTPASSWD,"rb")) !== FALSE) { $len = strlen($user) + 1; while (! feof($fp)) { - if ($line = trim(fgets($fp, 1024))) { + if (($line = trim(fgets($fp, 1024))) !== '') { if (strncmp($line, $user.':', $len) != 0) { $oldpass['users'][$id] = $line; $id++; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |